From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Politowski Subject: Re: %K template escape doesn't link to exact task headline Date: Thu, 13 Jul 2017 15:30:06 +0200 Message-ID: <20170713133006.n3tno7gxbihb7el7@meep.pl> References: <20170713105410.mfjzdngtqojuhuu5@meep.pl> <87mv88frog.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVeC8-000263-SL for emacs-orgmode@gnu.org; Thu, 13 Jul 2017 09:30:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVeC4-0002LL-06 for emacs-orgmode@gnu.org; Thu, 13 Jul 2017 09:30:16 -0400 Received: from mx1.icm.edu.pl ([213.135.59.49]:35301) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVeC3-0002KZ-Or for emacs-orgmode@gnu.org; Thu, 13 Jul 2017 09:30:11 -0400 Content-Disposition: inline In-Reply-To: <87mv88frog.fsf@nicolasgoaziou.fr> 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: Nicolas Goaziou Cc: emacs-orgmode@gnu.org On Thu, 13 Jul 2017 14:27:11 +0200, Nicolas Goaziou wrote: > Hello, >=20 > Michal Politowski writes: >=20 > > Hello everyone and thank you for the fascinating org mode, > > > > Is the behaviour of %K a bug in the documentation, in the implementatio= n, > > or just my unfounded expectation? > > > > It is supposed to link "to the currently clocked task" but it is implem= ented > > in org-capture.el as > > > > (v-K (if (marker-buffer org-clock-marker) > > (org-make-link-string > > (buffer-file-name (marker-buffer org-clock-marker)) > > org-clock-heading))) > > > > > > > > which only puts the headline text in the link description, > > the actual link is just to the task file - not what I would expect. >=20 > Fixed. Thank you. Thank you. Wouldn't it be better to still have a link description though? Probably both versions have advantages. diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 44dbb7f96..7b880cf9a 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -1613,7 +1613,8 @@ The template may still contain \"%?\" for cursor posi= tioning." (org-make-link-string (format "%s::%s" (buffer-file-name (marker-buffer org-clock-marke= r)) - (org-no-properties org-clock-heading))) + (org-no-properties org-clock-heading)) + (org-no-properties org-clock-heading)) "")) (v-f (or (org-capture-get :original-file-nondirectory) "")) (v-F (or (org-capture-get :original-file) "")) --=20 Micha=B3 Politowski