emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: org-capture with template for a table
@ 2019-01-16 12:05 Thomas Holst
  2019-01-17 13:51 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Holst @ 2019-01-16 12:05 UTC (permalink / raw)
  To: emacs-orgmode

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 <mail@nicolasgoaziou.fr>
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

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

* Re: Bug: org-capture with template for a table
  2019-01-16 12:05 Bug: org-capture with template for a table Thomas Holst
@ 2019-01-17 13:51 ` Nicolas Goaziou
  2019-01-17 18:56   ` Thomas Holst
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2019-01-17 13:51 UTC (permalink / raw)
  To: Thomas Holst; +Cc: emacs-orgmode

Hello,

Thomas Holst <Thomas_Holst@gmx.de> 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

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

* Re: Bug: org-capture with template for a table
  2019-01-17 13:51 ` Nicolas Goaziou
@ 2019-01-17 18:56   ` Thomas Holst
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Holst @ 2019-01-17 18:56 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

· Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:

> Thomas Holst <Thomas_Holst@gmx.de> 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

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

end of thread, other threads:[~2019-01-17 18:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-16 12:05 Bug: org-capture with template for a table Thomas Holst
2019-01-17 13:51 ` Nicolas Goaziou
2019-01-17 18:56   ` 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).