diff options
| author | Glenn Morris | 2003-09-25 02:01:18 +0000 |
|---|---|---|
| committer | Glenn Morris | 2003-09-25 02:01:18 +0000 |
| commit | b8acc4ed4fbc0fba2a0d9e052b0f24fa0f6ae861 (patch) | |
| tree | aa5b0e54ed9cac2a5034f6b0e711d8eb22a40393 | |
| parent | dd130f1d5e86a8f4412f430aef246a458289bec7 (diff) | |
| download | emacs-b8acc4ed4fbc0fba2a0d9e052b0f24fa0f6ae861.tar.gz emacs-b8acc4ed4fbc0fba2a0d9e052b0f24fa0f6ae861.zip | |
(sh-builtins): Add bash `shopt' builtin.
(sh-font-lock-keywords, sh-feature): Fix previous change of sh-feature
to avoid infloop with sh-font-lock-keywords.
| -rw-r--r-- | lisp/progmodes/sh-script.el | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index dd6fb7ce7b0..87eb30bf449 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -572,8 +572,8 @@ documents - you must insert literal tabs by hand.") | |||
| 572 | '((bash sh-append posix | 572 | '((bash sh-append posix |
| 573 | "." "alias" "bg" "bind" "builtin" "compgen" "complete" | 573 | "." "alias" "bg" "bind" "builtin" "compgen" "complete" |
| 574 | "declare" "dirs" "disown" "enable" "fc" "fg" "help" "history" | 574 | "declare" "dirs" "disown" "enable" "fc" "fg" "help" "history" |
| 575 | "jobs" "kill" "let" "local" "popd" "printf" "pushd" "source" | 575 | "jobs" "kill" "let" "local" "popd" "printf" "pushd" "shopt" |
| 576 | "suspend" "typeset" "unalias") | 576 | "source" "suspend" "typeset" "unalias") |
| 577 | 577 | ||
| 578 | ;; The next entry is only used for defining the others | 578 | ;; The next entry is only used for defining the others |
| 579 | (bourne sh-append shell | 579 | (bourne sh-append shell |
| @@ -796,35 +796,35 @@ See `sh-feature'.") | |||
| 796 | 796 | ||
| 797 | (defvar sh-font-lock-keywords | 797 | (defvar sh-font-lock-keywords |
| 798 | '((csh sh-append shell | 798 | '((csh sh-append shell |
| 799 | '("\\${?[#?]?\\([A-Za-z_][A-Za-z0-9_]*\\|0\\)" 1 | 799 | ("\\${?[#?]?\\([A-Za-z_][A-Za-z0-9_]*\\|0\\)" 1 |
| 800 | font-lock-variable-name-face)) | 800 | font-lock-variable-name-face)) |
| 801 | 801 | ||
| 802 | (es sh-append executable-font-lock-keywords | 802 | (es sh-append executable-font-lock-keywords |
| 803 | '("\\$#?\\([A-Za-z_][A-Za-z0-9_]*\\|[0-9]+\\)" 1 | 803 | ("\\$#?\\([A-Za-z_][A-Za-z0-9_]*\\|[0-9]+\\)" 1 |
| 804 | font-lock-variable-name-face)) | 804 | font-lock-variable-name-face)) |
| 805 | 805 | ||
| 806 | (rc sh-append es) | 806 | (rc sh-append es) |
| 807 | 807 | ||
| 808 | (sh sh-append shell | 808 | (sh sh-append shell |
| 809 | ;; Variable names. | 809 | ;; Variable names. |
| 810 | '("\\$\\({#?\\)?\\([A-Za-z_][A-Za-z0-9_]*\\|[-#?@!]\\)" 2 | 810 | ("\\$\\({#?\\)?\\([A-Za-z_][A-Za-z0-9_]*\\|[-#?@!]\\)" 2 |
| 811 | font-lock-variable-name-face) | 811 | font-lock-variable-name-face) |
| 812 | ;; Function names. | 812 | ;; Function names. |
| 813 | '("^\\(\\sw+\\)[ \t]*(" 1 font-lock-function-name-face) | 813 | ("^\\(\\sw+\\)[ \t]*(" 1 font-lock-function-name-face) |
| 814 | '("\\<\\(function\\)\\>[ \t]*\\(\\sw+\\)?" | 814 | ("\\<\\(function\\)\\>[ \t]*\\(\\sw+\\)?" |
| 815 | (1 font-lock-keyword-face) (2 font-lock-function-name-face nil t))) | 815 | (1 font-lock-keyword-face) (2 font-lock-function-name-face nil t))) |
| 816 | 816 | ||
| 817 | ;; The next entry is only used for defining the others | 817 | ;; The next entry is only used for defining the others |
| 818 | (shell sh-append executable-font-lock-keywords | 818 | (shell sh-append executable-font-lock-keywords |
| 819 | ;; Using font-lock-string-face here confuses sh-get-indent-info. | 819 | ;; Using font-lock-string-face here confuses sh-get-indent-info. |
| 820 | '("\\\\$" 0 font-lock-warning-face) | 820 | ("\\\\$" 0 font-lock-warning-face) |
| 821 | '("\\\\[^A-Za-z0-9]" 0 font-lock-string-face) | 821 | ("\\\\[^A-Za-z0-9]" 0 font-lock-string-face) |
| 822 | '("\\${?\\([A-Za-z_][A-Za-z0-9_]*\\|[0-9]+\\|[$*_]\\)" 1 | 822 | ("\\${?\\([A-Za-z_][A-Za-z0-9_]*\\|[0-9]+\\|[$*_]\\)" 1 |
| 823 | font-lock-variable-name-face)) | 823 | font-lock-variable-name-face)) |
| 824 | (rpm sh-append rpm2 | 824 | (rpm sh-append rpm2 |
| 825 | '("%{?\\(\\sw+\\)" 1 font-lock-keyword-face)) | 825 | ("%{?\\(\\sw+\\)" 1 font-lock-keyword-face)) |
| 826 | (rpm2 sh-append shell | 826 | (rpm2 sh-append shell |
| 827 | '("^\\(\\sw+\\):" 1 font-lock-variable-name-face))) | 827 | ("^\\(\\sw+\\):" 1 font-lock-variable-name-face))) |
| 828 | "Default expressions to highlight in Shell Script modes. See `sh-feature'.") | 828 | "Default expressions to highlight in Shell Script modes. See `sh-feature'.") |
| 829 | 829 | ||
| 830 | (defvar sh-font-lock-keywords-1 | 830 | (defvar sh-font-lock-keywords-1 |
| @@ -1568,7 +1568,9 @@ in ALIST." | |||
| 1568 | (setq val | 1568 | (setq val |
| 1569 | (apply 'sh-append | 1569 | (apply 'sh-append |
| 1570 | (let ((sh-shell (car (cdr val)))) | 1570 | (let ((sh-shell (car (cdr val)))) |
| 1571 | (sh-feature alist)) | 1571 | (if (assq sh-shell alist) |
| 1572 | (sh-feature alist) | ||
| 1573 | (eval sh-shell))) | ||
| 1572 | (cddr val))))) | 1574 | (cddr val))))) |
| 1573 | (if function | 1575 | (if function |
| 1574 | (nconc alist | 1576 | (nconc alist |