emacs-devel
[Top][All Lists]
Advanced

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

Re: define-derived-mode runs parent mode hook after evaluating body


From: Richard Stallman
Subject: Re: define-derived-mode runs parent mode hook after evaluating body
Date: Sun, 22 Jul 2007 14:37:22 -0400

    > Do you remember the sort of problems which we solved with this?

    Customizations that need to modify variable settings based on the
    major-mode's value (e.g. add an element to a list).
    Or customizations that depend on the major mode's variable settings

Ah, yes.  Those cases have not disappeared, and we do still need to
delay the mode hooks.  Although delaying mode hook would give the
desired results in this case, we can't solve the problem that way.

So what should we recommend in a case like this?

One possible recommendation is that the hook function should test
major-mode and do nothing if it is not `text-mode'.  That way it won't
affect the derived modes at all.  Or it could test (memq major-mode
LIST-OF-OK-MODES) or (memq major-mode LIST-OF-EXCEPTIONS).




reply via email to

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