# HG changeset patch # User Richard M. Stallman # Date 1006341138 0 # Node ID 8dd8d78194a161cc9574fb575097b3658cb286a8 # Parent b46a4ee1a05d350a1d8d9519585d0ae5f2053482 (sh-mode-syntax-table): Function restored. Variable set up for use by function sh-mode-syntax-table. (sh-set-shell): Set the syntax table. diff -r b46a4ee1a05d -r 8dd8d78194a1 lisp/progmodes/sh-script.el --- 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))