From mboxrd@z Thu Jan 1 00:00:00 1970 From: Per Unneberg Subject: org-store-link and org-git-link Date: Sun, 09 Oct 2016 14:21:12 +0200 Message-ID: <87a8edaf2f.fsf@gmail.com> Reply-To: Per Unneberg Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btD6c-0006QM-2X for emacs-orgmode@gnu.org; Sun, 09 Oct 2016 08:21:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btD6V-0002tI-Ub for emacs-orgmode@gnu.org; Sun, 09 Oct 2016 08:21:24 -0400 Received: from mail-lf0-x22d.google.com ([2a00:1450:4010:c07::22d]:33014) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btD6V-0002sz-Mp for emacs-orgmode@gnu.org; Sun, 09 Oct 2016 08:21:19 -0400 Received: by mail-lf0-x22d.google.com with SMTP id x79so73428295lff.0 for ; Sun, 09 Oct 2016 05:21:19 -0700 (PDT) Received: from gollum-VirtualBox (c83-255-63-134.bredband.comhem.se. [83.255.63.134]) by smtp.gmail.com with ESMTPSA id b71sm5115989lfb.42.2016.10.09.05.21.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Oct 2016 05:21:17 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org 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