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: Tue, 07 Jun 2005 18:10:05 -0400 Message-ID: <874qc9kerl.fsf-monnier+emacs@gnu.org> References: <87y8a3mnz8.fsf@xs4all.nl> <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.j56NSnY18148@raven.dms.auburn.edu> <87wtp6jarp.fsf-monnier+emacs@gnu.org> <200506071908.j NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1118182099 30245 80.91.229.2 (7 Jun 2005 22:08:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 7 Jun 2005 22:08:19 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 08 00:08:06 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DfmEI-0002hO-EY for ged-emacs-devel@m.gmane.org; Wed, 08 Jun 2005 00:07:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DfmKt-00051E-99 for ged-emacs-devel@m.gmane.org; Tue, 07 Jun 2005 18:14:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DfmJr-0004ca-Ek for emacs-devel@gnu.org; Tue, 07 Jun 2005 18:13:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DfmJp-0004b2-Mp for emacs-devel@gnu.org; Tue, 07 Jun 2005 18:13:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DfmJp-0004aP-1e for emacs-devel@gnu.org; Tue, 07 Jun 2005 18:13:09 -0400 Original-Received: from [209.226.175.97] (helo=tomts40-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DfmKL-0001gd-RW; Tue, 07 Jun 2005 18:13:42 -0400 Original-Received: from alfajor ([67.71.116.59]) by tomts40-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20050607221008.KBPS1799.tomts40-srv.bellnexxia.net@alfajor>; Tue, 7 Jun 2005 18:10:08 -0400 Original-Received: by alfajor (Postfix, from userid 1000) id D9F24D7339; Tue, 7 Jun 2005 18:10:05 -0400 (EDT) Original-To: Luc Teirlinck In-Reply-To: <200506071908.j57J8nk19610@raven.dms.auburn.edu> (Luc Teirlinck's message of "Tue, 7 Jun 2005 14:08:49 -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:38282 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38282 >> ! @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. Could be, but your change does not try to fix it, instead it documents the part of the misbehavior we happen to know about, thus legitimizing the use, rather than discouraging i.t > It even says to always use a non-nil argument when used from .emacs, > probably the most important use. There's admittedly an ambiguity when it says: 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. you understand it to mean When you use @code{font-lock-add-keywords} or @code{font-lock-remove-keywords} in your @file{.emacs} file, only use a non-@code{nil} @var{mode} argument. whereas I meant it to mean: Use a non-@code{nil} @var{mode} argument only when you use @code{font-lock-add-keywords} or @code{font-lock-remove-keywords} in your @file{.emacs} file. If you could fix the wording to make it more clear, I'd be grateful. OTOH I wouldn't be grateful if you completely removed this warning like you're suggesting to do. > 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). Then please make it more precise. E.g. by saying "mode hook". > The misleading text in question made me lose a lot of time. In what way, specifically? Which hook did you try? > 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. As mention, I'd like to semi-obsolete it, so I'd rather not document it further: use at your own risk. Stefan