From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Holst Subject: org-capture regression? Date: Thu, 20 Sep 2018 10:13:56 +0200 Message-ID: <87r2ho60xn.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46447) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g2u6n-0004zN-It for emacs-orgmode@gnu.org; Thu, 20 Sep 2018 04:14:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g2u6j-0007WZ-OW for emacs-orgmode@gnu.org; Thu, 20 Sep 2018 04:14:45 -0400 Received: from mout.gmx.net ([212.227.17.20]:37173) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g2u6f-0007Nk-UL for emacs-orgmode@gnu.org; Thu, 20 Sep 2018 04:14:39 -0400 Received: from Boerne ([92.209.164.102]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Lu7ty-1fd9RT2lDK-011UDs for ; Thu, 20 Sep 2018 10:14:29 +0200 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 Hello, a view weeks ago a wrote a post about problems I have with one of my captue templates. (see: http://lists.gnu.org/archive/html/emacs-orgmode/2018-08/msg00161.html) Today I dug a little deeper. In March 2017 I sent two patches to enable the capture property :table-line-pos to be either a string, a variable or a function. #+begin_example commit 599ccd1cc83cc8a1b0af82ac93e23760637b37b5 Author: Thomas Holst Date: Mon Mar 17 09:01:40 2014 +0100 docu change for table-line-pos new feature commit 176125c32ff2a8adc6e1d3091a57e46e482da638 Author: Thomas Holst Date: Sat Mar 15 16:22:44 2014 +0100 org-capture.el: Allow `:table-line-pos' to be a function name, a string or a variable #+end_example Since a few weeks this is not working anymore. I have a capture template unsing this feature (which I use rarely but still). So here is I patch I came up with to re-enable theese features: #+begin_src diff * doc/org-manual.org (Template elements): document new/old features of `:table-line-pos' * lisp/org-captue.el (org-capture-place-table-line): eval the content of `:table-line-pos' --- doc/org-manual.org | 6 ++++-- lisp/org-capture.el | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/org-manual.org b/doc/org-manual.org index ae7c07c88..4a2a64fc4 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -7361,9 +7361,11 @@ Now lets look at the elements of a template definition. Each entry in - ~:table-line-pos~ :: Specification of the location in the table where the new line - should be inserted. It should be a string like =II-3= meaning + should be inserted. It could be a string like =II-3= meaning that the new line should become the third line before the - second horizontal separator line. + second horizontal separator line. Or it could be a function + returning a string or a variable containing a string as + explained above. - ~:kill-buffer~ :: diff --git a/lisp/org-capture.el b/lisp/org-capture.el index cbc72d43b..7f3e9e623 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -1212,7 +1212,8 @@ may have been stored before." ((pred (string-match-p org-table-border-regexp)) "| %?Bad template |") (text (concat text "\n")))) - (table-line-pos (org-capture-get :table-line-pos)) + (table-line-pos + (eval (org-capture-get :table-line-pos))) beg end) (cond ((org-capture-get :exact-position) -- 2.19.0 #+end_src This works for me. I can use my capture template again. In the meantime I signed FSF papers so TINYCHANGE is not required anymore. Thank you for looking into this. -- Bis neulich ... Thomas