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: Sat, 4 Jun 2005 12:48:11 -0500 (CDT) Message-ID: <200506041748.j54HmBK09784@raven.dms.auburn.edu> References: <87y8a3mnz8.fsf@xs4all.nl> <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.fsf-monnier+emacs@gnu.org> <200506012349.j51NnUA26352@raven.dms.auburn.edu> <200506031505.j53F5IE04403@raven.dms.auburn.edu> <200506041454.j NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1117907290 17965 80.91.229.2 (4 Jun 2005 17:48:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 4 Jun 2005 17:48:10 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 04 19:48:07 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Deck2-0000Xw-Ed for ged-emacs-devel@m.gmane.org; Sat, 04 Jun 2005 19:47:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Decpz-0004tk-30 for ged-emacs-devel@m.gmane.org; Sat, 04 Jun 2005 13:53:35 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Decp3-0004dy-FW for emacs-devel@gnu.org; Sat, 04 Jun 2005 13:52:38 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Decoy-0004aZ-AF for emacs-devel@gnu.org; Sat, 04 Jun 2005 13:52:32 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Decoy-0004aK-7Q for emacs-devel@gnu.org; Sat, 04 Jun 2005 13:52:32 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DecoC-0007JW-Em; Sat, 04 Jun 2005 13:51:44 -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 j54HmtCK016162; Sat, 4 Jun 2005 12:48:55 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id j54HmBK09784; Sat, 4 Jun 2005 12:48:11 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: monnier@iro.umontreal.ca In-reply-to: (message from Stefan Monnier on Sat, 04 Jun 2005 12:33:32 -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:38120 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38120 Stefan Monnier wrote: Actually, don't worry too mucvh about that, because I think that even with the current code things don't work right unless the major mode follows the conventions w.r.t major-mode-derivation. My changes do not introduce new problems, they fix problems with the current code. The problem is that the fix is not perfect. It limits the situations in which problems occur and makes the consequences less severe if they occur. With the current code problems are _much_ more likely to happen than with my proposed changes. For instance with the current code, enabling Font Lock mode in a major mode body, like for instance sql-interactive-mode does, will cause problems for derived modes, no matter how well the major mode conventions are followed. The fact that sql-interactive-mode later disables Font Lock again does not correct this. Also the consequences are much more severe with the current code. With the current code, Font Lock may get set up for the wrong major mode, giving completely incorrect fontification. After my changes, there is the slight probability of loosing a few keywords for major modes that do not follow the conventions. I believe that it is possible to implement things completely reliably by letting major modes specify a list of major modes from which they want to inherit keywords and using a non-nil MODE argument. But that would require more extensive changes to Font Lock and would also require some (much less extensive) changes to define-derived-mode. I believe that a nil argument for MODE has been around for a while so for backward compatibility, one would still need to reasonably take care of such calls. The question is whether the remaining problems are worth the trouble. Sincerely, Luc.