summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2009-07-27 18:33:06 +0800
committerBastien Guerry <bzg@altern.org>2009-07-27 18:33:06 +0800
commitbfc9e1bcb5d036cc135b76bb9e453c4f0de19366 (patch)
tree3604b2249b450f7136b2365705015e433c8a6bb1
parent01d84ed000bd68577c14db1befe8407f3c85b6d5 (diff)
downloadorg-mode-bfc9e1bcb5d036cc135b76bb9e453c4f0de19366.tar.gz
Bugfix: save-excursion before reading the refile target.
Otherwise cursor moves might confuse `org-refile'.
-rwxr-xr-xlisp/ChangeLog3
-rw-r--r--lisp/org.el7
2 files changed, 7 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a772eb7..d3fe006 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
2009-07-27 Bastien Guerry <bzg@altern.org>
+ * org.el (org-refile): Bugfix: save-excursion before reading the
+ refile target, otherwise cursor moves might confuse `org-refile'.
+
* org-html.el (org-export-as-html): Bugfix: correctly convert the
footnote reference before the footnote itself.
diff --git a/lisp/org.el b/lisp/org.el
index a0987f7..119311a 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -8464,9 +8464,10 @@ See also `org-refile-use-outline-path' and `org-completion-use-ido'"
(if (equal goto '(16))
(org-refile-goto-last-stored)
(when (setq it (or rfloc
- (org-refile-get-location
- (if goto "Goto: " "Refile to: ") default-buffer
- org-refile-allow-creating-parent-nodes)))
+ (save-excursion
+ (org-refile-get-location
+ (if goto "Goto: " "Refile to: ") default-buffer
+ org-refile-allow-creating-parent-nodes))))
(setq file (nth 1 it)
re (nth 2 it)
pos (nth 3 it))