Dear all,

i want to write a piece of code as a 'template', which generates TODO
using capture template, and inserts into the todo a LINK TO THE
LOCATION, from which I have called the org-capture.

the main usage for me is basically when I get email message (notmuch),
to generate a journal entry with some comments and at the end of this
entry a link to that email.

I thought like defining a function like this one:

  (defun org-notmuch-copymail ()
    (interactive)
    (org-store-link)
    ;; some code to get the link into the yank buffer
    (org-capture nil "c"))
 
where the 'c' template is defined as follows:

("c" "Global todo entry with clipboard content" entry (file+headline (concat 
my-org-files "gtd.org") "Tasks")
"* TODO %?\n:LOGBOOK:\n%c\n:END:\n")

The trouble #1 I have is a call to (org-store-link), which always fails,
because it requires 'an argument' I have a hard time to find which one.

One of the options I was considering was as well to 'construct' the link
myself. That requires some 'generalization' as I would have to detect
(somehow) what type of buffer it is. As filelinks:

[[mylink.png][sometext]]

are different from notmuch links:

[[notmuch:id:75a7a46b727b42dca8c70b1c64db0...@cernfe23.cern.ch][email]]


Any ideas how to solve this?

As a bonus question: I've noticed, that when I store link, and then
paste it, it pastes the files using absolute paths. I would very much
prefer relative paths. Is there any way how to change this behaviour?

many thanks

david

Reply via email to