emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ignacio Casso <ignaciocasso@hotmail.com>
To: emacs-orgmode@gnu.org
Subject: [BUG] org-capture autoload bug? [9.5.2 (9.5.2-gfbff08 @ /home/ignacio/.emacs.d/elpa/org-9.5.2/)]
Date: Thu, 10 Mar 2022 13:53:03 +0100	[thread overview]
Message-ID: <PAXPR06MB77602E75E066A63577E6972FC60B9@PAXPR06MB7760.eurprd06.prod.outlook.com> (raw)

Hello,

I think I've found a bug with org-capture autoload. If the first time
you use org-capture before it's actually loaded is within a let form binding
org-capture-templates, it produces an error saying that the template was
not found.

For example, if we call this:

  (let ((org-capture-templates
         '(("d" "default" entry
            (file+headline org-default-notes-file "Tasks")
            "* %?"))))
    (org-capture nil "d")))

It produces the error:

  (error "No capture template referred to by \"d\" keys")


Furthermore, depending on where that form was evaluated or defined, the
next time you called org-capture may work or produce the following
error:

  org-capture: Symbol’s value as variable is void: org-capture-templates

In particular, if it is evaluated directly in the scratch buffer the
next call to org-capture works, and if it is part of a function
defined in my init file and evaluated in the scratch buffer, it produces
the error.

I have tried this too in Emacs 29 and the behaviour is similar, but
sometimes the error produced is

  (error "Defining as dynamic an already lexical var")

instead of

  (error "No capture template referred to by \"d\" keys")

This again depends on where the form is evaluated or defined.


Best regards,

Ignacio

P.S., I now this has an easy solution: not autoloading org-capture and having
(require 'org-capture) in my config. I'm just reporting the bug, if that
is what this is.

Emacs  : GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20)
 of 2022-01-16
Package: Org mode version 9.5.2 (9.5.2-gfbff08 @ /home/ignacio/.emacs.d/elpa/org-9.5.2/)


             reply	other threads:[~2022-03-10 13:41 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-10 12:53 Ignacio Casso [this message]
2022-03-10 16:32 ` [BUG] org-capture autoload bug? [9.5.2 (9.5.2-gfbff08 @ /home/ignacio/.emacs.d/elpa/org-9.5.2/)] Max Nikulin
2022-03-10 18:00   ` Ignacio Casso
2022-03-11 10:07     ` Max Nikulin
2022-03-11 10:38       ` Ignacio Casso
2022-03-11 19:59         ` Tim Cross
2022-03-14 10:42           ` Ignacio Casso
2022-03-14 14:52           ` Max Nikulin
2022-03-14 18:42             ` Tim Cross
2022-03-14 19:43               ` Ignacio Casso
2022-03-14 22:54                 ` Tim Cross
2022-03-15  9:02                   ` Ignacio Casso
2022-03-15 15:59                     ` Ignacio Casso
2022-03-15 12:04                 ` Max Nikulin
2022-03-15 12:26                   ` Ignacio Casso
  -- strict thread matches above, loose matches on Subject: below --
2022-06-11  7:50 Ignacio Casso
2022-06-11 13:32 ` Ihor Radchenko
2022-06-11 17:25   ` Ignacio Casso
2022-06-14  4:02     ` Ihor Radchenko
2022-06-14  7:49       ` Ignacio Casso
2022-06-14 13:58         ` Ihor Radchenko
2022-06-12 12:36   ` Max Nikulin

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=PAXPR06MB77602E75E066A63577E6972FC60B9@PAXPR06MB7760.eurprd06.prod.outlook.com \
    --to=ignaciocasso@hotmail.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).