summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2014-01-30 12:43:02 +0100
committerBastien Guerry <bzg@altern.org>2014-01-30 12:43:02 +0100
commit99a23ba4361bec79083e7ab187131a503199e8cb (patch)
tree9c7ad3bbc06de25060b8f387e1b20c5a19eb7b7e
parent98de33a9acfd59f0c64020db998adb0fe8129551 (diff)
parent53c664c4ec4c8ec265dbc85a35dc4862a57a82ce (diff)
downloadorg-mode-99a23ba4361bec79083e7ab187131a503199e8cb.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/org.el17
1 files changed, 13 insertions, 4 deletions
diff --git a/lisp/org.el b/lisp/org.el
index d166336..d6a2674 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11755,6 +11755,17 @@ prefix argument (`C-u C-u C-u C-c C-w')."
(bookmark-jump "org-refile-last-stored")
(message "This is the location of the last refile"))
+(defun org-refile--get-location (refloc tbl)
+ "When user refile to REFLOC, find the associated target in TBL.
+Also check `org-refile-target-table'."
+ (car (delq
+ nil
+ (mapcar
+ (lambda (r) (or (assoc r tbl)
+ (assoc r org-refile-target-table)))
+ (list (replace-regexp-in-string "/$" "" refloc)
+ (replace-regexp-in-string "\\([^/]\\)$" "\\1/" refloc))))))
+
(defun org-refile-get-location (&optional prompt default-buffer new-nodes
no-exclude)
"Prompt the user for a refile location, using PROMPT.
@@ -11808,8 +11819,7 @@ this is used for the GOTO interface."
(setq old-hist org-refile-history)
(setq answ (funcall cfunc prompt tbl nil (not new-nodes)
nil 'org-refile-history (or cdef (car org-refile-history))))
- (setq pa (or (assoc answ tbl) (assoc (concat answ "/") tbl)))
- (if pa
+ (if (setq pa (org-refile--get-location answ tbl))
(progn
(org-refile-check-position pa)
(when (or (not org-refile-history)
@@ -11826,8 +11836,7 @@ this is used for the GOTO interface."
(progn
(setq parent (match-string 1 answ)
child (match-string 2 answ))
- (setq parent-target (or (assoc parent tbl)
- (assoc (concat parent "/") tbl)))
+ (setq parent-target (org-refile--get-location parent tbl))
(when (and parent-target
(or (eq new-nodes t)
(and (eq new-nodes 'confirm)