From: Richard M. Stallman Date: Mon, 14 Apr 2003 10:11:04 +0000 (+0000) Subject: (define-derived-mode): Make generated code work in X-Git-Tag: ttn-vms-21-2-B4~10517 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=de6498728a7f043216388a2b7f8d01f5ad990d78;p=emacs.git (define-derived-mode): Make generated code work in Emacs versions that do not have run-mode-hooks. --- diff --git a/lisp/derived.el b/lisp/derived.el index 0cb2fd2d57f..3e27752ca63 100644 --- a/lisp/derived.el +++ b/lisp/derived.el @@ -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.