X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/6726c25e2d185adcf10e0d95f70f3ab26528cadc..b9345dfd4b5479ec624f1870723a8ea5c9c719e7:/lisp/emacs-lisp/derived.el diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el index ef30d7ca33..1db98ac39c 100644 --- a/lisp/emacs-lisp/derived.el +++ b/lisp/emacs-lisp/derived.el @@ -1,12 +1,12 @@ ;;; derived.el --- allow inheritance of major modes ;; (formerly mode-clone.el) -;; Copyright (C) 1993, 1994, 1999, 2001, 2002, 2003, 2004, 2005, 2006, -;; 2007, 2008, 2009 Free Software Foundation, Inc. +;; Copyright (C) 1993-1994, 1999, 2001-2011 Free Software Foundation, Inc. ;; Author: David Megginson (dmeggins@aix1.uottawa.ca) ;; Maintainer: FSF ;; Keywords: extensions +;; Package: emacs ;; This file is part of GNU Emacs. @@ -195,16 +195,16 @@ See Info node `(elisp)Derived Modes' for more details." `(progn (unless (get ',hook 'variable-documentation) (put ',hook 'variable-documentation - ,(format "Hook run when entering %s mode. + (purecopy ,(format "Hook run when entering %s mode. No problems result if this variable is not bound. `add-hook' automatically binds it. (This is true for all hook variables.)" - name))) + name)))) (unless (boundp ',map) (put ',map 'definition-name ',child)) - (defvar ,map (make-sparse-keymap)) + (with-no-warnings (defvar ,map (make-sparse-keymap))) (unless (get ',map 'variable-documentation) (put ',map 'variable-documentation - ,(format "Keymap for `%s'." child))) + (purecopy ,(format "Keymap for `%s'." child)))) ,(if declare-syntax `(progn (unless (boundp ',syntax) @@ -212,7 +212,7 @@ No problems result if this variable is not bound. (defvar ,syntax (make-syntax-table)) (unless (get ',syntax 'variable-documentation) (put ',syntax 'variable-documentation - ,(format "Syntax table for `%s'." child))))) + (purecopy ,(format "Syntax table for `%s'." child)))))) ,(if declare-abbrev `(progn (put ',abbrev 'definition-name ',child) @@ -220,7 +220,7 @@ No problems result if this variable is not bound. (progn (define-abbrev-table ',abbrev nil) ,abbrev)) (unless (get ',abbrev 'variable-documentation) (put ',abbrev 'variable-documentation - ,(format "Abbrev table for `%s'." child))))) + (purecopy ,(format "Abbrev table for `%s'." child)))))) (put ',child 'derived-mode-parent ',parent) ,(if group `(put ',child 'custom-mode-group ,group)) @@ -230,7 +230,7 @@ No problems result if this variable is not bound. ; Run the parent. (delay-mode-hooks - (,(or parent 'kill-all-local-variables)) + (,(or parent 'fundamental-mode)) ; Identify the child mode. (setq major-mode (quote ,child)) (setq mode-name ,name) @@ -456,5 +456,4 @@ Where the new table already has an entry, nothing is copied from the old one." (provide 'derived) -;; arch-tag: 630be248-47d1-4f02-afa0-8207de0ebea0 ;;; derived.el ends here