emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Felix Fernandes <felixfcaf@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [Bug] org-store-link produces different results if called from keyboard macro
Date: Mon, 12 Jan 2015 21:39:57 +0000 (UTC)	[thread overview]
Message-ID: <loom.20150112T222144-540@post.gmane.org> (raw)


In the following post,
http://stackoverflow.com/questions/27872038/emacs-keyboard-macro-fails-to-invoke-org-mode-capture-template,
artscan showed that org capture templates don't work in org v.8.2.10 when
invoked from within a keyboard macro. I reproduce his results here.

The following function
(defun test-inside-kbd-macro ()
  (interactive)
  (print (ignore-errors (org-store-link nil))))
gives different results depending on how it was executed. 

(1) M-x test-inside-kbd-macro gives
"[[file:~/git/org/refile.org::*kbd%20capture][kbd capture]]" (string), but 
(2)(execute-kbd-macro (read-kbd-macro "M-x test-inside-kbd-macro RET"))
gives ("file:~/git/org/refile.org::*kbd capture" "kbd capture") (list). 

Consider the last 10 lines of function org-store-link. Note that in Case (1)
the value of the function test-inside-kbd-macro is created using
(org-make-link-string link desc) but in Case (2) it is created by (car
org-stored-links)
Hence the differing results. 

Consequently, the following keyboard test macro, (in which C-c c is bound to
M-x org-capture)
      (fset 'jj   [?\C-c ?c ?t ?j ?j  return ?\C-c ?\C-c]) 
which invokes this capture template definition
   (setq org-capture-templates '(("t" "Todo" entry (file "~/org/j.org"))))
produces the following error message:
After 0 kbd macro iterations: byte-code: Capture abort: (wrong-type-argument
stringp (file:~/org/todo.org::*Tasks Tasks))

I consider this a bug because such macros which invoked the capture template
did work in org v7.8.02. 

The org-mode configuration and backtrace for these bugs are available in the
preceding stackoverflow post and also in this previous
post:http://thread.gmane.org/gmane.emacs.orgmode/93890

                 reply	other threads:[~2015-01-12 21:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=loom.20150112T222144-540@post.gmane.org \
    --to=felixfcaf@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).