From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Abrahams Subject: Re: Bug: org-install must precede customization [7.02trans] Date: Sun, 14 Nov 2010 08:28:21 -0500 Message-ID: References: Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from [140.186.70.92] (port=36215 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PHcdC-0002pI-6g for emacs-orgmode@gnu.org; Sun, 14 Nov 2010 08:28:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PHcd8-0005ZO-7G for emacs-orgmode@gnu.org; Sun, 14 Nov 2010 08:28:30 -0500 Received: from mail-qy0-f176.google.com ([209.85.216.176]:58914) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PHcd8-0005Z4-3t for emacs-orgmode@gnu.org; Sun, 14 Nov 2010 08:28:26 -0500 Received: by qyk29 with SMTP id 29so1721238qyk.0 for ; Sun, 14 Nov 2010 05:28:25 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: Org-mode mailing list At Fri, 12 Nov 2010 23:50:35 -0600, Carsten Dominik wrote: > > Hi David, > > On Nov 12, 2010, at 11:01 PM, David Abrahams wrote: > > > > > Hi Carsten, > > > > I'm sorry to belabor this, but I'm a little confused about what you're > > saying. > > that is because I just talked garbage. I don't think you are giving yourself enough credit. > Let me try a cleaner version. > > If I put an autoload cookie in front of a defun, a stub for this > function will be created in the autoloads file (for Org this is org- > install.el). When this file gets loaded and the corresponding form > evaluated, Emacs knows about this function and it will load the > corresponding file to get the full function whenever the function is > first called. > > We had a discussion here some point ago where someone complained that > org-capture-templates was not available for customization before org- > capture.el actually has been loaded. I thought that putting an > autoload cookie in front of a defcustom form would have the desired > effect. I had hoped that org-install.el then would make Emacs aware > of org-capture-templates and load org-capture.el whenever org-capture- > templates first was needed. > > However, it does not work like this. In org-install.el, the defcustom > is turned into a defvar, which defines the variable and sets it to > nil. That's unfortunate. It sounds rather like a bug in emacs. > When later the customize forms are evaluated, they see the variable > already defined and assume that the user has set this value on > purpose. So customize does not think it is entitled to overrule the > users action and so does *not* install its saved value. So this > creates a dependence on the load sequence of org-install.el and > custom.el. This is bad and unpredictable. Therefore I clearly prefer > that org-capture-templates is only available when org-capture indeed > has been loaded, and that an error is produced when I try to access > the variable before it is defined. Hmm, could that not be solved by doing a (require 'custom) in org-install.el? > Moreover, if you use `C-c r C' to customize the variable, I don't seem to have that binding. > it will work because the function org-capture is correctly > autoloaded. > > That is why I have decided to remove the autoload cookie. > > Better? Makes sense, mostly, thanks. I guess I should update my Org sources, then! -- Dave Abrahams BoostPro Computing http://www.boostpro.com