Browse Source

org: Fix interactive headline edit

* lisp/org.el (org-edit-headline): Save match-data before calling
  read-string.
Marco Wahl 9 years ago
parent
commit
127f86bdc5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lisp/org.el

+ 1 - 1
lisp/org.el

@@ -8003,7 +8003,7 @@ Set it to HEADING when provided."
    (org-back-to-heading t)
    (org-back-to-heading t)
    (when (looking-at org-complex-heading-regexp)
    (when (looking-at org-complex-heading-regexp)
      (let* ((old (match-string-no-properties 4))
      (let* ((old (match-string-no-properties 4))
-	    (new (org-trim (or heading (read-string "Edit: " old)))))
+	    (new (org-trim (or heading (save-match-data (read-string "Edit: " old))))))
        (unless (equal old new)
        (unless (equal old new)
 	 (if old (replace-match new t t nil 4)
 	 (if old (replace-match new t t nil 4)
 	   (goto-char (or (match-end 3) (match-end 2) (match-end 1)))
 	   (goto-char (or (match-end 3) (match-end 2) (match-end 1)))