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:08:36 -0400 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1152281361 29763 80.91.229.2 (7 Jul 2006 14:09:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 7 Jul 2006 14:09:21 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 07 16:09:17 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 1Fyr12-0003HI-2F for ged-emacs-devel@m.gmane.org; Fri, 07 Jul 2006 16:09:08 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fyr11-0002EZ-GL for ged-emacs-devel@m.gmane.org; Fri, 07 Jul 2006 10:09:07 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fyr0m-0002C4-0C for emacs-devel@gnu.org; Fri, 07 Jul 2006 10:08:52 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fyr0i-0002AL-Ix for emacs-devel@gnu.org; Fri, 07 Jul 2006 10:08:51 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fyr0i-0002AI-Fj for emacs-devel@gnu.org; Fri, 07 Jul 2006 10:08:48 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fyr17-0003TX-0e; Fri, 07 Jul 2006 10:09:13 -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 D40E22CF491; Fri, 7 Jul 2006 10:08:45 -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 90FCB445C; Fri, 7 Jul 2006 10:08:36 -0400 (EDT) Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 749D46C8C8; Fri, 7 Jul 2006 10:08:36 -0400 (EDT) Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Fri, 07 Jul 2006 00:15:03 -0400") 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:56719 Archived-At: > What is the intended effect of adding an autoload cookie on a defcustom? > It puts a defvar and the custom-autoload call into loaddefs. Yes, I saw that this is the actual behavior in autoload.el. I was expecting a description of the intention behind this actual behavior. > I ask this question because I recently noticed that setting variables such > as diary-file via custom causes calendar.el to be loaded at startup, even > tho I can't see any reason why such a setting would justify eagerly loading > calendar.el. > There was a reason for this, and I used to know it, but I have > forgotten. > In order to process the specified value, custom needs the defcustom > info. That's sometimes the case, but I can't see why it would be the case for diary-file. E.g. I understand the need for custom-autoload if the defcustom has a :setter but for a plain defcustom such as diary-file it doesn't seem to make much sense. > So there are two options: > 1. Save the value away and process it if/when the defcustom is loaded. > 2. Load the defcustom now, and process the value right away. > #1 is the usual method. That is fine for variables that aren't really > defined at all until the package is loaded. > But when a variable is autoloaded, that means its value is meaningful > already, and it could be used at any time. So there is no correct > alternative except #2. So if I understand correctly, you're saying that diary-file should simply not have an autoload cookie? Stefan