summaryrefslogtreecommitdiff
path: root/lisp/progmodes/sh-script.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1998-10-21 03:47:41 +0000
committerRichard M. Stallman <rms@gnu.org>1998-10-21 03:47:41 +0000
commitb946fbad3930f39d8afd3ab0f2dbe5927cf9b6ea (patch)
treea7006de8643207d36ee20715381402dd6a977917 /lisp/progmodes/sh-script.el
parentbbdf24fae2374931508d56e6aed14e1800db7e8e (diff)
downloademacs-b946fbad3930f39d8afd3ab0f2dbe5927cf9b6ea.tar.gz
(sh-font-lock-keywords): Don't crash for an unrecognized shell.
Diffstat (limited to 'lisp/progmodes/sh-script.el')
-rw-r--r--lisp/progmodes/sh-script.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index eec351c5cc4..53e9d6ab151 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -794,11 +794,12 @@ with your script for an edit-interpret-debug cycle."
"Function to get simple fontification based on `sh-font-lock-keywords'.
This adds rules for comments and assignments."
(sh-feature sh-font-lock-keywords
- (lambda (list)
- `((,(sh-feature sh-assignment-regexp)
- 1 font-lock-variable-name-face)
- ,@keywords
- ,@list))))
+ (when (stringp (sh-feature sh-assignment-regexp))
+ (lambda (list)
+ `((,(sh-feature sh-assignment-regexp)
+ 1 font-lock-variable-name-face)
+ ,@keywords
+ ,@list)))))
(defun sh-font-lock-keywords-1 (&optional builtins)
"Function to get better fontification including keywords."