From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: org-mode and mode hooks. Date: Thu, 26 May 2005 13:04:36 -0400 Message-ID: <87psveq60w.fsf-monnier+emacs@gnu.org> 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> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1117127517 25629 80.91.229.2 (26 May 2005 17:11:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 26 May 2005 17:11:57 +0000 (UTC) Cc: emacs-devel@gnu.org, Lute.Kamstra.lists@xs4all.nl, dominik@science.uva.nl Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 26 19:11:55 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DbLsN-00009r-SS for ged-emacs-devel@m.gmane.org; Thu, 26 May 2005 19:10:32 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DbLwU-0006ab-EW for ged-emacs-devel@m.gmane.org; Thu, 26 May 2005 13:14:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DbLva-0006Lg-RS for emacs-devel@gnu.org; Thu, 26 May 2005 13:13:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DbLvW-0006Jd-1g for emacs-devel@gnu.org; Thu, 26 May 2005 13:13:47 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DbLvV-0006G0-K6 for emacs-devel@gnu.org; Thu, 26 May 2005 13:13:45 -0400 Original-Received: from [209.226.175.184] (helo=tomts22-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DbLnL-0000d9-Ef for emacs-devel@gnu.org; Thu, 26 May 2005 13:05:19 -0400 Original-Received: from alfajor ([65.92.240.195]) by tomts22-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20050526170437.PAYI21470.tomts22-srv.bellnexxia.net@alfajor>; Thu, 26 May 2005 13:04:37 -0400 Original-Received: by alfajor (Postfix, from userid 1000) id CB02AD7378; Thu, 26 May 2005 13:04:36 -0400 (EDT) Original-To: Luc Teirlinck In-Reply-To: <200505261501.j4QF17h00246@raven.dms.auburn.edu> (Luc Teirlinck's message of "Thu, 26 May 2005 10:01:07 -0500 (CDT)") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:37714 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:37714 I understand better now, thank you. > after-change-major-mode ran to soon. (Maybe we should also print an > error message in this case, which my current patch does not). Yes, I think it's more important to signal a clear warning/error than to try and auto-fix the problem. BTW, why use "check-" as a prefix (rather than a "-check-" infix or suffix), thus potentially breaking the usual namespace conventions? > (I do not know how to do that without setting > font-lock-defaults to nil.) Yes, in that case we're screwed either way, which is why we need to signal a warning/error so someone can fix the problem at its source. The auto-fix you suggest has the shortcoming I mentioned but is probably the right "best effort" solution because other solutions probably suffer from more common/serious problems. Please add some comments explaining how this code is only used to double check erroneous situations and to try and salvage such "desperate" cases (the presence of a warning/error should already make the code more understandable). Stefan PS: By warning/error I'm not sure what I mean, but it should be more obnoxious than a (message "foo") and less than (error "foo"). Probably something like (progn (message "foo") (ding) (sit-for 1)).