diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2000-10-15 05:25:57 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2000-10-15 05:25:57 +0000 |
commit | e4fe3460db9da857360fdc94cab70e904df2a582 (patch) | |
tree | 14c6433dc7bec714efbde6245a917008ba6b6332 /lisp/emacs-lisp | |
parent | a2d379fb258f190be346977328dc231bbb2a49f5 (diff) | |
download | emacs-e4fe3460db9da857360fdc94cab70e904df2a582.tar.gz emacs-e4fe3460db9da857360fdc94cab70e904df2a582.tar.bz2 emacs-e4fe3460db9da857360fdc94cab70e904df2a582.zip |
(easy-mmode-define-syntax): Use plist-get and allow :inherit.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/easy-mmode.el | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 60c613022e1..c2ff0701eb1 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -335,17 +335,23 @@ ARGS is a list of additional arguments." ;;; (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))) |