emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Thomas Holst
Subject: [O] Bug: org-capture with template for a table
Date: Wed, 16 Jan 2019 13:05:21 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

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(@address@hidden);%.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(@address@hidden);%.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 <address@hidden>
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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]