emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-store-link and org-git-link
@ 2016-10-09 12:21 Per Unneberg
  0 siblings, 0 replies; only message in thread
From: Per Unneberg @ 2016-10-09 12:21 UTC (permalink / raw)
  To: emacs-orgmode

Hi list,

in my configuration I require org-git-link to provide org links to
specific file versions. This means that for org-capture-templates, the
annotation "%a" will insert the org-git-link for org files under git
version control. However, I would like to insert the "usual" org link
("org" or "id"), which manually can be called with "C-u C-u C-c C-l". I
tried defining a function that emulates the prefix arg thus:

(defun peru/org-store-link ()
 (setq current-prefix-arg '(16))
 (call-interactively 'org-store-link "org")
)

Calling (peru/org-store-link) from within an org file works as expected,
but I can't get the capture template to work. The template is defined as

(setq org-capture-templates (quote
(("w" "test" entry
 (file "~/Org/refile.org")
 "* TODO %? %^G\n%u\n%(peru/org-store-link)\n\n" :prepend t)
 ))

which produces the following:

* TODO 
[2016-10-09 Sun]
%![Error: (user-error No method for storing a link from this buffer)]

Any help would be appreciated.

Cheers,

Per

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-10-09 12:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-09 12:21 org-store-link and org-git-link Per Unneberg

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).