From mboxrd@z Thu Jan 1 00:00:00 1970 From: Philip Hudson Subject: Bug: Capture template insertion fails with #+FOO [9.1.14 (9.1.14-1-g4931fc-elpa @ /home/phil/.emacs.d/elpa/org-9.1.14/)] Date: Mon, 29 Oct 2018 22:47:23 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHGK2-0002Pb-Hi for emacs-orgmode@gnu.org; Mon, 29 Oct 2018 18:47:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHGJx-0007Uc-MX for emacs-orgmode@gnu.org; Mon, 29 Oct 2018 18:47:46 -0400 Received: from mail-pf1-f180.google.com ([209.85.210.180]:42482) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gHGJx-0007RE-F9 for emacs-orgmode@gnu.org; Mon, 29 Oct 2018 18:47:41 -0400 Received: by mail-pf1-f180.google.com with SMTP id f26-v6so4755156pfn.9 for ; Mon, 29 Oct 2018 15:47:40 -0700 (PDT) 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-mailinglist Remember to cover the basics, that is, what you expected to happen and what in fact did happen. You don't know how to make a good report? See https://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org mailing list. ------------------------------------------------------------------------ Regression in org-capture template handling. I expected my (previously working) org-capture template to be inserted into a newly-created empty Org file. The file name and location are the output of a function specified in the template (sequentially numbered filename). Function `org-capture-insert-template-here' in file org-capture.el now errors if the template specifies that its type is 'entry and it begins with one or more lines of the general form "#+KEY value". The error traces to a call to `org-kill-is-subtree-p', defined in file org.el. Fix (sorry it's not a proper patch): Change line 1399 of org-capture.el from: (org-capture-verify-tree (org-capture-get :template)) to: (org-capture-verify-tree (replace-regexp-in-string "#\+[^\n]*\n" "" template)) (This includes a refactoring-out of that redundant call to `org-capture-get'). NOTE: I have signed the FSF papers. In fact I've made small contributions to Org-mode previously. Emacs : GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.5) of 2017-09-12 on hullmann, modified by Debian Package: Org mode version 9.1.14 (9.1.14-1-g4931fc-elpa @ /home/phil/.emacs.d/elpa/org-9.1.14/) -- Phil Hudson http://hudson-it.ddns.net Pretty Good Privacy (PGP) ID: 0x4E482F85