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)
This commit is contained in:
Glenn Morris 2016-12-12 20:03:20 -05:00
parent 3e651e3c6b
commit 8db7b65d66

View 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))))))