1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-22 07:09:47 +00:00

org-refile.el: Fix commit 63fd0c09ca

* lisp/org-refile.el (org-refile-get-location): Set
`org-refile-history' correctly.
This commit is contained in:
Bastien 2020-02-13 08:45:01 +01:00
parent 430b644f79
commit da97799a1d

View File

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