emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Fix org-entry-put (trouble with org-columns-edit-value)
@ 2012-11-06 19:48 Takafumi Arakaki
  2012-11-09  8:58 ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Takafumi Arakaki @ 2012-11-06 19:48 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 789 bytes --]

I have a trouble with org-columns-edit-value; updating property using
this command breaks property formatting.

If I update MyProp_B in,

   :PROPERTIES:
   :MyProp_A: a
   :MyProp_B: b
   :END:

I end up with:

   :PROPERTIES:
   :MyProp_A: :MyProp_B: x a

   :END:


I found that (match-beginning 0) returns different value after
(delete-region (match-beginning 0) (match-end 0)).  The strange thing
is that I could not reproduce it in "plain" Emacs without loading my
init.el.

I am using a few week older version from Emacs trunk.
emacs-version: "24.2.50.1"
emacs-bzr-version: "110740 rgm@gnu.org-20121030101856-aimepc487hfjuqqs"


I will try to reproduce the bug after updating Emacs (probably to the
24.3 release branch) and org-mode later.  But I thought I'd share the
patch first.

[-- Attachment #2: org-entry-put.patch --]
[-- Type: application/octet-stream, Size: 563 bytes --]

diff --git a/lisp/org.el b/lisp/org.el
index 2d2615f..dd03aeb 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -14765,9 +14765,10 @@ and the new value.")
 	  (goto-char (car range))
 	  (if (re-search-forward
 	       (org-re-property-keyword property) (cdr range) t)
-	      (progn
-		(delete-region (match-beginning 0) (match-end 0))
-		(goto-char (match-beginning 0)))
+	      (let ((mbeg (match-beginning 0))
+		    (mend (match-end 0)))
+		(delete-region mbeg mend)
+		(goto-char mbeg))
 	    (goto-char (cdr range))
 	    (insert "\n")
 	    (backward-char 1)

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-12-07 10:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-06 19:48 [PATCH] Fix org-entry-put (trouble with org-columns-edit-value) Takafumi Arakaki
2012-11-09  8:58 ` Nicolas Goaziou
2012-11-09 13:08   ` Takafumi Arakaki
2012-11-09 13:25     ` Nicolas Goaziou
2012-11-09 14:34       ` Takafumi Arakaki
2012-12-02  4:52         ` Takafumi Arakaki
2012-12-02  8:39           ` Nicolas Goaziou
2012-12-07 10:51             ` Takafumi Arakaki

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