aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Marshall1997-05-29 07:04:00 +0000
committerSimon Marshall1997-05-29 07:04:00 +0000
commit38c979d349eb874f66f42f644b736efe541bbc05 (patch)
tree3e18813ecb487233fba75c1cd6690c6bd5cac8bf
parent3bef4cbd6fcb844e35de493b3041b17ec6b8e348 (diff)
downloademacs-38c979d349eb874f66f42f644b736efe541bbc05.tar.gz
emacs-38c979d349eb874f66f42f644b736efe541bbc05.zip
Update for syntax-table text properties.
sh-script.el now directs font-lock.el to add them to instances of # which are not comments.
-rw-r--r--lisp/progmodes/sh-script.el24
1 files changed, 12 insertions, 12 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 3124d59bffb..a6fb80bc5ae 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -224,7 +224,6 @@ the car and cdr are the same symbol.")
224 ?\" "\"\"" 224 ?\" "\"\""
225 ?\' "\"'" 225 ?\' "\"'"
226 ?\` "\"`" 226 ?\` "\"`"
227 ?$ "\\" ; `escape' so $# doesn't start a comment
228 ?! "_" 227 ?! "_"
229 ?% "_" 228 ?% "_"
230 ?: "_" 229 ?: "_"
@@ -605,15 +604,18 @@ See `sh-feature'.")
605 '("\\\\[^A-Za-z0-9]" 0 font-lock-string-face) 604 '("\\\\[^A-Za-z0-9]" 0 font-lock-string-face)
606 '("\\${?\\([A-Za-z_][A-Za-z0-9_]*\\|[0-9]+\\|[$*_]\\)" 1 605 '("\\${?\\([A-Za-z_][A-Za-z0-9_]*\\|[0-9]+\\|[$*_]\\)" 1
607 font-lock-variable-name-face))) 606 font-lock-variable-name-face)))
608 "*Rules for highlighting shell scripts. See `sh-feature'.") 607 "Default expressions to highlight in Shell Script modes. See `sh-feature'.")
609 608
610(defvar sh-font-lock-keywords-1 609(defvar sh-font-lock-keywords-1
611 '((sh "[ \t]in\\>")) 610 '((sh "[ \t]in\\>"))
612 "*Additional rules for highlighting shell scripts. See `sh-feature'.") 611 "Subdued level highlighting for Shell Script modes.")
613 612
614(defvar sh-font-lock-keywords-2 () 613(defvar sh-font-lock-keywords-2 ()
615 "*Yet more rules for highlighting shell scripts. See `sh-feature'.") 614 "Gaudy level highlighting for Shell Script modes.")
616 615
616(defconst sh-font-lock-syntactic-keywords
617 ;; Mark a `#' character as having punctuation syntax in a variable reference.
618 '(("\\$[({]?\\(#\\)" 1 (1 . nil))))
617 619
618;; mode-command and utility functions 620;; mode-command and utility functions
619 621
@@ -709,12 +711,11 @@ with your script for an edit-interpret-debug cycle."
709 ;; we can't look if previous line ended with `\' 711 ;; we can't look if previous line ended with `\'
710 comint-prompt-regexp "^[ \t]*" 712 comint-prompt-regexp "^[ \t]*"
711 font-lock-defaults 713 font-lock-defaults
712 `((sh-font-lock-keywords 714 '((sh-font-lock-keywords
713 sh-font-lock-keywords-1 715 sh-font-lock-keywords-1 sh-font-lock-keywords-2)
714 sh-font-lock-keywords-2) 716 nil nil
715 nil nil 717 ((?/ . "w") (?~ . "w") (?. . "w") (?- . "w") (?_ . "w")) nil
716 ((?/ . "w") (?~ . "w") (?. . "w") (?- . "w") (?_ . "w")) nil 718 (font-lock-syntactic-keywords . sh-font-lock-syntactic-keywords))
717 (font-lock-comment-start-regexp . "#"))
718 skeleton-pair-alist '((?` _ ?`)) 719 skeleton-pair-alist '((?` _ ?`))
719 skeleton-pair-filter 'sh-quoted-p 720 skeleton-pair-filter 'sh-quoted-p
720 skeleton-further-elements '((< '(- (min sh-indentation 721 skeleton-further-elements '((< '(- (min sh-indentation
@@ -727,8 +728,7 @@ with your script for an edit-interpret-debug cycle."
727 (save-excursion 728 (save-excursion
728 (goto-char (point-min)) 729 (goto-char (point-min))
729 (if (looking-at "#![ \t]?\\([^ \t\n]*/bin/env[ \t]\\)?\\([^ \t\n]+\\)") 730 (if (looking-at "#![ \t]?\\([^ \t\n]*/bin/env[ \t]\\)?\\([^ \t\n]+\\)")
730 (buffer-substring (match-beginning 2) 731 (match-string 2)))))
731 (match-end 2))))))
732 (if interpreter 732 (if interpreter
733 (sh-set-shell interpreter nil nil) 733 (sh-set-shell interpreter nil nil)
734 ;; If we don't know the shell for this file, 734 ;; If we don't know the shell for this file,