aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2016-12-12 20:03:20 -0500
committerGlenn Morris2016-12-12 20:03:20 -0500
commit8db7b65d66f01e90a05cc9f11c67667233d84ca0 (patch)
tree88edb5d03bef9d3f2dcec6aff41830f2b8a9cd96
parent3e651e3c6b241eaeab70e63c267366e9678b6b52 (diff)
downloademacs-8db7b65d66f01e90a05cc9f11c67667233d84ca0.tar.gz
emacs-8db7b65d66f01e90a05cc9f11c67667233d84ca0.zip
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)
-rw-r--r--lisp/emacs-lisp/derived.el11
1 files changed, 6 insertions, 5 deletions
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.
217 ,(if declare-syntax 217 ,(if declare-syntax
218 `(progn 218 `(progn
219 (unless (boundp ',syntax) 219 (unless (boundp ',syntax)
220 (put ',syntax 'definition-name ',child)) 220 (put ',syntax 'definition-name ',child)
221 (defvar ,syntax (make-syntax-table)) 221 (defvar ,syntax (make-syntax-table)))
222 (unless (get ',syntax 'variable-documentation) 222 (unless (get ',syntax 'variable-documentation)
223 (put ',syntax 'variable-documentation 223 (put ',syntax 'variable-documentation
224 (purecopy ,(format "Syntax table for `%s'." child)))))) 224 (purecopy ,(format "Syntax table for `%s'." child))))))
225 ,(if declare-abbrev 225 ,(if declare-abbrev
226 `(progn 226 `(progn
227 (put ',abbrev 'definition-name ',child) 227 (unless (boundp ',abbrev)
228 (defvar ,abbrev 228 (put ',abbrev 'definition-name ',child)
229 (progn (define-abbrev-table ',abbrev nil) ,abbrev)) 229 (defvar ,abbrev
230 (progn (define-abbrev-table ',abbrev nil) ,abbrev)))
230 (unless (get ',abbrev 'variable-documentation) 231 (unless (get ',abbrev 'variable-documentation)
231 (put ',abbrev 'variable-documentation 232 (put ',abbrev 'variable-documentation
232 (purecopy ,(format "Abbrev table for `%s'." child)))))) 233 (purecopy ,(format "Abbrev table for `%s'." child))))))