changeset 50586:3bbd33912c1d

(define-derived-mode): Make generated code work in Emacs versions that do not have run-mode-hooks.
author Richard M. Stallman <rms@gnu.org>
date Mon, 14 Apr 2003 10:11:04 +0000
parents 1e9e1fa3548b
children f711c86ea5c9
files lisp/derived.el
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/derived.el	Mon Apr 14 10:09:35 2003 +0000
+++ b/lisp/derived.el	Mon Apr 14 10:11:04 2003 +0000
@@ -225,8 +225,12 @@
 					; Splice in the body (if any).
 	  ,@body
 	  )
-					; Run the hooks, if any.
-	 (run-mode-hooks ',hook)))))
+	 ;; Run the hooks, if any.
+	 ;; Make the generated code work in older Emacs versions
+	 ;; that do not yet have run-mode-hooks.
+	 (if (fboundp 'run-mode-hooks)
+	     (run-mode-hooks ',hook)
+	   (run-hooks ',hook))))))
 
 ;; PUBLIC: find the ultimate class of a derived mode.