From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Holst Subject: Bug: org-capture with template for a table Date: Wed, 16 Jan 2019 13:05:21 +0100 Message-ID: <87zhs0n6ym@boerne> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([209.51.188.92]:59604) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjjx5-0002VQ-Lz for emacs-orgmode@gnu.org; Wed, 16 Jan 2019 07:05:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gjjx4-00040j-J2 for emacs-orgmode@gnu.org; Wed, 16 Jan 2019 07:05:47 -0500 Received: from mout.gmx.net ([212.227.15.19]:53989) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gjjx4-0003iX-3A for emacs-orgmode@gnu.org; Wed, 16 Jan 2019 07:05:46 -0500 Received: from boerne ([188.106.148.13]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MHX0m-1ggQZ91apg-003MCA for ; Wed, 16 Jan 2019 13:05:43 +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" 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 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