From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Boespflug 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 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]:56824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLKcU-0004LJ-4d for emacs-orgmode@gnu.org; Sun, 15 Sep 2013 18:16:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VLKcO-00010n-4x for emacs-orgmode@gnu.org; Sun, 15 Sep 2013 18:16:42 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:40725) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLKcN-00010h-V5 for emacs-orgmode@gnu.org; Sun, 15 Sep 2013 18:16:36 -0400 Received: from mail-ob0-x22c.google.com (mail-ob0-x22c.google.com [IPv6:2607:f8b0:4003:c01::22c]) (Authenticated sender: mboes@tweag.net) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id B0F60A80B8 for ; Mon, 16 Sep 2013 00:16:23 +0200 (CEST) Received: by mail-ob0-f172.google.com with SMTP id gq1so3134175obb.3 for ; Sun, 15 Sep 2013 15:16:22 -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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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/)