[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/progmodes/sh-script.el
From: |
Richard M. Stallman |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/progmodes/sh-script.el |
Date: |
Wed, 21 Nov 2001 06:12:18 -0500 |
Index: emacs/lisp/progmodes/sh-script.el
diff -u emacs/lisp/progmodes/sh-script.el:1.106
emacs/lisp/progmodes/sh-script.el:1.107
--- emacs/lisp/progmodes/sh-script.el:1.106 Wed Nov 21 06:06:40 2001
+++ emacs/lisp/progmodes/sh-script.el Wed Nov 21 06:12:18 2001
@@ -392,23 +392,26 @@
-(easy-mmode-defsyntax sh-mode-syntax-table
- '((?\# . "<")
- (?\^l . ">#")
- (?\n . ">#")
- (?\" . "\"\"")
- (?\' . "\"'")
- (?\` . "\"`")
- (?! . "_")
- (?% . "_")
- (?: . "_")
- (?. . "_")
- (?^ . "_")
- (?~ . "_")
- (?< . ".")
- (?> . "."))
- "Syntax-table used in Shell-Script mode.")
+(defvar sh-mode-syntax-table
+ '((sh eval sh-mode-syntax-table ()
+ ?\# "<"
+ ?\^l ">#"
+ ?\n ">#"
+ ?\" "\"\""
+ ?\' "\"'"
+ ?\` "\"`"
+ ?! "_"
+ ?% "_"
+ ?: "_"
+ ?. "_"
+ ?^ "_"
+ ?~ "_"
+ ?< "."
+ ?> ".")
+ (csh eval identity sh)
+ (rc eval identity sh))
+ "Syntax-table used in Shell-Script mode. See `sh-feature'.")
(defvar sh-mode-map
(let ((map (make-sparse-keymap))
@@ -1463,6 +1466,8 @@
sh-shell-variables-initialized nil
imenu-generic-expression (sh-feature sh-imenu-generic-expression)
imenu-case-fold-search nil)
+ (set-syntax-table (or (sh-feature sh-mode-syntax-table)
+ (standard-syntax-table)))
(dolist (var (sh-feature sh-variables))
(sh-remember-variable var))
(make-local-variable 'indent-line-function)
@@ -1576,6 +1581,13 @@
;; (setq list (cdr (cdr list)))))
;; (symbol-value sh-shell)))
+
+(defun sh-mode-syntax-table (table &rest list)
+ "Copy TABLE and set syntax for successive CHARs according to strings S."
+ (setq table (copy-syntax-table table))
+ (while list
+ (modify-syntax-entry (pop list) (pop list) table))
+ table)
(defun sh-append (ancestor &rest list)
"Return list composed of first argument (a list) physically appended to
rest."