I know about the %a template element, which inserts the stored link in the entry. I'd also like to automatically store a link whenever org-capture is called from within emacs (as opposed to spawning a capture window externally via emacsclient).

This would be useful, for example, when coding and needing to capture a task relevant to the passage of code I'm currently writing, or when I'm reading email and decide the current email needs to become a task.

When appropriate, I'd like to include the line number in the link.

Is this something that's already built in, or would it require a custom lisp function? I'm thinking I can probably advise org-capture to run org-store-link first, but perhaps there's a better idea.


1 Answer 1


org-capture already calls org-store-link and puts the information into a property list:

(plist-get org-store-link-plist :annotation)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.