Commit 547745f5 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(sh-mode): Handle .spec and .mspec files.

(sh-font-lock-keywords): Handle rpm and rpm2.
(sh-ancestor-alist): Handle rpm.
parent 1554c03b
...@@ -80,7 +80,8 @@ ...@@ -80,7 +80,8 @@
(tcsh . csh) (tcsh . csh)
(wksh . ksh88) (wksh . ksh88)
(wsh . sh) (wsh . sh)
(zsh . ksh88)) (zsh . ksh88)
(rpm . sh))
"*Alist showing the direct ancestor of various shells. "*Alist showing the direct ancestor of various shells.
This is the basis for `sh-feature'. See also `sh-alias-alist'. This is the basis for `sh-feature'. See also `sh-alias-alist'.
By default we have the following three hierarchies: By default we have the following three hierarchies:
...@@ -634,7 +635,11 @@ See `sh-feature'.") ...@@ -634,7 +635,11 @@ See `sh-feature'.")
(shell eval sh-append executable-font-lock-keywords (shell eval sh-append executable-font-lock-keywords
'("\\\\[^A-Za-z0-9]" 0 font-lock-string-face) '("\\\\[^A-Za-z0-9]" 0 font-lock-string-face)
'("\\${?\\([A-Za-z_][A-Za-z0-9_]*\\|[0-9]+\\|[$*_]\\)" 1 '("\\${?\\([A-Za-z_][A-Za-z0-9_]*\\|[0-9]+\\|[$*_]\\)" 1
font-lock-variable-name-face))) font-lock-variable-name-face))
(rpm eval sh-append rpm2
'("%{?\\(\\sw+\\)" 1 font-lock-keyword-face))
(rpm2 eval sh-append shell
'("^\\(\\sw+\\):" 1 font-lock-variable-name-face)))
"Default expressions to highlight in Shell Script modes. See `sh-feature'.") "Default expressions to highlight in Shell Script modes. See `sh-feature'.")
(defvar sh-font-lock-keywords-1 (defvar sh-font-lock-keywords-1
...@@ -768,8 +773,10 @@ with your script for an edit-interpret-debug cycle." ...@@ -768,8 +773,10 @@ with your script for an edit-interpret-debug cycle."
(let ((interpreter (let ((interpreter
(save-excursion (save-excursion
(goto-char (point-min)) (goto-char (point-min))
(if (looking-at "#![ \t]?\\([^ \t\n]*/bin/env[ \t]\\)?\\([^ \t\n]+\\)") (cond ((looking-at "#![ \t]?\\([^ \t\n]*/bin/env[ \t]\\)?\\([^ \t\n]+\\)")
(match-string 2))))) (match-string 2))
((string-match "\\.m?spec$" buffer-file-name)
"rpm")))))
(if interpreter (if interpreter
(sh-set-shell interpreter nil nil) (sh-set-shell interpreter nil nil)
(progn (progn
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment