summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBhavin Gandhi <bhavin192@geeksocket.in>2021-05-23 23:07:13 +0530
committerBastien <bzg@gnu.org>2021-05-25 02:13:43 +0200
commit37f69bf86dd72ce518c60b6dbbd6afb80a896eeb (patch)
tree00223e5036931990b30800df7d145fa53989c9a0
parent21eb69c413681f7a3ef5d512685ade706045bd02 (diff)
downloadorg-mode-37f69bf86dd72ce518c60b6dbbd6afb80a896eeb.tar.gz
org-refile: Fix double slashes in the refile targets
* org-refile.el (org-refile-get-location): When we generate the `tbl' variable, we add extra slash depending on the value of `org-refile-use-outline-path'. This patch updates some locations which add another extra slash assuming the target did not have it. `org-refile--get-location' does lookup for entries with and without slash, so it was not causing any issues before. It works as it is now as well. Thanks to Gustavo Barros for a very detailed bug report. TINYCHANGE
-rw-r--r--lisp/org-refile.el10
1 files changed, 4 insertions, 6 deletions
diff --git a/lisp/org-refile.el b/lisp/org-refile.el
index e4f000d..913bec3 100644
--- a/lisp/org-refile.el
+++ b/lisp/org-refile.el
@@ -638,20 +638,18 @@ this function appends the default value from
(setq old-hist org-refile-history)
(setq answ (funcall cfunc prompt tbl nil (not new-nodes)
nil 'org-refile-history
- (or cdef (concat (car org-refile-history) extra))))
+ (or cdef (car org-refile-history))))
(if (setq pa (org-refile--get-location answ tbl))
- (let* ((last-refile-loc (car org-refile-history))
- (last-refile-loc-path (concat last-refile-loc extra)))
+ (let ((last-refile-loc (car org-refile-history)))
(org-refile-check-position pa)
(when (or (not org-refile-history)
(not (eq old-hist org-refile-history))
- (not (equal (car pa) last-refile-loc-path)))
+ (not (equal (car pa) last-refile-loc)))
(setq org-refile-history
(cons (car pa) (if (assoc last-refile-loc tbl)
org-refile-history
(cdr org-refile-history))))
- (when (or (equal last-refile-loc-path (nth 1 org-refile-history))
- (equal last-refile-loc (nth 1 org-refile-history)))
+ (when (equal last-refile-loc (nth 1 org-refile-history))
(pop org-refile-history)))
pa)
(if (string-match "\\`\\(.*\\)/\\([^/]+\\)\\'" answ)