[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bongo-patches] Add Emacs 21 compatibility function `bongo-run-mode-hook
From: |
Daniel Brockman |
Subject: |
[bongo-patches] Add Emacs 21 compatibility function `bongo-run-mode-hooks' |
Date: |
Fri, 29 Dec 2006 11:19:07 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Wed Dec 27 12:36:30 CET 2006 Daniel Brockman <address@hidden>
* Add Emacs 21 compatibility function
`bongo-run-mode-hooks'.
diff -rN -u old-bongo/bongo.el new-bongo/bongo.el
--- old-bongo/bongo.el 2006-12-29 11:19:00.000000000 +0100
+++ new-bongo/bongo.el 2006-12-29 11:19:00.000000000 +0100
@@ -87,6 +87,8 @@
'face-foreground)
(defalias 'bongo-face-background
'face-background)
+ (defalias 'bongo-run-mode-hooks
+ 'run-mode-hooks)
(eval-and-compile
(defalias 'bongo-define-obsolete-function-alias
'define-obsolete-function-alias)
@@ -5577,7 +5579,7 @@
(setq mode-name "Bongo Seek")
(use-local-map bongo-seek-mode-map)
(setq buffer-undo-list t)
- (run-mode-hooks 'bongo-seek-mode-hook))
+ (bongo-run-mode-hooks 'bongo-seek-mode-hook))
(defvar bongo-seek-mode-map
(let ((map (make-sparse-keymap))
@@ -7253,7 +7255,7 @@
(setq default-directory bongo-default-directory))
(when bongo-dnd-support
(bongo-enable-dnd-support))
- (run-mode-hooks 'bongo-mode-hook))
+ (bongo-run-mode-hooks 'bongo-mode-hook))
(define-derived-mode bongo-library-mode bongo-mode "Library"
"Major mode for Bongo library buffers.
diff -rN -u old-bongo/bongo-emacs21.el new-bongo/bongo-emacs21.el
--- old-bongo/bongo-emacs21.el 2006-12-29 11:19:00.000000000 +0100
+++ new-bongo/bongo-emacs21.el 2006-12-29 11:19:00.000000000 +0100
@@ -31,6 +31,9 @@
;;; Code:
+(eval-when-compile
+ (require 'cl))
+
(defun bongo-face-foreground (face &optional frame inherit)
"Call `face-foreground' with FACE and FRAME.
INHERIT is ignored, since it is not supported by Emacs 21."
@@ -41,6 +44,15 @@
INHERIT is ignored, since it is not supported by Emacs 21."
(face-background face frame))
+;;; The following function was copied from `subr.el'
+;;; and modified to work with Emacs 21.
+
+(defun bongo-run-mode-hooks (&rest hooks)
+ "Run HOOKS and then `after-change-major-mode-hook'.
+Major mode functions should use this."
+ (apply 'run-hooks hooks)
+ (run-hooks 'after-change-major-mode-hook))
+
;;; The following macros were copied from `byte-run.el'.
(defmacro bongo-define-obsolete-function-alias
--
Daniel Brockman <address@hidden>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [bongo-patches] Add Emacs 21 compatibility function `bongo-run-mode-hooks',
Daniel Brockman <=