emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [Bug] org-store-link produces different results if called from keyboard macro
@ 2015-01-12 21:39 Felix Fernandes
  0 siblings, 0 replies; only message in thread
From: Felix Fernandes @ 2015-01-12 21:39 UTC (permalink / raw)
  To: emacs-orgmode


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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-01-12 21:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-12 21:39 [Bug] org-store-link produces different results if called from keyboard macro Felix Fernandes

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).