emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Mathieu Boespflug <mboes@tweag.net>
To: emacs-orgmode@gnu.org
Subject: Bug: org-set-property does not leave the point still [8.1.1 (release_8.1.1-29-gc5f2ae @ /home/mboes/.emacs.d/lisp/org/lisp/)]
Date: Mon, 16 Sep 2013 00:16:22 +0200	[thread overview]
Message-ID: <CAC0Lnfsax03T42tsO8h64AWQVCM1QzAbRQdbRSjsqXyB8oDdew@mail.gmail.com> (raw)

Hi,

consider the following very simple org file:

* TODO Thing1[]

where "[]" marks where the point is. Now if I C-S-RET to insert a new
TODO heading, I get

* TODO Thing1
* TODO []

Note that there is a trailing space at the end of the last line, as
expected. The problem is that if I now press C-c C-x p to set
a property (any property), then I end up with the following situation:

* TODO Thing1
* TODO
  :PROPERTIES:
  :PROP:     val
  :END: []

The point is now at the end of the property drawer, rather than where it
was before. Notice how the trailing whitespace in the heading has
moreover been moved to after the property drawer.

Expected behaviour:

After C-c C-x p, I expect to get:

* TODO Thing1
* TODO []
  :PROPERTIES:
  :PROP:     val
  :END:

This is exactly what I get if there is *no trailing whitespace* in the
TODO heading before hitting C-c C-x p. So it seems that the bug is that
org-set-property does not deal well with trailing whitespace.

This is a problem because it messes up setting properties by advising
org-insert-todo-heading, say to set a CREATED property automatically for
new TODO items.

Emacs  : GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.8.2)
 of 2013-08-07 on -mnt-storage-buildroots-staging-x86_64-eric
Package: Org-mode version 8.1.1 (release_8.1.1-29-gc5f2ae @
/home/mboes/.emacs.d/lisp/org/lisp/)

             reply	other threads:[~2013-09-15 22:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-15 22:16 Mathieu Boespflug [this message]
2013-09-16  6:23 ` Bug: org-set-property does not leave the point still [8.1.1 (release_8.1.1-29-gc5f2ae @ /home/mboes/.emacs.d/lisp/org/lisp/)] Carsten Dominik
2013-09-16  8:11   ` Mathieu Boespflug

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=CAC0Lnfsax03T42tsO8h64AWQVCM1QzAbRQdbRSjsqXyB8oDdew@mail.gmail.com \
    --to=mboes@tweag.net \
    --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).