From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: doc of defining minor modes Date: Thu, 18 May 2006 19:07:13 +0200 Message-ID: <85iro3gt32.fsf@lola.goethe.zz> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1147972089 26006 80.91.229.2 (18 May 2006 17:08:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 18 May 2006 17:08:09 +0000 (UTC) Cc: Emacs-Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 18 19:07:58 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Fglya-0001Mb-Pt for ged-emacs-devel@m.gmane.org; Thu, 18 May 2006 19:07:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fglya-0008Il-8c for ged-emacs-devel@m.gmane.org; Thu, 18 May 2006 13:07:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FglyO-0008IB-7o for emacs-devel@gnu.org; Thu, 18 May 2006 13:07:40 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FglyN-0008H4-7i for emacs-devel@gnu.org; Thu, 18 May 2006 13:07:39 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FglyN-0008Gu-4K for emacs-devel@gnu.org; Thu, 18 May 2006 13:07:39 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fgm1V-0006Vp-6U for emacs-devel@gnu.org; Thu, 18 May 2006 13:10:53 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1FglyM-0006Yj-95; Thu, 18 May 2006 13:07:38 -0400 Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id 29CDC1C27934; Thu, 18 May 2006 19:07:13 +0200 (CEST) Original-To: "Drew Adams" In-Reply-To: (Drew Adams's message of "Thu, 18 May 2006 09:38:05 -0700") 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:54706 Archived-At: "Drew Adams" writes: > Sometime in the last year, this text was added to Elisp info node Defining > Minor Modes: > > The initial value must be `nil' except in cases where (1) the mode > is preloaded in Emacs, or (2) it is painless for loading to enable the > mode even though the user did not request it. For instance, if the > mode has no effect unless something else is enabled, and will always be > loaded by that time, enabling it by default is harmless. But these are > unusual circumstances. Normally, the initial value must be `nil'. > > FWIW, I do not agree. It is sometimes useful to enable a minor mode > upon load, and there is nothing wrong with that for normal > (i.e. respectful) minor modes. If I'm missing something here, let me > know - what's the harm (vs "harmless")? Customize might load a file just because a variable has been customized from it. > Third, I don't see why we are stating this guideline / > recommendation / prescription. Users can always set the mode value > to nil in their init files, which, for a mode that always toggles > based on changes to this variable (which is the normal, recommended > case) will inhibit mode enabling upon load. Uh what? Why should that happen? > That was the spin used previously in this doc, I believe, and I > think it is the correct recommendation. We should say something like > this (the idea, if not the wording): > > Unless the mode automatically toggles upon changes to the mode > variable, do not enable the mode upon load. Why? Because users > have no way to inhibit enabling in that case. How do you suppose to inhibit enabling when the mode "automatically toggles upon changes" in this case? > That is the only case where it is important not to enable the mode > upon load, AFAIK. The part about modes that don't respect their > variable is missing in the current guideline - it speaks of > "painless" and "harmless", but nowhere does it explain what the pain > or harm is. Files may even get autoloaded when going through a menu. > I personally think that perhaps most normal (respectful) minor modes > should be enabled upon load, but I wouldn't go so far as to proclaim > that in the doc. Enabling the mode by default upon load > (i.e. enabling unless the variable is nil) is "harmless", unless I'm > missing something. If I am missing something, then maybe that > something needs to be added to the doc. Stuff connected with autoloads and customization groups triggers at unusual moments. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum