emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thomas Holst <Thomas_Holst@gmx.de>
To: emacs-orgmode@gnu.org
Subject: org-capture regression?
Date: Thu, 20 Sep 2018 10:13:56 +0200	[thread overview]
Message-ID: <87r2ho60xn.fsf@gmx.de> (raw)

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 <Thomas_Holst@gmx.de>
Date:   Mon Mar 17 09:01:40 2014 +0100

    docu change for table-line-pos new feature
    
commit 176125c32ff2a8adc6e1d3091a57e46e482da638
Author: Thomas Holst <Thomas_Holst@gmx.de>
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

             reply	other threads:[~2018-09-20  8:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-20  8:13 Thomas Holst [this message]
2018-09-20 12:53 ` org-capture regression? Nicolas Goaziou
2018-09-20 14:01   ` Thomas Holst

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r2ho60xn.fsf@gmx.de \
    --to=thomas_holst@gmx.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).