Browse Source

Bugfix: Add file name only once to refile targets

With the setting

   (setq org-refile-use-outline-path 'file)

the file names ended up twice, like

    "xxx.org/level 1/level 2 (xxx.org)"

Now the second occurrence is omitted.
Carsten Dominik 11 years ago
parent
commit
a36ebd79c8
2 changed files with 6 additions and 1 deletions
  1. 3 0
      lisp/ChangeLog
  2. 3 1
      lisp/org.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-04-01  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org.el (org-refile-get-location): Add file name only if not
+	already included in outline path.
+
 	* org-faces.el (org-n-level-faces): Fix customization type from
 	number to integer.
 

+ 3 - 1
lisp/org.el

@@ -8275,7 +8275,9 @@ operation has put the subtree."
 	 (filename (and cfn (expand-file-name cfn)))
 	 (tbl (mapcar
 	       (lambda (x)
-		 (if (not (equal filename (nth 1 x)))
+		 (if (and (not (member org-refile-use-outline-path
+				       '(file full-file-path)))
+			  (not (equal filename (nth 1 x))))
 		     (cons (concat (car x) extra " ("
 				   (file-name-nondirectory (nth 1 x)) ")")
 			   (cdr x))