From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: problem of define-minor-mode while bootstrapping Date: Mon, 30 Sep 2002 15:26:02 +0900 (JST) Sender: emacs-devel-admin@gnu.org Message-ID: <200209300626.PAA04899@etlken.m17n.org> References: <200209191320.WAA03733@etlken.m17n.org> <200209191346.g8JDkdq07175@rum.cs.yale.edu> <200209200006.JAA04300@etlken.m17n.org> <200209201838.g8KIc8t13414@rum.cs.yale.edu> <20020921020041.GA1545@gnu.org> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: main.gmane.org 1033367327 30840 127.0.0.1 (30 Sep 2002 06:28:47 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 30 Sep 2002 06:28:47 +0000 (UTC) Cc: d.love@dl.ac.uk, miles@gnu.org, monnier+gnu/emacs@rum.cs.yale.edu, emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17vu2v-00081I-00 for ; Mon, 30 Sep 2002 08:28:45 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17vumS-0005u7-00 for ; Mon, 30 Sep 2002 09:15:49 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17vu2s-00039m-00; Mon, 30 Sep 2002 02:28:42 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17vu0i-000385-00 for emacs-devel@gnu.org; Mon, 30 Sep 2002 02:26:28 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17vu0e-00037p-00 for emacs-devel@gnu.org; Mon, 30 Sep 2002 02:26:27 -0400 Original-Received: from tsukuba.m17n.org ([192.47.44.130]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17vu0Z-00031L-00; Mon, 30 Sep 2002 02:26:20 -0400 Original-Received: from fs.m17n.org (fs.m17n.org [192.47.44.2]) by tsukuba.m17n.org (8.11.6/3.7W-20010518204228) with ESMTP id g8U6Q2F26590; Mon, 30 Sep 2002 15:26:02 +0900 (JST) (envelope-from handa@m17n.org) Original-Received: from etlken.m17n.org (etlken.m17n.org [192.47.44.125]) by fs.m17n.org (8.11.3/3.7W-20010823150639) with ESMTP id g8U6Q2d01090; Mon, 30 Sep 2002 15:26:02 +0900 (JST) Original-Received: (from handa@localhost) by etlken.m17n.org (8.8.8+Sun/3.7W-2001040620) id PAA04899; Mon, 30 Sep 2002 15:26:02 +0900 (JST) Original-To: rms@gnu.org In-reply-to: (message from Richard Stallman on Fri, 27 Sep 2002 23:19:58 -0400) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.1.30 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:8244 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:8244 In article , Richard Stallman writes: >> Would you please be more specific? I have no idea what that refers >> to. The start of this conversation was a week or more ago, and I >> don't remember it. What exactly is the RT that we can't D? > What handa's complaining about -- just define the minor mode > defaulting to on as far as I understand it. > That is very sketchy. It is enough remind someone who already knows > the issue which issue is meant, but nowhere near enough to explain it > to a person who doesn't know. > Could someone explain to me what the issue is? Ok, I'll repeast. In RC, if both :global and :init-value of define-minor-mode is non-nil, define-minor-mode calls eval-after-load as below: ;; If the mode is global, call the function according to the default. ,(if (and globalp (null init-value)) `(if (and load-file-name ,mode) (eval-after-load load-file-name '(,mode 1))))))) And, eval-after-load calls load-symbol-file-load-history, and load-symbol-file-load-history loads "fns-XX.YY.ZZ.el". But, at bootstrapping time, as "fns-XX.YY.ZZ.el" is not yet generated, it signals an error. It may not be a bug of define-minor-mode, but a bug of eval-after-load or load-symbol-file-load-history. In any case, it should be fixed at somewhere. In HEAD instead, define-minor-mode now has this code: ;; If the mode is global, call the function according to the default. ,(if globalp `(if (and load-file-name (not (equal ,init-value ,mode))) (eval-after-load load-file-name '(,mode (if ,mode 1 -1)))))))) As (equal ,init-value ,mode) is t at bootstrapping time, eval-after-load is not called, thus the above error is not revealed. But, as the result, it is now the programmer's responsibility to make the XXX-minor-mode's status synchronize to the value of XXX-minor-mode, i.e., we must do: (define-minor-mode 'XXX-mode "" :global t :init-value t ...) (XXX-mode 1) I don't argue that this new behaviour is good or bad. At least, it is not a bug if properly described in the docstring of define-minor-mode. --- Ken'ichi HANDA handa@m17n.org