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: Stefan Monnier
Subject: Re: org-mode and mode hooks.
Date: Wed, 01 Jun 2005 17:21:36 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> I still do not understand exactly what a nil argument for MODE in
> font-lock-{add,remove}-keywords is supposed to accomplish.

It adds the keywords for the current buffer only.

>   When used from a Lisp program (such as a minor mode), it is recommended to
>   use nil for mode (and place the call on a hook) to avoid subtle problems
>   due to details of the implementation.
> Which subtle problems?

Can't remember.  IIRC there were problems where adding keywords to
comint-mode didn't add them to all derivatives.  And the implementation of
the non-nil case is sufficiently horrendous to make you confident that there
will be other subtle problems.

> It seems to me that a _global_ minor mode _should_ use a non-nil MODE
> argument when adding or removing a keyword.

I'm not sure what you mean by a "global minor mode" (do you mean
define-minor-mode :global, or define-global-minor-mode).  But in any case
your statement doesn't make much sense to me: if the minor mode is global,
to *which* MODE should it add keywords? 

> Do the "subtle problems" refer to problems that occur when trying to make
> font-lock-keywords-alist buffer local, as a buffer local minor mode might
> be tempted to do?

No, I've never seen anyone try to make font-lock-keywords-alist buffer-local
(thank god).


        Stefan




reply via email to

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