emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange code in derived.el.


From: Stefan Monnier
Subject: Re: Strange code in derived.el.
Date: Thu, 09 Jun 2005 12:14:09 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> I don't understand this piece of code at the end of
> define-derived-mode in lisp/emacs-lisp/derived.el:

> ,----
> |      ;; 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))))))
> `----

> Is the expansion of this define-derive-mode macro ever run in older
> Emacsen?

Hopefully not.  Such forward compatibility on .elc files is generally not
guaranteed.

> Wouldn't delay-mode-hooks (used unconditionally) be missing as well, then?

No: it's a macro so it'll be expanded away.

> Shall I just delete the test?

I'd say yes, but since someone went to the trouble of adding it (I didn't
write it in the original code) maybe this someone can explain why she found
it to be necessary/useful.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]