emacs-devel
[Top][All Lists]
Advanced

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

Re: org-mode and mode hooks.


From: Luc Teirlinck
Subject: Re: org-mode and mode hooks.
Date: Sat, 28 May 2005 20:57:56 -0500 (CDT)

Richard Stallman wrote:

   The reference "the function that does the initial set-up" is not concrete.
   I am not completely sure which function you mean.  It would be better
   to refer to it by name.

In the latest version of the patch I am going to send soon, it just
says that enabling the mode in any way should set the variable.  The
author of the minor mode can decide on the details of how to do that.

   If this function is one that the user has to supply and define, then I
   ask: why make the user arrange to set MODE-stored-mode?  Why not have
   define-global-minor-mode automatically arrange to save the value in
   that variable?

Because we have to know in which major mode the minor mode was
enabled.  That could easily happen behind define-global-minor-mode's
back, by using the non-global variant.  In effect, we know of at least
two examples of major modes that do this, comint-mode and
interactive-sql-mode.  There probably are others.  They should not be
doing that, but we want to be able to catch modes that do this.
Also, if the user does something like
(add-hook 'foo-mode-hook 'turn-on-font-lock), and then tries out
global-font-lock-mode, trouble results for major modes derived in a
non-standard way from foo-mode. 

   Looking at your patch, it looks like this mechanism already is
   taken care of by code that is generated by define-global-minor-mode.

Only partially.

Sincerely,

Luc.




reply via email to

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