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