]> git.eshelyaron.com Git - emacs.git/commitdiff
Minor fix for define-derived-mode
authorGlenn Morris <rgm@gnu.org>
Tue, 13 Dec 2016 01:03:20 +0000 (20:03 -0500)
committerGlenn Morris <rgm@gnu.org>
Tue, 13 Dec 2016 01:03:20 +0000 (20:03 -0500)
* lisp/emacs-lisp/derived.el (define-derived-mode):
Do not let eg eval-defun reset the values of syntax or abbrev tables,
since they might have been defined externally.  (Bug#16160)

lisp/emacs-lisp/derived.el

index 0f7691af0f400a762ca5d661da1e54d80c15f73a..31170270f5c0d5113f12af1a7c3c4a3ac9d6faed 100644 (file)
@@ -217,16 +217,17 @@ No problems result if this variable is not bound.
        ,(if declare-syntax
            `(progn
               (unless (boundp ',syntax)
-                (put ',syntax 'definition-name ',child))
-              (defvar ,syntax (make-syntax-table))
+                (put ',syntax 'definition-name ',child)
+                (defvar ,syntax (make-syntax-table)))
               (unless (get ',syntax 'variable-documentation)
                 (put ',syntax 'variable-documentation
                      (purecopy ,(format "Syntax table for `%s'." child))))))
        ,(if declare-abbrev
            `(progn
-              (put ',abbrev 'definition-name ',child)
-              (defvar ,abbrev
-                (progn (define-abbrev-table ',abbrev nil) ,abbrev))
+              (unless (boundp ',abbrev)
+                (put ',abbrev 'definition-name ',child)
+                (defvar ,abbrev
+                  (progn (define-abbrev-table ',abbrev nil) ,abbrev)))
               (unless (get ',abbrev 'variable-documentation)
                 (put ',abbrev 'variable-documentation
                      (purecopy ,(format "Abbrev table for `%s'." child))))))