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 _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode