]> code.delx.au - gnu-emacs/blobdiff - lisp/derived.el
(sit_for): New arg initial_display.
[gnu-emacs] / lisp / derived.el
index 85466f53899a2213a01306e3421f1f8ac9bd0f1e..d50ac6d288c978e2081ee64933eb6202fe286128 100644 (file)
@@ -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.
 \f
 ;;; 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,