emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-capture regression?
@ 2018-09-20  8:13 Thomas Holst
  2018-09-20 12:53 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Holst @ 2018-09-20  8:13 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-20 14:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-20  8:13 org-capture regression? Thomas Holst
2018-09-20 12:53 ` Nicolas Goaziou
2018-09-20 14:01   ` Thomas Holst

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