emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Problems with capture
@ 2015-12-07 13:12 Thomas Holst
  2015-12-07 18:05 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Holst @ 2015-12-07 13:12 UTC (permalink / raw)
  To: org mode mailing list

Hello org-moders,

I have a little trouble with capture. First here is the setup for one of
my capture templates:

#+begin_src emacs-lisp
(setq org-capture-templates
      '(
        ;; ...
        ("hr" "Rechnung erfassen" table-line (file+function "~/git/org-priv/Univ_Beih.org" th:capure-find-open-vers-regn)
         "| # | %^u | %^{Arzt/Apotheke} | %^{für wen|Lida|Oleg|Victor|Simon} | %^{Betrag} | %^u | | | |"
         :table-line-pos "III-1" :immediate-finish t)
        ;; ...
        ))
#+end_src

What this template shall achive:

- look if there is an entry (headline) with todo state OPEN
- if entry exists append a table line
- if entry does not exist, create a new headline, insert table structure
  and append line to newly created table.

The function `th:capture-find-open-vers-regn' does this. Creating works
fine, but a get an error:

  Error running timer `org-element--cache-sync': (error "Invalid search bound (wrong side of point)")

and:

  condition-case: Capture template `hr': Invalid table line specification "III-1

I use something like:

#+begin_src emacs-lisp
(org-element-map (org-element-parse-buffer) 'headline
       (lambda (hl)
         (and
          (string= "Rechnungen" (car (org-element-property :title hl)))
          (= 1 (org-element-property :level hl))
          (org-element-property :begin hl)))
       nil t)
#+end_src

To find the Position in the file and regular

: (insert "a huge string")

To insert new heading and table structure. The new structure is created,
but something breaks caching. How can I insert the new structure without
breaking caching?

Thanks for any pointers.

P.S.
Org-mode version 8.3.2 
(release_8.3.2-359-g6b2c38 @ /home/thommy/git-emacs/org-mode/lisp/)

GNU Emacs 24.5.1 (i686-pc-linux-gnu, GTK+ Version 2.24.23) 
of 2015-07-03 on thommy-desktop

-- 
Bis neulich ...
  Thomas

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

end of thread, other threads:[~2015-12-08 12:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-07 13:12 Problems with capture Thomas Holst
2015-12-07 18:05 ` Nicolas Goaziou
2015-12-08  9:16   ` Thomas Holst
2015-12-08 12:29     ` 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).