From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Holst Subject: [bug] in capture Date: Tue, 15 May 2018 19:26:30 +0200 Message-ID: <48ea87ad-0447-72ad-decc-aa4bcf6ec089@gmx.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------68A3B199625599510B711807" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIdig-0006cz-Hj for emacs-orgmode@gnu.org; Tue, 15 May 2018 13:26:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fIdib-0003me-Jg for emacs-orgmode@gnu.org; Tue, 15 May 2018 13:26:38 -0400 Received: from mout.gmx.net ([212.227.15.18]:59203) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fIdib-0003lo-AX for emacs-orgmode@gnu.org; Tue, 15 May 2018 13:26:33 -0400 Received: from [192.168.10.131] ([188.106.40.53]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Ma1Mt-1ezBQO2Awh-00LoBu for ; Tue, 15 May 2018 19:26:31 +0200 Content-Language: de-DE 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@gnu.org This is a multi-part message in MIME format. --------------68A3B199625599510B711807 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi, I encountered a bug in cature (so I think). I have among other the following template: #+begin_src emacs-lisp   ("hr" "Rechnung erfassen" table-line    (file+function "~/git/org-priv/Univ_Beih.org" th:capure-find-open-vers-regn)    "| # | %^u | %^{Arzt/Apotheke} | %^{für wen|Lida|Oleg|Victor|Simon} | %^{Betrag} | %^u | | [[file:%c][link Beleg]] |"    :table-line-pos "III-1" :immediate-finish t) #+end_src With org-mode from git I get an error when using this template: : condition-case: Capture template ‘hr’: integer-or-marker-p With git bisect I found that: ab53ee2c3d3ad8a090823c5f0f22dfd626605b3c is the first bad commit commit ab53ee2c3d3ad8a090823c5f0f22dfd626605b3c Author: Nicolas Goaziou Date:   Mon Apr 30 00:52:57 2018 +0200     org-capture: Fix capturing in a table     * lisp/org-capture.el (org-capture-place-table-line): Rewrite function.     * testing/lisp/test-org-capture.el (test-org-capture/table-line): New       test. :040000 040000 900f436884b24172403ede46422a853f7b4a497c cbb50728eaae22ab234cab05dcda5b53050395df M    lisp :040000 040000 fd8fb9ee8fb1cf0ea3dd4694682932e4c3311a78 f6abcbceb630e8e704bf8b9c3d41ad0d029a5725 M    testing Prior to this commit everything is fine. Was there a change in the syntax I missed? Thanks for looking into this. --   Thomas --------------68A3B199625599510B711807 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Hi,

I encountered a bug in cature (so I think).

I have among other the following template:

#+begin_src emacs-lisp
  ("hr" "Rechnung erfassen" table-line
   (file+function "~/git/org-priv/Univ_Beih.org" th:capure-find-open-vers-regn)
   "| # | %^u | %^{Arzt/Apotheke} | %^{für wen|Lida|Oleg|Victor|Simon} | %^{Betrag} | %^u | | [[file:%c][link Beleg]] |"
   :table-line-pos "III-1" :immediate-finish t)
#+end_src

With org-mode from git I get an error when using this template:

: condition-case: Capture template ‘hr’: integer-or-marker-p

With git bisect I found that:

ab53ee2c3d3ad8a090823c5f0f22dfd626605b3c is the first bad commit
commit ab53ee2c3d3ad8a090823c5f0f22dfd626605b3c
Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Date:   Mon Apr 30 00:52:57 2018 +0200

    org-capture: Fix capturing in a table
   
    * lisp/org-capture.el (org-capture-place-table-line): Rewrite function.
    * testing/lisp/test-org-capture.el (test-org-capture/table-line): New
      test.

:040000 040000 900f436884b24172403ede46422a853f7b4a497c cbb50728eaae22ab234cab05dcda5b53050395df M    lisp
:040000 040000 fd8fb9ee8fb1cf0ea3dd4694682932e4c3311a78 f6abcbceb630e8e704bf8b9c3d41ad0d029a5725 M    testing

Prior to this commit everything is fine.

Was there a change in the syntax I missed?

Thanks for looking into this.

--
  Thomas


