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: Tue, 7 Jun 2005 14:08:49 -0500 (CDT) Message-ID: <200506071908.j57J8nk19610@raven.dms.auburn.edu> References: <87y8a3mnz8.fsf@xs4all.nl> <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> <200506041517.j54FHgg09328@raven.dms.auburn.edu> <200506062328.j5 NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1118171292 20238 80.91.229.2 (7 Jun 2005 19:08:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 7 Jun 2005 19:08:12 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 07 21:07:55 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DfjP4-00070O-0V for ged-emacs-devel@m.gmane.org; Tue, 07 Jun 2005 21:06:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DfjVd-0006Ly-69 for ged-emacs-devel@m.gmane.org; Tue, 07 Jun 2005 15:13:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DfjVS-0006Kx-EI for emacs-devel@gnu.org; Tue, 07 Jun 2005 15:12:58 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DfjVQ-0006Ju-Ov for emacs-devel@gnu.org; Tue, 07 Jun 2005 15:12:56 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DfjVQ-0006Jc-Du for emacs-devel@gnu.org; Tue, 07 Jun 2005 15:12:56 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DfjVi-0006t8-Qf; Tue, 07 Jun 2005 15:13: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 j57J9hCK029692; Tue, 7 Jun 2005 14:09:43 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id j57J8nk19610; Tue, 7 Jun 2005 14:08:49 -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: <87wtp6jarp.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Tue, 07 Jun 2005 14:15:08 -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:38275 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38275 Stefan Monnier wrote: > ! @strong{Warning:} Only use a non-@code{nil} @var{mode} argument when > ! you use @code{font-lock-add-keywords} or > ! @code{font-lock-remove-keywords} in your @file{.emacs} file. When you > ! use these functions from a Lisp program (such as a minor mode), we > ! recommend that you use @code{nil} for @var{mode} (and place the call > ! on a hook) to avoid subtle problems due to the details of the > ! implementation. The intention with the above text was to make a non-nil argument semi-obsolete, That may be what the above text _intends_ to say, but it definitely is not what it says. It even says to always use a non-nil argument when used from .emacs, probably the most important use. The text is very vague, for instance, it says to add them to "a hook" whereas there are only two hooks for which it will work properly (for compliant major modes), the major mode hook and after-change-major-mode-hook (if you want to get a "permanent local" type behavior). The misleading text in question made me loose a lot of time. Getting rid of it will prevent other people from loosing a lot of time. In my replacement text, I document the actual situation: a non-nil argument does not apply to derived modes, a nil one must be added to a major mode hook and if used this way, it will apply to derived modes _if_ the major modes in question follow the conventions. Sincerely, Luc.