diff options
author | Sebastian Reuße <seb@wirrsal.net> | 2017-05-06 08:38:44 +0200 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2017-05-06 12:01:09 -0400 |
commit | 53bcf91a967f8fb3ef5ee68b95318cdab235694e (patch) | |
tree | 19ce77b999491934c5326f3c149a01790cc3f59a | |
parent | ac656ad7b9fa075057803f4dace543da77782e3b (diff) | |
download | org-mode-53bcf91a967f8fb3ef5ee68b95318cdab235694e.tar.gz |
org-refile: Escape slashes only in headline of refile target
* org.el (org-refile-get-targets): Only escape slashes in headline
part of refile target; leave any file-system path component (when
enabled) unescaped.
The reason to escape slashes in refile targets is to make it clear
when a slash was part of a headline vs. part of the outline path. It
makes sense to treat slashes in the file system part the same way as
outline paths, since this won’t result in any confusion and serves to
make target selection less noisy.
-rw-r--r-- | lisp/org.el | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/org.el b/lisp/org.el index 0d83b4c..5d8166c 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -11576,7 +11576,7 @@ order.") (target (if (not org-refile-use-outline-path) heading (mapconcat - #'org-protect-slash + #'identity (append (pcase org-refile-use-outline-path (`file (list (file-name-nondirectory @@ -11586,7 +11586,8 @@ order.") (list (buffer-file-name (buffer-base-buffer)))) (_ nil)) - (org-get-outline-path t t)) + (mapcar #'org-protect-slash + (org-get-outline-path t t))) "/")))) (push (list target f re (org-refile-marker (point))) tgs))) |