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: Sat, 21 Sep 2002 10:57:38 +0900 (JST) Sender: emacs-devel-admin@gnu.org Message-ID: <200209210157.KAA05776@etlken.m17n.org> References: <200209201838.g8KIc8t13414@rum.cs.yale.edu> 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 1032603555 11402 127.0.0.1 (21 Sep 2002 10:19:15 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 21 Sep 2002 10:19:15 +0000 (UTC) Cc: emacs-devel@gnu.org, d.love@dl.ac.uk Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17shM1-0002xm-00 for ; Sat, 21 Sep 2002 12:19:13 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17si1f-0001DL-00 for ; Sat, 21 Sep 2002 13:02:20 +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 17shLA-0003bj-00; Sat, 21 Sep 2002 06:18:20 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17sZWu-0006XC-00 for emacs-devel@gnu.org; Fri, 20 Sep 2002 21:57:56 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17sZWr-0006X0-00 for emacs-devel@gnu.org; Fri, 20 Sep 2002 21:57:55 -0400 Original-Received: from tsukuba.m17n.org ([192.47.44.130]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17sZWr-0006Ww-00 for emacs-devel@gnu.org; Fri, 20 Sep 2002 21:57:53 -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 g8L1vdK11058; Sat, 21 Sep 2002 10:57:39 +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 g8L1vcd10497; Sat, 21 Sep 2002 10:57:38 +0900 (JST) Original-Received: (from handa@localhost) by etlken.m17n.org (8.8.8+Sun/3.7W-2001040620) id KAA05776; Sat, 21 Sep 2002 10:57:38 +0900 (JST) Original-To: monnier+gnu/emacs@rum.cs.yale.edu In-reply-to: <200209201838.g8KIc8t13414@rum.cs.yale.edu> (monnier+gnu/emacs@rum.cs.yale.edu) 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:8071 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:8071 References: <200209191320.WAA03733@etlken.m17n.org> <200209191346.g8JDkdq07175@rum.cs.yale.edu> <200209200006.JAA04300@etlken.m17n.org> <200209201838.g8KIc8t13414@rum.cs.yale.edu> --text follows this line-- In article <200209201838.g8KIc8t13414@rum.cs.yale.edu>, "Stefan Monnier" writes: >> But, it seems that, with this, if :init-value is t, the >> function to do various settings to make the mode work is >> never called. > Do you mean that you'd rather see > ,(if globalp > `(if (and load-file-name (not (equal ,mode ,init-value))) > (eval-after-load load-file-name > '(,mode (if ,mode 1 -1))))) No. > I'm not sure it's worth the trouble. The reason for this little piece > of code is so as to call (foo-mode 1) when people do (setq foo-mode t) > in their .emacs and then load foo-mode.el. > But people shouldn't use (setq foo-mode t), they should use (foo-mode 1) > instead anyway. > So I'd rather use that code less often rather than more often. What I want is to make this work well at bootstrapping time because now ucs-tables.el is preloaded. (define-minor-mode unify-8859-on-encoding-mode "..." :group 'mule :global t :init-value t (if unify-8859-on-encoding-mode (ucs-unify-8859 t) (ucs-fragment-8859 t))) When use-tables.el is loaded and this code run, it must run (if ...) after setting the variable unify-8859-on-encoding-mode to t. Otherwise, the value of unify-8859-on-encoding-mode doesn't synchronize with the acutual status of the mode. Before your change, define-minor-mode tried to run (if ...) part through eval-after-load. But, eval-after-load doesn't work at bootstrapping time as I wrote before. After your change, define-minor-mode never run (if ...), which is worse. Or, am I misunderstanding the functionality of define-minor-mode? --- Ken'ichi HANDA handa@etl.go.jp