comparison lisp/emacs-lisp/derived.el @ 83353:532e0a9335a9

Merged in changes from CVS trunk. Plus added lisp/term tweaks. Patches applied: * lorentey@elte.hu--2004/emacs--cvs-trunk--0--base-0 tag of miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-474 * lorentey@elte.hu--2004/emacs--cvs-trunk--0--patch-1 Add CVS metadata files. * lorentey@elte.hu--2004/emacs--cvs-trunk--0--patch-2 Update from CVS. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-393
author Karoly Lorentey <lorentey@elte.hu>
date Sun, 04 Sep 2005 03:48:17 +0000
parents 5b1a238fcbb4
children 4b798da1bc61 2d92f5c9d6ae
comparison
equal deleted inserted replaced
83352:b258b3492423 83353:532e0a9335a9
1 ;;; derived.el --- allow inheritance of major modes 1 ;;; derived.el --- allow inheritance of major modes
2 ;; (formerly mode-clone.el) 2 ;; (formerly mode-clone.el)
3 3
4 ;; Copyright (C) 1993, 1994, 1999, 2003 Free Software Foundation, Inc. 4 ;; Copyright (C) 1993, 1994, 1999, 2002, 2003, 2004,
5 ;; 2005 Free Software Foundation, Inc.
5 6
6 ;; Author: David Megginson (dmeggins@aix1.uottawa.ca) 7 ;; Author: David Megginson (dmeggins@aix1.uottawa.ca)
7 ;; Maintainer: FSF 8 ;; Maintainer: FSF
8 ;; Keywords: extensions 9 ;; Keywords: extensions
9 10
94 (eval-when-compile (require 'cl)) 95 (eval-when-compile (require 'cl))
95 96
96 ;;; PRIVATE: defsubst must be defined before they are first used 97 ;;; PRIVATE: defsubst must be defined before they are first used
97 98
98 (defsubst derived-mode-hook-name (mode) 99 (defsubst derived-mode-hook-name (mode)
99 "Construct the mode hook name based on mode name MODE." 100 "Construct a mode-hook name based on a MODE name."
100 (intern (concat (symbol-name mode) "-hook"))) 101 (intern (concat (symbol-name mode) "-hook")))
101 102
102 (defsubst derived-mode-map-name (mode) 103 (defsubst derived-mode-map-name (mode)
103 "Construct a map name based on a MODE name." 104 "Construct a map name based on a MODE name."
104 (intern (concat (symbol-name mode) "-map"))) 105 (intern (concat (symbol-name mode) "-map")))
380 (old-table local-abbrev-table) 381 (old-table local-abbrev-table)
381 (new-table (eval table-name))) 382 (new-table (eval table-name)))
382 (derived-mode-merge-abbrev-tables old-table new-table) 383 (derived-mode-merge-abbrev-tables old-table new-table)
383 (setq local-abbrev-table new-table))) 384 (setq local-abbrev-table new-table)))
384 385
385 ;;;(defun derived-mode-run-setup-function (mode)
386 ;;; "Run the setup function if it exists."
387
388 ;;; (let ((fname (derived-mode-setup-function-name mode)))
389 ;;; (if (fboundp fname)
390 ;;; (funcall fname))))
391
392 (defun derived-mode-run-hooks (mode) 386 (defun derived-mode-run-hooks (mode)
393 "Run the mode hook for MODE." 387 "Run the mode hook for MODE."
394 (let ((hooks-name (derived-mode-hook-name mode))) 388 (let ((hooks-name (derived-mode-hook-name mode)))
395 (if (boundp hooks-name) 389 (if (boundp hooks-name)
396 (run-hooks hooks-name)))) 390 (run-hooks hooks-name))))
397 391
398 ;; Functions to merge maps and tables. 392 ;; Functions to merge maps and tables.
399 393
400 (defun derived-mode-merge-keymaps (old new) 394 (defun derived-mode-merge-keymaps (old new)
401 "Merge an OLD keymap into a NEW one. 395 "Merge an OLD keymap into a NEW one.