--------------68A3B199625599510B711807-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [bug] in capture Date: Wed, 16 May 2018 21:55:15 +0200 Message-ID: <87fu2rtly4.fsf@nicolasgoaziou.fr> References: <48ea87ad-0447-72ad-decc-aa4bcf6ec089@gmx.de> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJ2WF-000534-Rf for emacs-orgmode@gnu.org; Wed, 16 May 2018 15:55:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fJ2WD-0001KB-05 for emacs-orgmode@gnu.org; Wed, 16 May 2018 15:55:27 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:47055) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fJ2WC-0001Ft-OV for emacs-orgmode@gnu.org; Wed, 16 May 2018 15:55:24 -0400 In-Reply-To: <48ea87ad-0447-72ad-decc-aa4bcf6ec089@gmx.de> (Thomas Holst's message of "Tue, 15 May 2018 19:26:30 +0200") 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: Thomas Holst Cc: emacs-orgmode@gnu.org Hello, Thomas Holst writes: > I have among other the following template: > > #+begin_src emacs-lisp > ("hr" "Rechnung erfassen" table-line >   (file+function "~/git/org-priv/Univ_Beih.org" > th:capure-find-open-vers-regn) >   "| # | %^u | %^{Arzt/Apotheke} | %^{fr wen|Lida|Oleg|Victor|Simon} > | %^{Betrag} | %^u | | [[file:%c][link Beleg]] |" >   :table-line-pos "III-1" :immediate-finish t) > #+end_src > > With org-mode from git I get an error when using this template: > > : condition-case: Capture template ‘hr’: integer-or-marker-p I have too little information to reproduce the problem. Could you provide a minimal example, i.e., no custom function like `th:capure-find-open-vers-regn' and a minimal document where this table line is going to be inserted. Also, I would need the backtrace. Thank you. > Was there a change in the syntax I missed? No, there wasn't. Regards, -- Nicolas Goaziou From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Holst Subject: Re: [bug] in capture Date: Thu, 17 May 2018 19:17:34 +0200 Message-ID: References: <48ea87ad-0447-72ad-decc-aa4bcf6ec089@gmx.de> <87fu2rtly4.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------D0C89D2B6FEA1C021CEBC3BC" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45056) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJMXB-0001Yd-Or for emacs-orgmode@gnu.org; Thu, 17 May 2018 13:17:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fJMX6-0004hc-K5 for emacs-orgmode@gnu.org; Thu, 17 May 2018 13:17:45 -0400 Received: from mout.gmx.net ([212.227.17.20]:45129) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fJMX6-0004gz-5P for emacs-orgmode@gnu.org; Thu, 17 May 2018 13:17:40 -0400 In-Reply-To: <87fu2rtly4.fsf@nicolasgoaziou.fr> Content-Language: de-DE 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: Nicolas Goaziou Cc: emacs-orgmode@gnu.org This is a multi-part message in MIME format. --------------D0C89D2B6FEA1C021CEBC3BC Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi Nicolas, thank you for looking into this. To reproduce the error I have to use file+function target. There is no error if I use file+headline target. Here is an ECM: #+begin_src org * Setup #+begin_src emacs-lisp   (setq org-capture-template nil)   (setq    org-capture-templates    '(("x" "Testing" table-line (file+function "~/tmp/capture-bug/ecm.org" th:test-capture)     "|  |  | %^{Arzt/Apotheke} |"     :table-line-pos "III-1" :immediate-finish t)))   (defun th:test-capture ()     "Sets point to headline"     (interactive)     (goto-char (point-min))     (org-speed-move-safe (quote org-next-visible-heading))) #+end_src * testing capture |---+-----------------+------| | ! | Datum           | Arzt | |---+-----------------+------| |   |                 |      | |---+-----------------+------| | # |                 |      | |---+-----------------+------| #+end_src The function "th:test-capture" sets point to beginning of headline "testing capture". I experimented with several point positions (end of the headline, line below headline). But none worked. The error stayed the same. And here is the backtrace: Debugger entered--Lisp error: (error "Capture template ‘hr’: integer-or-marker-p")   signal(error ("Capture template ‘hr’: integer-or-marker-p"))   error("Capture template `%s': %s" "hr" integer-or-marker-p)   (condition-case error (org-capture-place-template (eq (car (org-capture-get :target)) (quote function))) ((error quit) (if (and (buffer-base-buffer (current-buffer)) (string-prefix-p "CAPTURE-" (buffer-name))) (kill-buffer (current-buffer))) (set-window-configuration (org-capture-get :return-to-wconf)) (error "Capture template `%s': %s" (org-capture-get :key) (nth 1 error))))   (if (equal goto 0) (org-capture-insert-template-here) (condition-case error (org-capture-place-template (eq (car (org-capture-get :target)) (quote function))) ((error quit) (if (and (buffer-base-buffer (current-buffer)) (string-prefix-p "CAPTURE-" (buffer-name))) (kill-buffer (current-buffer))) (set-window-configuration (org-capture-get :return-to-wconf)) (error "Capture template `%s': %s" (org-capture-get :key) (nth 1 error)))) (if (and (derived-mode-p (quote org-mode)) (org-capture-get :clock-in)) (condition-case nil (progn (if (org-clock-is-active) (org-capture-put :interrupted-clock (copy-marker org-clock-marker))) (org-clock-in) (set (make-local-variable (quote org-capture-clock-was-started)) t)) (error "Could not start the clock in this capture buffer"))) (if (org-capture-get :immediate-finish) (org-capture-finalize)))   (cond ((equal entry "C") (customize-variable (quote org-capture-templates))) ((equal entry "q") (user-error "Abort")) (t (org-capture-set-plist entry) (org-capture-get-template) (org-capture-put :original-buffer orig-buf :original-file (or (buffer-file-name orig-buf) (and (featurep (quote dired)) (car (rassq orig-buf dired-buffers)))) :original-file-nondirectory (and (buffer-file-name orig-buf) (file-name-nondirectory (buffer-file-name orig-buf))) :annotation annotation :initial initial :return-to-wconf (current-window-configuration) :default-time (or org-overriding-default-time (org-current-time))) (org-capture-set-target-location) (condition-case error (org-capture-put :template (org-capture-fill-template)) ((error quit) (if (get-buffer "*Capture*") (kill-buffer "*Capture*")) (error "Capture abort: %s" error))) (setq org-capture-clock-keep (org-capture-get :clock-keep)) (if (equal goto 0) (org-capture-insert-template-here) (condition-case error (org-capture-place-template (eq (car (org-capture-get :target)) (quote function))) ((error quit) (if (and (buffer-base-buffer ...) (string-prefix-p "CAPTURE-" ...)) (kill-buffer (current-buffer))) (set-window-configuration (org-capture-get :return-to-wconf)) (error "Capture template `%s': %s" (org-capture-get :key) (nth 1 error)))) (if (and (derived-mode-p (quote org-mode)) (org-capture-get :clock-in)) (condition-case nil (progn (if (org-clock-is-active) (org-capture-put :interrupted-clock ...)) (org-clock-in) (set (make-local-variable ...) t)) (error "Could not start the clock in this capture buffer"))) (if (org-capture-get :immediate-finish) (org-capture-finalize)))))   (let* ((orig-buf (current-buffer)) (annotation (if (and (boundp (quote org-capture-link-is-already-stored)) org-capture-link-is-already-stored) (plist-get org-store-link-plist :annotation) (condition-case nil (progn (org-store-link nil)) (error nil)))) (entry (or org-capture-entry (org-capture-select-template keys))) initial) (setq initial (or org-capture-initial (and (org-region-active-p) (buffer-substring (point) (mark))))) (if (stringp initial) (progn (remove-text-properties 0 (length initial) (quote (read-only t)) initial))) (if (stringp annotation) (progn (remove-text-properties 0 (length annotation) (quote (read-only t)) annotation))) (cond ((equal entry "C") (customize-variable (quote org-capture-templates))) ((equal entry "q") (user-error "Abort")) (t (org-capture-set-plist entry) (org-capture-get-template) (org-capture-put :original-buffer orig-buf :original-file (or (buffer-file-name orig-buf) (and (featurep (quote dired)) (car (rassq orig-buf dired-buffers)))) :original-file-nondirectory (and (buffer-file-name orig-buf) (file-name-nondirectory (buffer-file-name orig-buf))) :annotation annotation :initial initial :return-to-wconf (current-window-configuration) :default-time (or org-overriding-default-time (org-current-time))) (org-capture-set-target-location) (condition-case error (org-capture-put :template (org-capture-fill-template)) ((error quit) (if (get-buffer "*Capture*") (kill-buffer "*Capture*")) (error "Capture abort: %s" error))) (setq org-capture-clock-keep (org-capture-get :clock-keep)) (if (equal goto 0) (org-capture-insert-template-here) (condition-case error (org-capture-place-template (eq (car ...) (quote function))) ((error quit) (if (and ... ...) (kill-buffer ...)) (set-window-configuration (org-capture-get :return-to-wconf)) (error "Capture template `%s': %s" (org-capture-get :key) (nth 1 error)))) (if (and (derived-mode-p (quote org-mode)) (org-capture-get :clock-in)) (condition-case nil (progn (if ... ...) (org-clock-in) (set ... t)) (error "Could not start the clock in this capture buffer"))) (if (org-capture-get :immediate-finish) (org-capture-finalize))))))   (cond ((equal goto (quote (4))) (org-capture-goto-target)) ((equal goto (quote (16))) (org-capture-goto-last-stored)) (t (let* ((orig-buf (current-buffer)) (annotation (if (and (boundp ...) org-capture-link-is-already-stored) (plist-get org-store-link-plist :annotation) (condition-case nil (progn ...) (error nil)))) (entry (or org-capture-entry (org-capture-select-template keys))) initial) (setq initial (or org-capture-initial (and (org-region-active-p) (buffer-substring (point) (mark))))) (if (stringp initial) (progn (remove-text-properties 0 (length initial) (quote (read-only t)) initial))) (if (stringp annotation) (progn (remove-text-properties 0 (length annotation) (quote (read-only t)) annotation))) (cond ((equal entry "C") (customize-variable (quote org-capture-templates))) ((equal entry "q") (user-error "Abort")) (t (org-capture-set-plist entry) (org-capture-get-template) (org-capture-put :original-buffer orig-buf :original-file (or (buffer-file-name orig-buf) (and ... ...)) :original-file-nondirectory (and (buffer-file-name orig-buf) (file-name-nondirectory ...)) :annotation annotation :initial initial :return-to-wconf (current-window-configuration) :default-time (or org-overriding-default-time (org-current-time))) (org-capture-set-target-location) (condition-case error (org-capture-put :template (org-capture-fill-template)) ((error quit) (if ... ...) (error "Capture abort: %s" error))) (setq org-capture-clock-keep (org-capture-get :clock-keep)) (if (equal goto 0) (org-capture-insert-template-here) (condition-case error (org-capture-place-template ...) (... ... ... ...)) (if (and ... ...) (condition-case nil ... ...)) (if (org-capture-get :immediate-finish) (org-capture-finalize))))))))   org-capture(nil)   funcall-interactively(org-capture nil)   #(org-capture nil nil)   apply(# org-capture (nil nil))   call-interactively@ido-cr+-record-current-command(# org-capture nil nil)   apply(call-interactively@ido-cr+-record-current-command # (org-capture nil nil))   call-interactively(org-capture nil nil)   command-execute(org-capture) --   Thomas Am 16.05.2018 um 21:55 schrieb Nicolas Goaziou: > Hello, > > Thomas Holst writes: > >> I have among other the following template: >> >> #+begin_src emacs-lisp >> ("hr" "Rechnung erfassen" table-line >> � (file+function "~/git/org-priv/Univ_Beih.org" >> th:capure-find-open-vers-regn) >> � "| # | %^u | %^{Arzt/Apotheke} | %^{fr wen|Lida|Oleg|Victor|Simon} >> | %^{Betrag} | %^u | | [[file:%c][link Beleg]] |" >> � :table-line-pos "III-1" :immediate-finish t) >> #+end_src >> >> With org-mode from git I get an error when using this template: >> >> : condition-case: Capture template ‘hr’: integer-or-marker-p > I have too little information to reproduce the problem. > > Could you provide a minimal example, i.e., no custom function like > `th:capure-find-open-vers-regn' and a minimal document where this table > line is going to be inserted. > > Also, I would need the backtrace. > > Thank you. > >> Was there a change in the syntax I missed? > No, there wasn't. > > Regards, > --------------D0C89D2B6FEA1C021CEBC3BC Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Hi Nicolas,

