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: Fri, 3 Jun 2005 09:59:58 -0500 (CDT) Message-ID: <200506031459.j53ExwM04036@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> <200506011911.j51JBR025269@raven.dms.auburn.edu> <87oeap231t.fsf-monnier+emacs@gnu.org> <200506012242.j51MgBj26277@raven.dms.auburn.edu> <87r7flpubg.fs NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1117811905 6708 80.91.229.2 (3 Jun 2005 15:18:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 3 Jun 2005 15:18:25 +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 Fri Jun 03 17:18:21 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DeDtB-0001s8-Gq for ged-emacs-devel@m.gmane.org; Fri, 03 Jun 2005 17:15:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DeDyu-0003LC-5B for ged-emacs-devel@m.gmane.org; Fri, 03 Jun 2005 11:21:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DeDuE-0001YO-6M for emacs-devel@gnu.org; Fri, 03 Jun 2005 11:16:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DeDu9-0001W2-6Y for emacs-devel@gnu.org; Fri, 03 Jun 2005 11:16:14 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DeDu8-0001LM-Hc for emacs-devel@gnu.org; Fri, 03 Jun 2005 11:16:12 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DeDhb-0007LP-96; Fri, 03 Jun 2005 11:03:15 -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 j53F0fCK011257; Fri, 3 Jun 2005 10:00:41 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id j53ExwM04036; Fri, 3 Jun 2005 09:59:58 -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 Fri, 03 Jun 2005 04:01:38 -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:38078 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38078 Richard Stallman wrote: The only difference between the following patch to font-lock.el and the previous one are two doc fixes. After those doc fixes, everything should work as documented when my three patches are applied. In that case, my previous comments about the previous patch still apply to this one. There were many comments. I tried to address the concrete ones to easy-mmode in my latest patch for that file. I explained why define-derived-mode can not reliably record the major mode for which a minor mode was enabled; if it is not supposed to be 100% reliable, then define-global-major-mode can do just as good a job more easily. My latest patches to define-global-major-mode do that job. Other than that, the major remaining issue is that calling font-lock-{add,remove}-keywords with nil for MODE only works reliably for major modes that follow the new conventions. But one of your previous comments was: (Even in this case it is only likely to occur for major modes that do not follow the new conventions.) In that case, maybe it is a fine solution to tell people to fix their major modes. Why go to a lot of trouble about broken major modes? In addition to that, there would be a problem with major modes that do follow the conventions but call font-lock-{add,remove}-keywords with nil for MODE in their body instead of their hook. Major modes are not supposed to do that. A nil argument was not designed to be used that way and you said: I just looked for all the calls to font-lock-add-keywords in Emacs. In no case does any major mode call font-lock-add-keywords directly, or even fairly directly. But it seems plausible to me that mode hook functions might call functions that call font-lock-add-keywords. Would that be a problem? To answer the latter question: only for major modes that do not follow the new conventions. Even for them, there is no problem if the calls were added by the user, because the old docs tell to pass a non-nil argument for MODE and the problems only occur for a nil argument. The new docs say that it is OK for the user to pass a nil argument as long as he realizes that it may not work reliably for non-conforming modes. 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. Sincerely, Luc.