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: Carsten Dominik
Subject: Re: org-mode and mode hooks.
Date: Thu, 2 Jun 2005 08:15:04 +0200

Hi guys,

could you please take me off the cc for this discussion?  Thanks.

- Carsten



>>>>> "LT" == Luc Teirlinck <address@hidden> writes:

LT> I still do not understand exactly what a nil argument for MODE in
LT> font-lock-{add,remove}-keywords is supposed to accomplish.  The
LT> font-lock-add-keywords docstring contains the following mysterious
LT> sentence:

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

LT> Which subtle problems?

LT> It seems to me that a _global_ minor mode _should_ use a non-nil MODE
LT> argument when adding or removing a keyword.  Do the "subtle problems"
LT> refer to problems that occur when trying to make
LT> font-lock-keywords-alist buffer local, as a buffer local minor mode
LT> might be tempted to do?  A permanent buffer-local minor mode that
LT> wants to add the keyword independent of the mode could use
LT> after-change-major-mode-hook to add it.  With my latest set of patches
LT> that will work for modes that run that hook.  If the minor mode wants
LT> to add it for a particular mode and all its derived modes, it can,
LT> after my patches, add it to the mode hook, as long as the mode and its
LT> ancestor modes follow the new major mode conventions.  Only adding it
LT> to a mode, but not to its derived modes, is problematic after my
LT> patches, as well as without them.

LT> Maybe one could have a font-lock-local-keywords-alist, that would be
LT> _in addition_ to font-lock-keywords-alist.  That should be a
LT> non-permanent local and could be used by non-permanent buffer local minor
LT> modes.  If one is not willing to rely on after-change-major-mode-hook,
LT> there could be a separate font-lock-permanent-local-keywords-alist,
LT> for permanent-local minor modes.

LT> All of this assuming that I am guessing the purpose of a nil argument
LT> correctly.

LT> Sincerely,

LT> Luc.


-- 
Carsten Dominik <address@hidden>        \ _ /
Sterrenkundig Instituut "Anton Pannekoek"        |X|               _
Kruislaan 403; NL-1098 SJ Amsterdam             /| |\   _  _     _/ \
phone +31 (20) 525-7477; FAX +31 (20) 525-7484 __|o|___/ ~~ \___/    ~~~




reply via email to

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