From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Holst Subject: Problems with capture Date: Mon, 07 Dec 2015 14:12:03 +0100 Message-ID: <87fuzeh07w@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37040) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5vaO-0004yL-RB for emacs-orgmode@gnu.org; Mon, 07 Dec 2015 08:12:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a5vaL-0007qM-E6 for emacs-orgmode@gnu.org; Mon, 07 Dec 2015 08:12:12 -0500 Received: from mout.gmx.net ([212.227.17.20]:65522) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5vaL-0007qB-5R for emacs-orgmode@gnu.org; Mon, 07 Dec 2015 08:12:09 -0500 Received: from thommy-desktop ([84.57.133.159]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0LbMb0-1aYz082ewE-00kuMI for ; Mon, 07 Dec 2015 14:12:07 +0100 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org 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