emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: David Abrahams <dave@boostpro.com>
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: Org-mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: Bug: org-install must precede customization [7.02trans]
Date: Sun, 14 Nov 2010 08:28:21 -0500	[thread overview]
Message-ID: <m2fwv4591m.wl%dave@boostpro.com> (raw)
In-Reply-To: <CA5F6295-ECC9-4B51-8F36-AEB4F524D9E9@gmail.com>

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

  reply	other threads:[~2010-11-14 13:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-12 18:45 Bug: org-install must precede customization [7.02trans] David Abrahams
2010-11-12 22:29 ` Carsten Dominik
2010-11-13  3:28   ` David Abrahams
2010-11-13  4:40     ` Carsten Dominik
2010-11-13  5:01       ` David Abrahams
2010-11-13  5:50         ` Carsten Dominik
2010-11-14 13:28           ` David Abrahams [this message]
2010-11-13  5:55     ` Anupam Sengupta
2010-11-13  6:00       ` Carsten Dominik
2010-11-14 13:29       ` David Abrahams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2fwv4591m.wl%dave@boostpro.com \
    --to=dave@boostpro.com \
    --cc=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).