Re: [O] Bug: org-capture with template for a table

2019-01-17 Thread Thomas Holst
Hello,

ยท Nicolas Goaziou  wrote:

> Thomas Holst  writes:
>
>> recently I encountered a bug with capturing table lines. Here is a ECM
>> to reproduce it:
>>
> [...]
>
> Fixed. Thank you.

thank you! Works perfectly again.

-- 
Bis neulich ...
  Thomas



Re: [O] Bug: org-capture with template for a table

2019-01-17 Thread Nicolas Goaziou
Hello,

Thomas Holst  writes:

> recently I encountered a bug with capturing table lines. Here is a ECM
> to reproduce it:
>
> - org-mode file (testing.org):
>
> #+begin_src org
> * Headline
> |---+--+|
> |   | Name | Amount |
> |---+--+|
> |---+--+|
> |   |  ||
> |---+--+|
> #+TBLFM: @2$3=vsum(@-II..@-I);%.2f
> #+end_src

[...]

> When I evaluate capture template I get following result:
>
> #+begin_src org
> * Headline
> |---+--+|
> |   | Name | Amount |
> |---+--+|
> | # |  |  33.00 |
>
> |---+---+---|
> |   |   |   |
> |---+---+---|
> #+TBLFM: @2$3=vsum(@-II..@-I);%.2f
> #+end_src

Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou



[O] Bug: org-capture with template for a table

2019-01-16 Thread Thomas Holst
Hello,

recently I encountered a bug with capturing table lines. Here is a ECM
to reproduce it:

- org-mode file (testing.org):
#+begin_src org
* Headline
|---+--+|
|   | Name | Amount |
|---+--+|
|---+--+|
|   |  ||
|---+--+|
#+TBLFM: @2$3=vsum(@-II..@-I);%.2f
#+end_src

- settings (init-file)
#+begin_src emacs-lisp
;; path settings for git repo
(add-to-list 'load-path "~/git-emacs/org-mode/contrib/lisp")
(add-to-list 'load-path "~/git-emacs/org-mode/contrib/babel/lisp")
;;; add org-mode/lisp as last
(add-to-list 'load-path "~/git-emacs/org-mode/lisp")

(require 'org)
(require 'org-capture)

(setq org-capture-templates
  '(("t" "testing" table-line (file+headline 
"~/Dropbox/emacs-testing/19-01-16-capture-table-line/testing.org" "Headline")
 "|#| |%^{amount}|" :table-line-pos "III-1" :immediate-finish t)))
#+end_src

I start emacs as follows:

: emacs -Q -l init-file.el --find-file testing.org

When I evaluate capture template I get following result:

#+begin_src org
* Headline
|---+--+|
|   | Name | Amount |
|---+--+|
| # |  |  33.00 |

|---+---+---|
|   |   |   |
|---+---+---|
#+TBLFM: @2$3=vsum(@-II..@-I);%.2f
#+end_src

First there is an empty line which breaks the table in two and secondly
the formula is not updated. This also happens when I delete the empty
line, correct formula and evaluate org-capture again.

With git-bisect I found that

commit c76486d4e431bf0c67d371341eb28445e7de4517
Author: Nicolas Goaziou 
Date:   Tue Oct 23 01:32:55 2018 +0200

org-capture: Fix off-by-one error
  
* lisp/org-capture.el (org-capture-place-table-line): Fix narrowing.

produces the error.

emacs-version:
"GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2018-05-29"

org-version:
Org mode version 9.2 (release_9.2-194-g955044 @
/home/thommy/git-emacs/org-mode/lisp/)

Thank you for looking into this.

-- 
Bis neulich ...
  Thomas