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: obsolete comment in tool-bar.el Date: Thu, 14 Jul 2005 13:30:05 -0500 (CDT) Message-ID: <200507141830.j6EIU5r11167@raven.dms.auburn.edu> References: <200507071915.j67JFZT29961@raven.dms.auburn.edu> <200507090235.j692ZER04883@raven.dms.auburn.edu> <200507110321.j6B3LgG09526@raven.dms.auburn.edu> <85y88dfcqw.fsf@lola.goethe.zz> <200507130302.j6D32qE05640@raven.dms.auburn.edu> <200507140208.j6E28tr08794@raven.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1121365991 25732 80.91.229.2 (14 Jul 2005 18:33:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 14 Jul 2005 18:33:11 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 14 20:33:09 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dt8V8-0002Mi-HS for ged-emacs-devel@m.gmane.org; Thu, 14 Jul 2005 20:32:02 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dt8Ws-0005Ph-Bb for ged-emacs-devel@m.gmane.org; Thu, 14 Jul 2005 14:33:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dt8WJ-0005Fc-Fd for emacs-devel@gnu.org; Thu, 14 Jul 2005 14:33:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dt8WG-0005Dm-C1 for emacs-devel@gnu.org; Thu, 14 Jul 2005 14:33:14 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dt8WF-0005Cd-L3 for emacs-devel@gnu.org; Thu, 14 Jul 2005 14:33:11 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Dt8bS-0000ld-K8; Thu, 14 Jul 2005 14:38:34 -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 j6EIUBCK006027; Thu, 14 Jul 2005 13:30:11 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id j6EIU5r11167; Thu, 14 Jul 2005 13:30:05 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: mituharu@math.s.chiba-u.ac.jp In-reply-to: (message from YAMAMOTO Mitsuharu on Thu, 14 Jul 2005 17:14:35 +0900) 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:40890 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:40890 I have the impression that the offending code in define-minor-mode: ;; 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)))))))) combined with custom-initialize-default, is an ugly kludge to get around a bug people sometimes make where they use functions or variables in a :set function that are defined in the same file, but _after_ the defcustom. That of course does not work and the obvious solution is to define those functions and variables before the defcustom. But I believe that define-minor-mode tries to hide this type of user bug and work around it by delaying the enabling of the minor mode function until after the file is loaded. If this is the correct interpretation of the code, then that was a silly thing to do, but now things may have come to rely on it. Until we decide what to really do with this, I believe that the following patch should at least allow Emacs CVS to be built on all operating systems (but I can not test). Rather than applying this patch, I would rather get rid of the `eval-after-load' kludge altogether, but if the patch works, it at least shows that we have isolated the only real problem. ===File ~/easy-mmode-diff=================================== *** easy-mmode.el 14 Jul 2005 12:45:27 -0500 1.68 --- easy-mmode.el 14 Jul 2005 12:51:32 -0500 *************** *** 264,271 **** ;; 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)))))))) ;;; ;;; make global minor mode --- 264,274 ---- ;; If the mode is global, call the function according to the default. ,(if globalp ! `(and load-file-name ! (eq (quote ,initialize) ! (quote (:initialize 'custom-initialize-default))) ! (not (equal ,init-value ,mode)) ! (eval-after-load load-file-name '(,mode (if ,mode 1 -1)))))))) ;;; ;;; make global minor mode ============================================================