[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Problems with capture
From: |
Thomas Holst |
Subject: |
Re: [O] Problems with capture |
Date: |
Tue, 8 Dec 2015 13:29:23 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (windows-nt) |
Hi Nicolas,
replying to myself :-),
I dug a little deeper into this.
· Thomas Holst <address@hidden> wrote:
> Hi Nicolas,
> · Nicolas Goaziou <address@hidden> wrote:
>> Thomas Holst <address@hidden> writes:
>
>> [...snip...]
>
> after a git-pull the first error (about cache) is gone. The second error
> still is there:
>
>>> condition-case: Capture template `hr': Invalid table line specification
>>> "III-1"
>
> The table which was inserted looks like this:
> #+begin_src org
> ** OPEN [2015-12-08 Di] Rechnungen
> #+NAME: akt-vers-rechnungen
>
> |---+-------+------+---------+--------+-----------+-------------+----------------+-----------------|
> | ! | Datum | Arzt | f+r wen | Betrag | wann bez. | wann bearb. | wann erh.
> Vers | wann erh. Beih. |
>
> |---+-------+------+---------+--------+-----------+-------------+----------------+-----------------|
>
> |---+-------+------+---------+--------+-----------+-------------+----------------+-----------------|
> | # | | | | 0.00 | | |
> 0.00 | 0.00 |
>
> |---+-------+------+---------+--------+-----------+-------------+----------------+-----------------|
> #+TBLFM: $8=$5*0.2;%.2f::$9=$5*0.8;%.2f::@2$5=vsum(@address@hidden);%.2f
> #+end_src
> After creation point is at beginning of headline (left of the two *).
> From my point of view table line specification "III-1" is ok.
>
> Thanks for looking into this.
The culprit is `org-capture-place-table-line'. It narrows the buffer to
relevant table but leaves point at the beginning of an empty line.
`org-table-analyze' does not any table and exits with nil.
For me the following patch fixes the problem:
#+begin_src diff
1 file changed, 1 insertion(+)
lisp/org-capture.el | 1 +
modified lisp/org-capture.el
@@ -1156,6 +1156,7 @@ may have been stored before."
(goto-char end)
(insert "\n| |\n|----|\n| |\n")
(narrow-to-region (1+ end) (point)))
+ (goto-char (point-min))
;; We are narrowed to the table, or to an empty line if there was no table
;; Check if the template is good
#+end_src
Maybe there is a better way to fix this.
Thanks again for lookint into this.
--
Mit freundlichen Grüßen / Best regards
Thomas Holst