[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] org-store-link programmatically?
From: |
David Belohrad |
Subject: |
[O] org-store-link programmatically? |
Date: |
Fri, 01 Nov 2013 22:47:44 +0100 |
User-agent: |
Notmuch/0.16+96~g459c586 (http://notmuchmail.org) Emacs/23.4.1 (x86_64-pc-linux-gnu) |
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:address@hidden
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
- [O] org-store-link programmatically?,
David Belohrad <=