From: Glenn Morris Date: Tue, 13 Dec 2016 01:03:20 +0000 (-0500) Subject: Minor fix for define-derived-mode X-Git-Tag: emacs-26.0.90~1117 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8db7b65d66f01e90a05cc9f11c67667233d84ca0;p=emacs.git Minor fix for define-derived-mode * 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) --- diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el index 0f7691af0f4..31170270f5c 100644 --- a/lisp/emacs-lisp/derived.el +++ b/lisp/emacs-lisp/derived.el @@ -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))))))