From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Semantics of autoload cookies on defcustoms Date: Fri, 07 Jul 2006 10:10:11 -0400 Message-ID: References: <17582.25229.972850.752440@localhost.localdomain> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1152281452 30159 80.91.229.2 (7 Jul 2006 14:10:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 7 Jul 2006 14:10:52 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 07 16:10:48 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 1Fyr2W-0003cu-2n for ged-emacs-devel@m.gmane.org; Fri, 07 Jul 2006 16:10:40 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fyr2V-0003YA-GP for ged-emacs-devel@m.gmane.org; Fri, 07 Jul 2006 10:10:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fyr2K-0003Xv-I8 for emacs-devel@gnu.org; Fri, 07 Jul 2006 10:10:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fyr2J-0003Xj-4d for emacs-devel@gnu.org; Fri, 07 Jul 2006 10:10:27 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fyr2I-0003Xc-UT for emacs-devel@gnu.org; Fri, 07 Jul 2006 10:10:26 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fyr2i-0003eN-IW; Fri, 07 Jul 2006 10:10:52 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 9273B2CF491; Fri, 7 Jul 2006 10:10:25 -0400 (EDT) Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 5887F445C; Fri, 7 Jul 2006 10:10:11 -0400 (EDT) Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 54C6C6C8C8; Fri, 7 Jul 2006 10:10:11 -0400 (EDT) Original-To: raman@users.sf.net In-Reply-To: <17582.25229.972850.752440@localhost.localdomain> (T. V. Raman's message of "Fri, 7 Jul 2006 06:33:01 -0700") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca 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:56720 Archived-At: > The other negative consequence of putting an autoload cookie on a > defcustom is the following: > So let's say you have package foo.el and with option foo. > Let's further assume you've customized foo and saved your > setting. > If package foo gets autloaded sometime after startup --- the > option foo ends up with its default value -- not your saved value > --- and you end up needing to do a "reset to saved". Please use another thread because I don't think it's related other than circumstantially. And please give a precise test case. Stefan >>>>> "Richard" == Richard Stallman writes: Richard> What is the intended effect of adding an Richard> autoload cookie on a defcustom? It puts a defvar Richard> and the custom-autoload call into loaddefs. Richard> Richard> I ask this question because I recently noticed Richard> that setting variables such as diary-file via custom Richard> causes calendar.el to be loaded at startup, even tho Richard> I can't see any reason why such a setting would Richard> justify eagerly loading calendar.el. Richard> Richard> There was a reason for this, and I used to know it, Richard> but I have forgotten. Richard> Richard> In order to process the specified value, custom Richard> needs the defcustom info. So there are two options: Richard> Richard> 1. Save the value away and process it if/when the Richard> defcustom is loaded. 2. Load the defcustom now, and Richard> process the value right away. Richard> Richard> #1 is the usual method. That is fine for variables Richard> that aren't really defined at all until the package Richard> is loaded. Richard> Richard> But when a variable is autoloaded, that means its Richard> value is meaningful already, and it could be used at Richard> any time. So there is no correct alternative except Richard> #2. Richard> Richard> Putting the actual defcustom into loaddefs would Richard> also work. We would not want to do that for all Richard> autoloaded defcustoms. For one thing, there are Richard> defcustoms for which this won't work. For others, Richard> it would just waste space inside the dumped Emacs. Richard> But there could be some (perhaps diary-file is one) Richard> for which this would be better. Richard> Richard> It would not be hard to implement this option. How Richard> could we specify whether to do #2 or this? Richard> Richard> Richard> _______________________________________________ Richard> Emacs-devel mailing list Emacs-devel@gnu.org Richard> http://lists.gnu.org/mailman/listinfo/emacs-devel > -- > Best Regards, > --raman > Email: raman@users.sf.net > WWW: http://emacspeak.sf.net/raman/ > AIM: emacspeak GTalk: tv.raman.tv@gmail.com > PGP: http://emacspeak.sf.net/raman/raman-almaden.asc > Google: tv+raman > IRC: irc://irc.freenode.net/#emacs > _______________________________________________ > Emacs-devel mailing list > Emacs-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-devel