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) ) )