changeset 32491:2fc546f941df

(easy-mmode-define-syntax): Use plist-get and allow :inherit.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sun, 15 Oct 2000 05:25:57 +0000
parents ee8a94d08c3d
children e4721c5ab8dd
files lisp/emacs-lisp/easy-mmode.el
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/easy-mmode.el	Sun Oct 15 05:23:57 2000 +0000
+++ b/lisp/emacs-lisp/easy-mmode.el	Sun Oct 15 05:25:57 2000 +0000
@@ -335,17 +335,23 @@
 ;;;
 
 (defun easy-mmode-define-syntax (css args)
-  (let ((st (make-syntax-table (cadr (memq :copy args)))))
+  (let ((st (make-syntax-table (plist-get args :copy)))
+	(parent (plist-get args :inherit)))
     (dolist (cs css)
       (let ((char (car cs))
 	    (syntax (cdr cs)))
 	(if (sequencep char)
 	    (mapcar (lambda (c) (modify-syntax-entry c syntax st)) char)
 	  (modify-syntax-entry char syntax st))))
+    (if parent (set-char-table-parent
+		st (if (symbolp parent) (symbol-value parent) parent)))
     st))
 
 ;;;###autoload
 (defmacro easy-mmode-defsyntax (st css doc &rest args)
+  "Define variable ST as a syntax-table.
+CSS contains a list of syntax specifications of the form (CHAR . SYNTAX).
+"
   `(progn
      (autoload 'easy-mmode-define-syntax "easy-mmode")
      (defconst ,st (easy-mmode-define-syntax ,css ,(cons 'list args)) doc)))