* Capture/store link bug
@ 2013-03-25 22:15 Matt Lundin
2013-03-25 22:54 ` Bastien
0 siblings, 1 reply; 6+ messages in thread
From: Matt Lundin @ 2013-03-25 22:15 UTC (permalink / raw)
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---
<no description> <file:~/org-mode/lisp/org.el::(if (and (org-region-active-p) (not ignore-region))>
<no description> <file:~/org-mode/lisp/org.el::(if (and (org-region-active-p) (not ignore-region))
>
<no description> <file:~/org-mode/lisp/org.el::(if (and (org-region-active-p) (not ignore-region))
(save-excursion
>
<no description> <file:~/org-mode/lisp/org.el::(if (and (org-region-active-p) (not ignore-region))
(save-excursion>
<no description> <file:~/org-mode/lisp/org.el::(if (and (org-region-active-p) (not ignore-region))
(save-excursion>
<no description> <file:~/org-mode/lisp/org.el::(if (and (org-region-active-p) (not ignore-region))
(save-excursion>
<no description> <file:~/org-mode/lisp/org.el::(if (and (org-region-active-p) (not ignore-region))
(save-excursion>
--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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Capture/store link bug
2013-03-25 22:15 Capture/store link bug Matt Lundin
@ 2013-03-25 22:54 ` Bastien
2013-03-26 0:24 ` Matt Lundin
0 siblings, 1 reply; 6+ messages in thread
From: Bastien @ 2013-03-25 22:54 UTC (permalink / raw)
To: Matt Lundin; +Cc: Org Mode
Hi Matt,
Matt Lundin <mdl@imapmail.org> writes:
> 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.
This one must be fixed, thanks.
> 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:
I need to digg deeper for this one. When the active region has four
lines, I get four links. The fact that they are identical may be due
to the way links are handle in the mode. I'll come back to this later
on.
Thanks for these detailed reports,
--
Bastien
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Capture/store link bug
2013-03-25 22:54 ` Bastien
@ 2013-03-26 0:24 ` Matt Lundin
2013-03-26 0:52 ` Matt Lundin
0 siblings, 1 reply; 6+ messages in thread
From: Matt Lundin @ 2013-03-26 0:24 UTC (permalink / raw)
To: Bastien; +Cc: Org Mode
Bastien <bzg@altern.org> writes:
> Matt Lundin <mdl@imapmail.org> writes:
>
>> 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.
>
> This one must be fixed, thanks.
Hmm. I see the change you made and it makes sense. But it seems now that
the annotations (i.e., links) do not appear at all in the capture,
regardless of whether there is an active region or not.
Thanks,
Matt
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Capture/store link bug
2013-03-26 0:24 ` Matt Lundin
@ 2013-03-26 0:52 ` Matt Lundin
2013-03-27 6:48 ` Bastien
0 siblings, 1 reply; 6+ messages in thread
From: Matt Lundin @ 2013-03-26 0:52 UTC (permalink / raw)
To: Bastien; +Cc: Org Mode
Matt Lundin <mdl@imapmail.org> writes:
> Bastien <bzg@altern.org> writes:
>
>> Matt Lundin <mdl@imapmail.org> writes:
>>
>>> 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.
>>
>> This one must be fixed, thanks.
>
> Hmm. I see the change you made and it makes sense. But it seems now that
> the annotations (i.e., links) do not appear at all in the capture,
> regardless of whether there is an active region or not.
I think I've figured out why this doesn't work. See line 9492 of org.el.
If ignore-region is t, org-store-link does not return a value, which
org-capture expects. Rather org-store-link adds the link to
org-stored-links.
Matt
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-03-28 15:36 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-25 22:15 Capture/store link bug Matt Lundin
2013-03-25 22:54 ` Bastien
2013-03-26 0:24 ` Matt Lundin
2013-03-26 0:52 ` Matt Lundin
2013-03-27 6:48 ` Bastien
2013-03-28 15:36 ` Matt Lundin
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).