Mercurial > emacs
changeset 41349:8dd8d78194a1
(sh-mode-syntax-table): Function restored.
Variable set up for use by function sh-mode-syntax-table.
(sh-set-shell): Set the syntax table.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 21 Nov 2001 11:12:18 +0000 |
parents | b46a4ee1a05d |
children | 4959437122c7 |
files | lisp/progmodes/sh-script.el |
diffstat | 1 files changed, 29 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/progmodes/sh-script.el Wed Nov 21 11:06:40 2001 +0000 +++ b/lisp/progmodes/sh-script.el Wed Nov 21 11:12:18 2001 +0000 @@ -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) @@ -1577,6 +1582,13 @@ ;; (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." (nconc list ancestor))