]> git.eshelyaron.com Git - emacs.git/commitdiff
(define-derived-mode): Make generated code work in
authorRichard M. Stallman <rms@gnu.org>
Mon, 14 Apr 2003 10:11:04 +0000 (10:11 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 14 Apr 2003 10:11:04 +0000 (10:11 +0000)
Emacs versions that do not have run-mode-hooks.

lisp/derived.el

index 0cb2fd2d57f7a70fb435a7a6e6ab1c6da35544dc..3e27752ca636cc21707f16c7e567568445718929 100644 (file)
@@ -225,8 +225,12 @@ been generated automatically, with a reference to the keymap."
                                        ; 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.