From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: org-mode and mode hooks. Date: Wed, 1 Jun 2005 14:11:27 -0500 (CDT) Message-ID: <200506011911.j51JBR025269@raven.dms.auburn.edu> References: <87y8a3mnz8.fsf@xs4all.nl> <87ll63weye.fsf-monnier+emacs@gnu.org> <200505252135.j4PLZvt26969@raven.dms.auburn.edu> <87hdgrufcl.fsf-monnier+emacs@gnu.org> <200505260359.j4Q3xbj28809@raven.dms.auburn.edu> <87is16rsid.fsf-monnier+emacs@gnu.org> <200505261501.j4QF17h00246@raven.dms.auburn.edu> <87psveq60w.fsf-monnier+emacs@gnu.org> <200505271717.j4RHHGD07067@raven.dms.auburn.edu> <200505290157.j4T1vus10117@raven.dms.auburn.edu> <200505292354.j4TNsTE13354@raven.dms.auburn.edu> <200505311544.j4VFijq17680@raven.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1117654062 19640 80.91.229.2 (1 Jun 2005 19:27:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 1 Jun 2005 19:27:42 +0000 (UTC) Cc: mmaug@yahoo.com, emacs-devel@gnu.org, monnier@iro.umontreal.ca, Lute.Kamstra.lists@xs4all.nl, dominik@science.uva.nl Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 01 21:27:40 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DdYqL-0003wo-QR for ged-emacs-devel@m.gmane.org; Wed, 01 Jun 2005 21:25:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DdYvh-0004vZ-Cm for ged-emacs-devel@m.gmane.org; Wed, 01 Jun 2005 15:31:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DdYnP-00009y-5h for emacs-devel@gnu.org; Wed, 01 Jun 2005 15:22:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DdYnM-000080-It for emacs-devel@gnu.org; Wed, 01 Jun 2005 15:22:28 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DdYlQ-0007cD-N4 for emacs-devel@gnu.org; Wed, 01 Jun 2005 15:20:29 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DdYfe-000566-SW; Wed, 01 Jun 2005 15:14:34 -0400 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id j51JC6CK003997; Wed, 1 Jun 2005 14:12:06 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id j51JBR025269; Wed, 1 Jun 2005 14:11:27 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: rms@gnu.org In-reply-to: (message from Richard Stallman on Wed, 01 Jun 2005 13:22:43 -0400) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:38012 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38012 I still do not understand exactly what a nil argument for MODE in font-lock-{add,remove}-keywords is supposed to accomplish. The font-lock-add-keywords docstring contains the following mysterious sentence: 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? It seems to me that a _global_ minor mode _should_ use a non-nil MODE argument when adding or removing a keyword. 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? A permanent buffer-local minor mode that wants to add the keyword independent of the mode could use after-change-major-mode-hook to add it. With my latest set of patches that will work for modes that run that hook. If the minor mode wants to add it for a particular mode and all its derived modes, it can, after my patches, add it to the mode hook, as long as the mode and its ancestor modes follow the new major mode conventions. Only adding it to a mode, but not to its derived modes, is problematic after my patches, as well as without them. Maybe one could have a font-lock-local-keywords-alist, that would be _in addition_ to font-lock-keywords-alist. That should be a non-permanent local and could be used by non-permanent buffer local minor modes. If one is not willing to rely on after-change-major-mode-hook, there could be a separate font-lock-permanent-local-keywords-alist, for permanent-local minor modes. All of this assuming that I am guessing the purpose of a nil argument correctly. Sincerely, Luc.