emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Christoph Groth <christoph@grothesque.org>
To: emacs-orgmode@gnu.org
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	[thread overview]
Message-ID: <87bm9gb1f5.fsf@grothesque.org> (raw)

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

                 reply	other threads:[~2018-09-02 11:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bm9gb1f5.fsf@grothesque.org \
    --to=christoph@grothesque.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).