From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: org-mode and mode hooks. Date: Sun, 05 Jun 2005 05:47:11 -0400 Message-ID: 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> <200506011911.j51JBR025269@raven.dms.auburn.edu> <87oeap231t.fsf-monnier+emacs@gnu.org> <200506012242.j51MgBj26277@raven.dms.auburn.edu> <87r7flpubg.fs Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1117967681 7334 80.91.229.2 (5 Jun 2005 10:34:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 5 Jun 2005 10:34:41 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 05 12:34:40 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DesS9-0007aT-D1 for ged-emacs-devel@m.gmane.org; Sun, 05 Jun 2005 12:34:01 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DesYE-0006d4-Tw for ged-emacs-devel@m.gmane.org; Sun, 05 Jun 2005 06:40:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dernu-00034L-CA for emacs-devel@gnu.org; Sun, 05 Jun 2005 05:52:26 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Derns-00032f-3Q for emacs-devel@gnu.org; Sun, 05 Jun 2005 05:52:24 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dernq-0002xM-Se for emacs-devel@gnu.org; Sun, 05 Jun 2005 05:52:22 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Dern1-00023C-CY for emacs-devel@gnu.org; Sun, 05 Jun 2005 05:51:31 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1Derip-0004Xl-EI; Sun, 05 Jun 2005 05:47:11 -0400 Original-To: Luc Teirlinck In-reply-to: <200506041517.j54FHgg09328@raven.dms.auburn.edu> (message from Luc Teirlinck on Sat, 4 Jun 2005 10:17:42 -0500 (CDT)) 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:38138 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38138 If you call font-lock-{add,remove}-keywords with nil for MODE inside a parent mode's body instead of its mode hook, the keyword is not enabled in the derived mode. If the parent mode does call font-lock-{add,remove}-keywords in its mode hook, the keyword may not be enabled in the derived mode if any involved mode does not follow the new conventions. Thanks. I think the right solution is simply "don't do that, then". Major mode functions should not call font-lock-add-keywords or font-lock-remove-keywords (though the mode hooks may do so). I will add this to the documentation of font-lock-add-keywords. @strong{Warning:} major mode functions must not call @code{font-lock-add-keywords} under any circumstances, either directly or indirectly. (This would lead to incorrect behavior for some minor modes.) They should set up for Font Lock mode by setting @code{font-lock-keywords}. Problems remain with for minor modes that call font-lock-{add,remove}-keywords with nil for MODE and add it to the hook of a major mode that does not follow the conventions or has an ancestor that does not. Do you consider this to be a problem that needs to be fixed before the next release? Fixing it would require non-trivial changes to Font Lock. We don't need to fix this. Those modes should be fixed. So, please install your patch.