X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/1a1e3f3207b660b42127bde55119d233aca02a1c..8350f087efe62e2ce0ded434534629a56cdc4e8c:/lisp/emacs-lisp/derived.el?ds=sidebyside diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el index e8f799b9af..55ea102ed2 100644 --- a/lisp/emacs-lisp/derived.el +++ b/lisp/emacs-lisp/derived.el @@ -133,10 +133,10 @@ BODY can start with a bunch of keyword arguments. The following keyword Declare the customization group that corresponds to this mode. The command `customize-mode' uses this. :syntax-table TABLE - Use TABLE instead of the default. + Use TABLE instead of the default (CHILD-syntax-table). A nil value means to simply use the same syntax-table as the parent. :abbrev-table TABLE - Use TABLE instead of the default. + Use TABLE instead of the default (CHILD-abbrev-table). A nil value means to simply use the same abbrev-table as the parent. Here is how you could define LaTeX-Thesis mode as a variant of LaTeX mode: @@ -230,7 +230,7 @@ No problems result if this variable is not bound. ; Run the parent. (delay-mode-hooks - (,(or parent 'fundamental-mode)) + (,(or parent 'kill-all-local-variables)) ; Identify the child mode. (setq major-mode (quote ,child)) (setq mode-name ,name) @@ -255,7 +255,10 @@ No problems result if this variable is not bound. (not (eq parent (standard-syntax-table)))) (set-char-table-parent ,syntax (syntax-table))))) ,(when declare-abbrev - `(unless (abbrev-table-get ,abbrev :parents) + `(unless (or (abbrev-table-get ,abbrev :parents) + ;; This can happen if the major mode defines + ;; the abbrev-table to be its parent's. + (eq ,abbrev local-abbrev-table)) (abbrev-table-put ,abbrev :parents (list local-abbrev-table)))))) (use-local-map ,map)