X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/b578f267af27af50e3c091f8c9c9eee939b69978..ae5a0dd403ca1ca8d4b8d100c8d92ba3eea04695:/lisp/derived.el diff --git a/lisp/derived.el b/lisp/derived.el index d27c2b333f..d50ac6d288 100644 --- a/lisp/derived.el +++ b/lisp/derived.el @@ -1,4 +1,4 @@ -;;; derived.el -- allow inheritance of major modes. +;;; derived.el --- allow inheritance of major modes. ;;; (formerly mode-clone.el) ;; Copyright (C) 1993, 1994 Free Software Foundation, Inc. @@ -143,30 +143,31 @@ been generated automatically, with a reference to the keymap." (setq docstring (or docstring (derived-mode-make-docstring parent child))) (` (progn - (derived-mode-init-mode-variables (quote (, child))) + (derived-mode-init-mode-variables '(, child)) + (put '(, child) 'derived-mode-parent '(, parent)) (defun (, child) () (, docstring) (interactive) ; Run the parent. ((, parent)) ; Identify special modes. - (if (get (quote (, parent)) 'special) - (put (quote (, child)) 'special t)) + (if (get '(, parent) 'special) + (put '(, child) 'special t)) ; Identify the child mode. - (setq major-mode (quote (, child))) + (setq major-mode '(, child)) (setq mode-name (, name)) ; Set up maps and tables. - (derived-mode-set-keymap (quote (, child))) - (derived-mode-set-syntax-table (quote (, child))) - (derived-mode-set-abbrev-table (quote (, child))) + (derived-mode-set-keymap '(, child)) + (derived-mode-set-syntax-table '(, child)) + (derived-mode-set-abbrev-table '(, child)) ; Splice in the body (if any). (,@ body) ;;; ; Run the setup function, if ;;; ; any -- this will soon be ;;; ; obsolete. -;;; (derived-mode-run-setup-function (quote (, child))) +;;; (derived-mode-run-setup-function '(, child)) ; Run the hooks, if any. - (derived-mode-run-hooks (quote (, child))))))) + (derived-mode-run-hooks '(, child)))))) ;; PUBLIC: find the ultimate class of a derived mode. @@ -331,11 +332,7 @@ be automatic inheritance." (defun derived-mode-merge-syntax-tables (old new) "Merge an old syntax table into a new one. Where the new table already has an entry, nothing is copied from the old one." - (map-char-table - (function (lambda (key value) - (or (char-table-range new key) - (set-char-table-range new key value)))) - old)) + (set-char-table-parent new old)) ;; Merge an old abbrev table into a new one. ;; This function requires internal knowledge of how abbrev tables work,