From mboxrd@z Thu Jan 1 00:00:00 1970 From: Felix Fernandes Subject: [Bug] org-store-link produces different results if called from keyboard macro Date: Mon, 12 Jan 2015 21:39:57 +0000 (UTC) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAmiY-0005sM-Ci for emacs-orgmode@gnu.org; Mon, 12 Jan 2015 16:40:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YAmiV-0004Xj-6h for emacs-orgmode@gnu.org; Mon, 12 Jan 2015 16:40:10 -0500 Received: from plane.gmane.org ([80.91.229.3]:49554) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAmiV-0004VN-0X for emacs-orgmode@gnu.org; Mon, 12 Jan 2015 16:40:07 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YAmiT-0000yj-ME for emacs-orgmode@gnu.org; Mon, 12 Jan 2015 22:40:05 +0100 Received: from 216.1.169.18 ([216.1.169.18]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Jan 2015 22:40:05 +0100 Received: from felixfcaf by 216.1.169.18 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Jan 2015 22:40:05 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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