From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Groth Subject: Bug: Capturing an entry without final endline modifies heading structure [9.1.14 (9.1.14-dist @ /usr/share/emacs/25.2/site-lisp/elpa/org-9.1.11/)] Date: Sun, 02 Sep 2018 13:14:50 +0200 Message-ID: <87bm9gb1f5.fsf@grothesque.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fwQjA-0005lA-Fi for emacs-orgmode@gnu.org; Sun, 02 Sep 2018 07:39:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fwQix-0008W4-IR for emacs-orgmode@gnu.org; Sun, 02 Sep 2018 07:39:32 -0400 Received: from mailrelay4.webfaction.com ([185.20.51.6]:40786) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fwQit-0008Qd-Pz for emacs-orgmode@gnu.org; Sun, 02 Sep 2018 07:39:23 -0400 Received: from mailrelay3.webfaction.com (mailrelay3.webfaction.com [207.38.93.110]) by mailrelay4.webfaction.com (Postfix) with ESMTPS id BCC297EBE2 for ; Sun, 2 Sep 2018 11:27:57 +0000 (UTC) Received: from mailrelay2.webfaction.com (mailrelay2.webfaction.com [185.20.50.247]) by mailrelay3.webfaction.com (Postfix) with ESMTPS id 33D2828698A for ; Sun, 2 Sep 2018 11:17:20 +0000 (UTC) Received: from smtp.webfaction.com (mail6.webfaction.com [31.170.123.134]) by mailrelay2.webfaction.com (Postfix) with ESMTPS id B9DED40B41 for ; Sun, 2 Sep 2018 11:15:23 +0000 (UTC) Received: from localhost (s8s38-1-88-180-226-12.fbx.proxad.net [88.180.226.12]) by smtp.webfaction.com (Postfix) with ESMTPSA id A556E600738F1 for ; Sun, 2 Sep 2018 11:14:43 +0000 (UTC) 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 Hello, I'm using org's capture functionality to file new entries for my agenda. I noticed a problem when capturing entries to be placed in the middle of a file (for example, I have a subtree for "notes" that comes before "miscellaneous"): when the captured text ends without a trailing endline character, it will be inserted as such into the org file and thus modify the overall heading structure. For example, inserting a note may lead to the following situation: ** Note without trailing endline [2018-09-02 Sun 13:10] example text* miscellaneous IMHO this qualifies as a bug, because it's easy to accidentally corrupt the heading structure of a file. Cheers, Christoph Emacs : GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2018-07-11, modified by Debian Package: Org mode version 9.1.14 (9.1.14-dist @ /usr/share/emacs/25.2/site-lisp/elpa/org-9.1.11/) current state (relevant excerpt): ================================ (setq org-capture-templates '(("u" "unscheduled" entry (file+headline "" "miscellaneous") "* TODO %?\n%U") ("U" "" entry (file+headline "" "miscellaneous") "* TODO %?\n%a\n%U") ("s" "scheduled" entry (file+headline "" "miscellaneous") "* TODO %?\nSCHEDULED: %^t\n%U") ("S" "" entry (file+headline "" "miscellaneous") "* TODO %?\nSCHEDULED: %^t\n%a\n%U") ("m" "maybe" entry (file+headline "" "miscellaneous") "* MAYBE %?\n%U") ("M" "" entry (file+headline "" "miscellaneous") "* MAYBE %?\n%a\n%U") ("d" "deadline" entry (file+headline "" "miscellaneous") "* TODO %?\nDEADLINE: %^t\n%U") ("D" "" entry (file+headline "" "miscellaneous") "* TODO %?\nDEADLINE: %^t\n%a\n%U") ("a" "appointment" entry (file+headline "" "miscellaneous") "* %?\n%^t\n%U") ("A" "" entry (file+headline "" "miscellaneous") "* %?\n%^t\n%a\n%U") ("r" "reply" entry (file+headline "" "miscellaneous") "* TODO Reply to %:fromname%?\nSCHEDULED: %^t\n%a\n%U") ("n" "note" entry (file+headline "" "notes") "* %?\n%U") ("i" "interruption" entry (file+headline "" "interruptions") "* %? :work:\n%U" :clock-in t :clock-resume t) ) )