Pārlūkot izejas kodu

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.
Sebastian Reuße 8 gadi atpakaļ
vecāks
revīzija
53bcf91a96
1 mainītis faili ar 3 papildinājumiem un 2 dzēšanām
  1. 3 2
      lisp/org.el

+ 3 - 2
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)))