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: Fri, 15 Jul 2005 08:53:22 -0500 (CDT) Message-ID: <200507151353.j6FDrMf12755@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> <200507141830.j6EIU5r11167@raven.dms.auburn.edu> <878y08k857.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1121438318 5097 80.91.229.2 (15 Jul 2005 14:38:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 15 Jul 2005 14:38:38 +0000 (UTC) Cc: rms@gnu.org, mituharu@math.s.chiba-u.ac.jp, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 15 16:38:35 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DtRJB-0005ed-2q for ged-emacs-devel@m.gmane.org; Fri, 15 Jul 2005 16:37:01 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DtRKu-0001FK-MA for ged-emacs-devel@m.gmane.org; Fri, 15 Jul 2005 10:38:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DtRCP-0008MQ-11 for emacs-devel@gnu.org; Fri, 15 Jul 2005 10:29:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DtRBp-0008Ht-Jk for emacs-devel@gnu.org; Fri, 15 Jul 2005 10:29:54 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DtRBp-0007R0-Db for emacs-devel@gnu.org; Fri, 15 Jul 2005 10:29:21 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DtQms-00023g-NI; Fri, 15 Jul 2005 10:03:39 -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 j6FDrVCK008548; Fri, 15 Jul 2005 08:53:31 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id j6FDrMf12755; Fri, 15 Jul 2005 08:53:22 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: monnier@iro.umontreal.ca In-reply-to: <878y08k857.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Fri, 15 Jul 2005 00:35:45 -0400) 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:40925 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:40925 Stefan Monnier wrote: AFAIK, the motivation was also for some other cases where the user may somehow setq the variable before loading the file. IIRC this setq may actually be done by Custom (at a time where it doesn't yet know that the var have a :setter). The user should not set a minor mode variable directly unless setting the variable is all that is needed to enable the mode, in which case there is no need to call the function if the variable is already set. The same applies to Custom. Moreover, if it is done before loading the file, it is done before the define-minor-mode. But this is non-obvious, so it's ugly. In Elisp, if you call a function before it is defined, you get an error. If you reference a variable before it is defined, you get a compiler warning, unless you use a compiler defvar. That is true in particular for :set functions if the defcustom is not produced by define-minor-mode. Why should defcustoms defined by define-minor-mode be the lone exception? I do not believe that having to define functions and variables before using them is that horrible, but if it is, then should not changes in the way files are loaded or compiled be implemented, instead of this define-minor-mode only kludge? Also often those functions use the variable, so to shut up the byte-compiler you need to pre-declare the variable. That is what compiler defvars are for. Compiler defvars do not have the confusing negative side effects that eval-after-load has. Miles complained loudly (in the form of comments, some of which may still be in the current elisp code ;-) These comments make no sense. Sincerely, Luc.