thank you for looking into this.

To reproduce the error I have to use file+function target. There is no error if I use file+headline target.

Here is an ECM:

#+begin_src org
* Setup

#+begin_src emacs-lisp
  (setq org-capture-template nil)

  (setq
   org-capture-templates
   '(("x" "Testing" table-line (file+function "~/tmp/capture-bug/ecm.org" th:test-capture)
    "|  |  | %^{Arzt/Apotheke} |"
    :table-line-pos "III-1" :immediate-finish t)))

  (defun th:test-capture ()
    "Sets point to headline"
    (interactive)
    (goto-char (point-min))
    (org-speed-move-safe (quote org-next-visible-heading)))
#+end_src

* testing capture
|---+-----------------+------|
| ! | Datum           | Arzt |
|---+-----------------+------|
|   |                 |      |
|---+-----------------+------|
| # |                 |      |
|---+-----------------+------|
#+end_src

The function "th:test-capture" sets point to beginning of headline "testing capture".

I experimented with several point positions (end of the headline, line below headline). But none worked. The error stayed the same.

And here is the backtrace:
Debugger entered--Lisp error: (error "Capture template ‘hr’: integer-or-marker-p")
  signal(error ("Capture template ‘hr’: integer-or-marker-p"))
  error("Capture template `%s': %s" "hr" integer-or-marker-p)
  (condition-case error (org-capture-place-template (eq (car (org-capture-get :target)) (quote function))) ((error quit) (if (and (buffer-base-buffer (current-buffer)) (string-prefix-p "CAPTURE-" (buffer-name))) (kill-buffer (current-buffer))) (set-window-configuration (org-capture-get :return-to-wconf)) (error "Capture template `%s': %s" (org-capture-get :key) (nth 1 error))))
  (if (equal goto 0) (org-capture-insert-template-here) (condition-case error (org-capture-place-template (eq (car (org-capture-get :target)) (quote function))) ((error quit) (if (and (buffer-base-buffer (current-buffer)) (string-prefix-p "CAPTURE-" (buffer-name))) (kill-buffer (current-buffer))) (set-window-configuration (org-capture-get :return-to-wconf)) (error "Capture template `%s': %s" (org-capture-get :key) (nth 1 error)))) (if (and (derived-mode-p (quote org-mode)) (org-capture-get :clock-in)) (condition-case nil (progn (if (org-clock-is-active) (org-capture-put :interrupted-clock (copy-marker org-clock-marker))) (org-clock-in) (set (make-local-variable (quote org-capture-clock-was-started)) t)) (error "Could not start the clock in this capture buffer"))) (if (org-capture-get :immediate-finish) (org-capture-finalize)))
  (cond ((equal entry "C") (customize-variable (quote org-capture-templates))) ((equal entry "q") (user-error "Abort")) (t (org-capture-set-plist entry) (org-capture-get-template) (org-capture-put :original-buffer orig-buf :original-file (or (buffer-file-name orig-buf) (and (featurep (quote dired)) (car (rassq orig-buf dired-buffers)))) :original-file-nondirectory (and (buffer-file-name orig-buf) (file-name-nondirectory (buffer-file-name orig-buf))) :annotation annotation :initial initial :return-to-wconf (current-window-configuration) :default-time (or org-overriding-default-time (org-current-time))) (org-capture-set-target-location) (condition-case error (org-capture-put :template (org-capture-fill-template)) ((error quit) (if (get-buffer "*Capture*") (kill-buffer "*Capture*")) (error "Capture abort: %s" error))) (setq org-capture-clock-keep (org-capture-get :clock-keep)) (if (equal goto 0) (org-capture-insert-template-here) (condition-case error (org-capture-place-template (eq (car (org-capture-get :target)) (quote function))) ((error quit) (if (and (buffer-base-buffer ...) (string-prefix-p "CAPTURE-" ...)) (kill-buffer (current-buffer))) (set-window-configuration (org-capture-get :return-to-wconf)) (error "Capture template `%s': %s" (org-capture-get :key) (nth 1 error)))) (if (and (derived-mode-p (quote org-mode)) (org-capture-get :clock-in)) (condition-case nil (progn (if (org-clock-is-active) (org-capture-put :interrupted-clock ...)) (org-clock-in) (set (make-local-variable ...) t)) (error "Could not start the clock in this capture buffer"))) (if (org-capture-get :immediate-finish) (org-capture-finalize)))))
  (let* ((orig-buf (current-buffer)) (annotation (if (and (boundp (quote org-capture-link-is-already-stored)) org-capture-link-is-already-stored) (plist-get org-store-link-plist :annotation) (condition-case nil (progn (org-store-link nil)) (error nil)))) (entry (or org-capture-entry (org-capture-select-template keys))) initial) (setq initial (or org-capture-initial (and (org-region-active-p) (buffer-substring (point) (mark))))) (if (stringp initial) (progn (remove-text-properties 0 (length initial) (quote (read-only t)) initial))) (if (stringp annotation) (progn (remove-text-properties 0 (length annotation) (quote (read-only t)) annotation))) (cond ((equal entry "C") (customize-variable (quote org-capture-templates))) ((equal entry "q") (user-error "Abort")) (t (org-capture-set-plist entry) (org-capture-get-template) (org-capture-put :original-buffer orig-buf :original-file (or (buffer-file-name orig-buf) (and (featurep (quote dired)) (car (rassq orig-buf dired-buffers)))) :original-file-nondirectory (and (buffer-file-name orig-buf) (file-name-nondirectory (buffer-file-name orig-buf))) :annotation annotation :initial initial :return-to-wconf (current-window-configuration) :default-time (or org-overriding-default-time (org-current-time))) (org-capture-set-target-location) (condition-case error (org-capture-put :template (org-capture-fill-template)) ((error quit) (if (get-buffer "*Capture*") (kill-buffer "*Capture*")) (error "Capture abort: %s" error))) (setq org-capture-clock-keep (org-capture-get :clock-keep)) (if (equal goto 0) (org-capture-insert-template-here) (condition-case error (org-capture-place-template (eq (car ...) (quote function))) ((error quit) (if (and ... ...) (kill-buffer ...)) (set-window-configuration (org-capture-get :return-to-wconf)) (error "Capture template `%s': %s" (org-capture-get :key) (nth 1 error)))) (if (and (derived-mode-p (quote org-mode)) (org-capture-get :clock-in)) (condition-case nil (progn (if ... ...) (org-clock-in) (set ... t)) (error "Could not start the clock in this capture buffer"))) (if (org-capture-get :immediate-finish) (org-capture-finalize))))))
  (cond ((equal goto (quote (4))) (org-capture-goto-target)) ((equal goto (quote (16))) (org-capture-goto-last-stored)) (t (let* ((orig-buf (current-buffer)) (annotation (if (and (boundp ...) org-capture-link-is-already-stored) (plist-get org-store-link-plist :annotation) (condition-case nil (progn ...) (error nil)))) (entry (or org-capture-entry (org-capture-select-template keys))) initial) (setq initial (or org-capture-initial (and (org-region-active-p) (buffer-substring (point) (mark))))) (if (stringp initial) (progn (remove-text-properties 0 (length initial) (quote (read-only t)) initial))) (if (stringp annotation) (progn (remove-text-properties 0 (length annotation) (quote (read-only t)) annotation))) (cond ((equal entry "C") (customize-variable (quote org-capture-templates))) ((equal entry "q") (user-error "Abort")) (t (org-capture-set-plist entry) (org-capture-get-template) (org-capture-put :original-buffer orig-buf :original-file (or (buffer-file-name orig-buf) (and ... ...)) :original-file-nondirectory (and (buffer-file-name orig-buf) (file-name-nondirectory ...)) :annotation annotation :initial initial :return-to-wconf (current-window-configuration) :default-time (or org-overriding-default-time (org-current-time))) (org-capture-set-target-location) (condition-case error (org-capture-put :template (org-capture-fill-template)) ((error quit) (if ... ...) (error "Capture abort: %s" error))) (setq org-capture-clock-keep (org-capture-get :clock-keep)) (if (equal goto 0) (org-capture-insert-template-here) (condition-case error (org-capture-place-template ...) (... ... ... ...)) (if (and ... ...) (condition-case nil ... ...)) (if (org-capture-get :immediate-finish) (org-capture-finalize))))))))
  org-capture(nil)
  funcall-interactively(org-capture nil)
  #<subr call-interactively>(org-capture nil nil)
  apply(#<subr call-interactively> org-capture (nil nil))
  call-interactively@ido-cr+-record-current-command(#<subr call-interactively> org-capture nil nil)
  apply(call-interactively@ido-cr+-record-current-command #<subr call-interactively> (org-capture nil nil))
  call-interactively(org-capture nil nil)
  command-execute(org-capture)

--
  Thomas


Am 16.05.2018 um 21:55 schrieb Nicolas Goaziou:
Hello,

Thomas Holst <thomas_holst@gmx.de> writes:

I have among other the following template:

#+begin_src emacs-lisp
  ("hr" "Rechnung erfassen" table-line
 � (file+function "~/git/org-priv/Univ_Beih.org" 
th:capure-find-open-vers-regn)
 � "| # | %^u | %^{Arzt/Apotheke} | %^{fr wen|Lida|Oleg|Victor|Simon} 
| %^{Betrag} | %^u | | [[file:%c][link Beleg]] |"
 � :table-line-pos "III-1" :immediate-finish t)
#+end_src

With org-mode from git I get an error when using this template:

: condition-case: Capture template ‘hr’: integer-or-marker-p
I have too little information to reproduce the problem.

Could you provide a minimal example, i.e., no custom function like
`th:capure-find-open-vers-regn' and a minimal document where this table
line is going to be inserted.

Also, I would need the backtrace.

Thank you.

Was there a change in the syntax I missed?
No, there wasn't.

Regards,


--------------D0C89D2B6FEA1C021CEBC3BC-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [bug] in capture Date: Thu, 17 May 2018 23:01:11 +0200 Message-ID: <87o9heq9ns.fsf@nicolasgoaziou.fr> References: <48ea87ad-0447-72ad-decc-aa4bcf6ec089@gmx.de> <87fu2rtly4.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59447) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJQ1Z-0004Ie-QL for emacs-orgmode@gnu.org; Thu, 17 May 2018 17:01:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fJQ1V-0004h4-Vg for emacs-orgmode@gnu.org; Thu, 17 May 2018 17:01:21 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:42881) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fJQ1V-0004ep-Or for emacs-orgmode@gnu.org; Thu, 17 May 2018 17:01:17 -0400 In-Reply-To: (Thomas Holst's message of "Thu, 17 May 2018 19:17:34 +0200") 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: Thomas Holst Cc: emacs-orgmode@gnu.org Hello, Thomas Holst writes: > Hi Nicolas, > > thank you for looking into this. > > To reproduce the error I have to use file+function target. There is no=20 > error if I use file+headline target. > > Here is an ECM: > > #+begin_src org > * Setup > > #+begin_src emacs-lisp > (setq org-capture-template nil) > > (setq > org-capture-templates > '(("x" "Testing" table-line (file+function=20 > "~/tmp/capture-bug/ecm.org" th:test-capture) > "| | | %^{Arzt/Apotheke} |" > :table-line-pos "III-1" :immediate-finish t))) > > (defun th:test-capture () > "Sets point to headline" > (interactive) > (goto-char (point-min)) > (org-speed-move-safe (quote org-next-visible-heading))) > #+end_src > > * testing capture > |---+-----------------+------| > | ! | Datum=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |= Arzt | > |---+-----------------+------| > |=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | > |---+-----------------+------| > | # |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | > |---+-----------------+------| > #+end_src > > The function "th:test-capture" sets point to beginning of headline=20 > "testing capture". > > I experimented with several point positions (end of the headline, line=20 > below headline). But none worked. The error stayed the same. > > And here is the backtrace: > Debugger entered--Lisp error: (error "Capture template =E2=80=98hr=E2=80= =99:=20 > integer-or-marker-p") Fixed. Thank you. Regards, --=20 Nicolas Goaziou 0x80A93738 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Holst Subject: Re: [bug] in capture Date: Mon, 21 May 2018 22:23:22 +0200 Message-ID: <06c18ff7-f8d5-4b39-2701-dd816da594e7@gmx.de> References: <48ea87ad-0447-72ad-decc-aa4bcf6ec089@gmx.de> <87fu2rtly4.fsf@nicolasgoaziou.fr> <87o9heq9ns.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------BA08E87A676871299AA53A50" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fKrL9-0002eV-9g for emacs-orgmode@gnu.org; Mon, 21 May 2018 16:23:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fKrL4-0000MZ-B2 for emacs-orgmode@gnu.org; Mon, 21 May 2018 16:23:31 -0400 Received: from mout.gmx.net ([212.227.17.21]:36265) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fKrL3-0000M5-Vw for emacs-orgmode@gnu.org; Mon, 21 May 2018 16:23:26 -0400 In-Reply-To: <87o9heq9ns.fsf@nicolasgoaziou.fr> Content-Language: de-DE 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: Nicolas Goaziou Cc: emacs-orgmode@gnu.org This is a multi-part message in MIME format. --------------BA08E87A676871299AA53A50 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hello Nicolas, thank you for fixing this. I can confirm that my capture template is working again. --   Thomas Am 17.05.2018 um 23:01 schrieb Nicolas Goaziou: > Hello, > > Thomas Holst writes: > >> Hi Nicolas, >> >> thank you for looking into this. >> >> To reproduce the error I have to use file+function target. There is no >> error if I use file+headline target. >> >> Here is an ECM: >> >> #+begin_src org >> * Setup >> >> #+begin_src emacs-lisp >> (setq org-capture-template nil) >> >> (setq >> org-capture-templates >> '(("x" "Testing" table-line (file+function >> "~/tmp/capture-bug/ecm.org" th:test-capture) >> "| | | %^{Arzt/Apotheke} |" >> :table-line-pos "III-1" :immediate-finish t))) >> >> (defun th:test-capture () >> "Sets point to headline" >> (interactive) >> (goto-char (point-min)) >> (org-speed-move-safe (quote org-next-visible-heading))) >> #+end_src >> >> * testing capture >> |---+-----------------+------| >> | ! | Datum           | Arzt | >> |---+-----------------+------| >> |   |                 |      | >> |---+-----------------+------| >> | # |                 |      | >> |---+-----------------+------| >> #+end_src >> >> The function "th:test-capture" sets point to beginning of headline >> "testing capture". >> >> I experimented with several point positions (end of the headline, line >> below headline). But none worked. The error stayed the same. >> >> And here is the backtrace: >> Debugger entered--Lisp error: (error "Capture template ‘hr’: >> integer-or-marker-p") > Fixed. Thank you. > > Regards, > --------------BA08E87A676871299AA53A50 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Hello Nicolas,

thank you for fixing this. I can confirm that my capture template is working again.

--
  Thomas


Am 17.05.2018 um 23:01 schrieb Nicolas Goaziou:
Hello,

Thomas Holst <thomas_holst@gmx.de> writes:

Hi Nicolas,

thank you for looking into this.

To reproduce the error I have to use file+function target. There is no 
error if I use file+headline target.

Here is an ECM:

#+begin_src org
* Setup

#+begin_src emacs-lisp
  (setq org-capture-template nil)

  (setq
  org-capture-templates
  '(("x" "Testing" table-line (file+function 
"~/tmp/capture-bug/ecm.org" th:test-capture)
  "| | | %^{Arzt/Apotheke} |"
  :table-line-pos "III-1" :immediate-finish t)))

  (defun th:test-capture ()
  "Sets point to headline"
  (interactive)
  (goto-char (point-min))
  (org-speed-move-safe (quote org-next-visible-heading)))
#+end_src

* testing capture
|---+-----------------+------|
| ! | Datum           | Arzt |
|---+-----------------+------|
|   |                 |      |
|---+-----------------+------|
| # |                 |      |
|---+-----------------+------|
#+end_src

The function "th:test-capture" sets point to beginning of headline 
"testing capture".

I experimented with several point positions (end of the headline, line 
below headline). But none worked. The error stayed the same.

And here is the backtrace:
Debugger entered--Lisp error: (error "Capture template ‘hr’: 
integer-or-marker-p")
Fixed. Thank you.

Regards,


--------------BA08E87A676871299AA53A50--