X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/a43944b5b80a5da493f533949de6d104a35bac91..ae5a0dd403ca1ca8d4b8d100c8d92ba3eea04695:/lisp/derived.el diff --git a/lisp/derived.el b/lisp/derived.el index 85466f5389..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. @@ -19,8 +19,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to -;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. ;;; Commentary: @@ -142,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. @@ -330,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,