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: Sun, 29 May 2005 18:54:29 -0500 (CDT) Message-ID: <200505292354.j4TNsTE13354@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> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1117410919 11296 80.91.229.2 (29 May 2005 23:55:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 29 May 2005 23:55:19 +0000 (UTC) Cc: Lute.Kamstra.lists@xs4all.nl, dominik@science.uva.nl, mmaug@yahoo.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 30 01:55:13 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DcXcJ-0002hV-Bs for ged-emacs-devel@m.gmane.org; Mon, 30 May 2005 01:54:52 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DcXh4-00038l-60 for ged-emacs-devel@m.gmane.org; Sun, 29 May 2005 19:59:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DcXgT-0002wb-9v for emacs-devel@gnu.org; Sun, 29 May 2005 19:59:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DcXgO-0002t8-JT for emacs-devel@gnu.org; Sun, 29 May 2005 19:59:04 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DcXgO-0002si-Ec for emacs-devel@gnu.org; Sun, 29 May 2005 19:59:04 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DcXdw-0004gO-Pu; Sun, 29 May 2005 19:56:33 -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 j4TNsxCK022801; Sun, 29 May 2005 18:55:00 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id j4TNsTE13354; Sun, 29 May 2005 18:54:29 -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 Sun, 29 May 2005 08:04:39 -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:37870 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:37870 Richard Stallman wrote: I think I understand that. But... In effect, we know of at least two examples of major modes that do this, comint-mode and interactive-sql-mode. This makes no sense to me. I thought you were talking about minor modes and what they need to do. Now you have switched to major modes. I cannot follow the change of subject. Meanwhile, you have not finished the explanation. To at least attempt to get things correctly with the current Font Lock code, there are things the minor mode (Font Lock in this case) should do, there are things that any major should do and there are things no major mode should do. Major modes should follow the conventions for major modes rigorously. But, in addition, they should not enable Font Lock in any way, directly or indirectly (other than through the define-global-minor-mode machinery), and they also should not call font-lock-add-keywords directly or indirectly, even if this does not enable Font Lock. comint-mode and interactive-sql-mode both enable Font Lock (the latter via sql-product-font-lock), creating problems for modes derived from them. Anyway, how about if we change define-minor-mode so that it generates the code to record which major mode enabled it? The very vast majority of minor modes have no reason whatsoever to do this. The problem is created by minor modes whose setup depends on the major mode (I believe a small minority) and for whom dis- and re-enabling the minor mode is not sufficient to correct a problem where the minor mode is setup for the wrong mode. The only known example (and hopefully the only example, period) is Font Lock mode. I will propose a new patch to easy-mmode that does _not_ use the new variable MODE-stored-mode. It will say that dis- and then re-enabling the minor mode should correctly set up the minor mode for the current major mode. The only trouble with that is that this condition does not apply to Font Lock. Ideally one could make it apply. Otherwise, one could just use a variable internal to Font Lock. Sincerely, Luc.