summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2005-04-05 13:07:42 +0000
committerGlenn Morris <rgm@gnu.org>2005-04-05 13:07:42 +0000
commit450a39ffe2d5332b904151fa642b5e91d67785d9 (patch)
tree69dbb6b6753bed8d934e14d3a84ce3a1d8502a82
parentd6d43bde05e983ae718a39b7d4d12c803f89777c (diff)
downloademacs-450a39ffe2d5332b904151fa642b5e91d67785d9.tar.gz
(sh-builtins) <bash>: Add `caller'.
(sh-escaped-newline): New face. (sh-font-lock-keywords) <shell>: Improve regexp for escaped newline, and use sh-escaped-newline face.
-rw-r--r--lisp/progmodes/sh-script.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 39ab54981f2..8579cccb0c2 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -574,7 +574,7 @@ documents - you must insert literal tabs by hand.")
;; but it *did* have an asterisk in the docstring!
(defcustom sh-builtins
'((bash sh-append posix
- "." "alias" "bg" "bind" "builtin" "compgen" "complete"
+ "." "alias" "bg" "bind" "builtin" "caller" "compgen" "complete"
"declare" "dirs" "disown" "enable" "fc" "fg" "help" "history"
"jobs" "kill" "let" "local" "popd" "printf" "pushd" "shopt"
"source" "suspend" "typeset" "unalias")
@@ -791,6 +791,10 @@ See `sh-feature'.")
:group 'sh-indentation)
(defvar sh-heredoc-face 'sh-heredoc-face)
+(defface sh-escaped-newline '((t :inherit font-lock-string-face))
+ "Face used for (non-escaped) backslash at end of a line in Shell-script mode."
+ :group 'sh-script
+ :version "22.1")
(defvar sh-font-lock-keywords
'((csh sh-append shell
@@ -815,7 +819,7 @@ See `sh-feature'.")
;; The next entry is only used for defining the others
(shell sh-append executable-font-lock-keywords
;; Using font-lock-string-face here confuses sh-get-indent-info.
- ("\\\\$" 0 font-lock-warning-face)
+ ("\\(^\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\\\)$" 3 'sh-escaped-newline)
("\\\\[^A-Za-z0-9]" 0 font-lock-string-face)
("\\${?\\([A-Za-z_][A-Za-z0-9_]*\\|[0-9]+\\|[$*_]\\)" 1
font-lock-variable-name-face))