From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: Capture/store link bug Date: Mon, 25 Mar 2013 17:15:54 -0500 Message-ID: <8738vjb0hw.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:45505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKFgM-0005qn-Oc for emacs-orgmode@gnu.org; Mon, 25 Mar 2013 18:16:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UKFgK-0003K7-7J for emacs-orgmode@gnu.org; Mon, 25 Mar 2013 18:15:58 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:38155) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKFgJ-0003Jl-Rl for emacs-orgmode@gnu.org; Mon, 25 Mar 2013 18:15:56 -0400 Received: from archdesk (unknown [209.147.100.197]) by mail.messagingengine.com (Postfix) with ESMTPA id 3DC832000F7 for ; Mon, 25 Mar 2013 18:15:55 -0400 (EDT) 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: Org Mode Hi Bastien, The changes to org-store-link in commit ecb9e5811 cause a couple of issues: 1) When an org-capture template is invoked with (a) an active region and (b) an annotation (i.e., a link), the link is not inserted in the capture buffer. Here is a sample org-capture template: --8<---------------cut here---------------start------------->8--- (setq org-capture-templates '(("n" "Note" entry (file "~/org/inbox.org") "* %^{Title}\n %U\n %a\n\n %i"))) --8<---------------cut here---------------end--------------->8--- When I invoke org capture on a file with the region active (say, using this draft email), I end up with a capture buffer that looks like this: --8<---------------cut here---------------start------------->8--- * Title [2013-03-25 Mon 17:03] When I invoke --8<---------------cut here---------------end--------------->8--- Note the missing link. Prior to commit ecb9e5811, the capture buffer looked like this: --8<---------------cut here---------------start------------->8--- * Title [2013-03-25 Mon 17:03] [[gnus:nnml:sent#8738vjb0hw.fsf@fastmail.fm][Matt Lundin: Capture/store link bug]] When I invoke --8<---------------cut here---------------end--------------->8--- 2) org-store-links contains multiple entries for each link. If I set org-stored-links to nil and then invoke org-stored-link *once* with the region active in a file (say, lines 9305 to 9309 in org.el), I am given the following options when invoking org-insert-link. Note this is only after invoking org-stored-link once: --8<---------------cut here---------------start------------->8--- --8<---------------cut here---------------end--------------->8--- It seems this is a list of duplicates. The value of org-stored-link is as follows: --8<---------------cut here---------------start------------->8--- Contains the links stored with `org-store-link'. Value: ((#("file:~/org-mode/lisp/org.el::(if (and (org-region-active-p) (not ignore-region))\n (save-excursion" 29 30 (fontified t) 30 32 (face font-lock-keyword-face fontified t) 33 37 (fontified t) 38 59 (fontified t) 60 64 (fontified t) 65 80 (fontified t) 82 83 (fontified t) 83 97 (face font-lock-keyword-face fontified t)) nil) (#("file:~/org-mode/lisp/org.el::(if (and (org-region-active-p) (not ignore-region))\n (save-excursion" 29 30 (fontified t) 30 32 (face font-lock-keyword-face fontified t) 33 37 (fontified t) 38 59 (fontified t) 60 64 (fontified t) 65 80 (fontified t) 82 83 (fontified t) 83 97 (face font-lock-keyword-face fontified t)) nil) (#("file:~/org-mode/lisp/org.el::(if (and (org-region-active-p) (not ignore-region))\n (save-excursion" 29 30 (fontified t) 30 32 (face font-lock-keyword-face fontified t) 33 37 (fontified t) 38 59 (fontified t) 60 64 (fontified t) 65 80 (fontified t) 82 83 (fontified t) 83 97 (face font-lock-keyword-face fontified t)) nil) (#("file:~/org-mode/lisp/org.el::(if (and (org-region-active-p) (not ignore-region))\n (save-excursion" 29 30 (fontified t) 30 32 (face font-lock-keyword-face fontified t) 33 37 (fontified t) 38 59 (fontified t) 60 64 (fontified t) 65 80 (fontified t) 82 83 (fontified t) 83 97 (face font-lock-keyword-face fontified t)) nil) (#("file:~/org-mode/lisp/org.el::(if (and (org-region-active-p) (not ignore-region))\n (save-excursion\n" 29 30 (fontified t) 30 32 (face font-lock-keyword-face fontified t) 33 37 (fontified t) 38 59 (fontified t) 60 64 (fontified t) 65 81 (fontified t) 82 83 (fontified t) 83 97 (face font-lock-keyword-face fontified t) 97 98 (fontified t)) nil) (#("file:~/org-mode/lisp/org.el::(if (and (org-region-active-p) (not ignore-region))\n" 29 30 (fontified t) 30 32 (face font-lock-keyword-face fontified t) 33 37 (fontified t) 38 59 (fontified t) 60 64 (fontified t) 65 81 (fontified t)) nil) (#("file:~/org-mode/lisp/org.el::(if (and (org-region-active-p) (not ignore-region))" 29 30 (fontified t) 30 32 (face font-lock-keyword-face fontified t) 33 37 (fontified t) 38 59 (fontified t) 60 64 (fontified t) 65 80 (fontified t)) nil)) --8<---------------cut here---------------end--------------->8--- Best, Matt