diff options
author | Bastien <bzg@gnu.org> | 2020-02-13 08:45:01 +0100 |
---|---|---|
committer | Bastien <bzg@gnu.org> | 2020-02-13 08:45:01 +0100 |
commit | da97799a1df88e3686bb18ff24117bd6b60ee049 (patch) | |
tree | c7b540624ae605d806c8b07ec965bd5a636757fa | |
parent | 430b644f7979d0450886a74bfefbcb7ae57047fa (diff) | |
download | org-mode-da97799a1df88e3686bb18ff24117bd6b60ee049.tar.gz |
org-refile.el: Fix commit 63fd0c09ca
* lisp/org-refile.el (org-refile-get-location): Set
`org-refile-history' correctly.
-rw-r--r-- | lisp/org-refile.el | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/lisp/org-refile.el b/lisp/org-refile.el index 5ad9e90..bfed0b4 100644 --- a/lisp/org-refile.el +++ b/lisp/org-refile.el @@ -773,20 +773,23 @@ this function appends the default value from org-refile-target-table)) (completion-ignore-case t) cdef - (last-refile-loc (car org-refile-history)) - (last-refile-loc-path (concat last-refile-loc - (if org-refile-use-outline-path "/"))) (prompt (concat prompt - (or (and last-refile-loc - (concat " (default " last-refile-loc ")")) + (or (and (car org-refile-history) + (concat " (default " (car org-refile-history) ")")) (and (assoc cbnex tbl) (setq cdef cbnex) (concat " (default " cbnex ")"))) ": ")) pa answ parent-target child parent old-hist) (setq old-hist org-refile-history) (setq answ (funcall cfunc prompt tbl nil (not new-nodes) - nil 'org-refile-history (or cdef last-refile-loc-path))) + nil 'org-refile-history + (or cdef (concat (car org-refile-history) + (when (and org-refile-use-outline-path) + "/"))))) (if (setq pa (org-refile--get-location answ tbl)) - (progn + (let* ((last-refile-loc (car org-refile-history)) + (last-refile-loc-path + (concat last-refile-loc + (when (and org-refile-use-outline-path) "/")))) (org-refile-check-position pa) (when (or (not org-refile-history) (not (eq old-hist org-refile-history)) @@ -795,7 +798,8 @@ this function appends the default value from (cons (car pa) (if (assoc last-refile-loc tbl) org-refile-history (cdr org-refile-history)))) - (when (equal last-refile-loc (nth 1 org-refile-history)) + (when (or (equal last-refile-loc-path (nth 1 org-refile-history)) + (equal last-refile-loc (nth 1 org-refile-history))) (pop org-refile-history))) pa) (if (string-match "\\`\\(.*\\)/\\([^/]+\\)\\'" answ) |