瀏覽代碼

Refile: Compare expanded file names

When refiling to the current file, the completion commands do not show
the file name.  This was broken because I had switched from comparing
truenames to normal names. Now I am using expanded names, this is fast
and works well.
Carsten Dominik 16 年之前
父節點
當前提交
fcad0fbc4e
共有 2 個文件被更改,包括 8 次插入1 次删除
  1. 5 0
      lisp/ChangeLog
  2. 3 1
      lisp/org.el

+ 5 - 0
lisp/ChangeLog

@@ -1,3 +1,8 @@
+2008-12-20  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org.el (org-get-refile-targets, org-refile-get-location): Use
+	expanded file name to improve comparison.
+
 2008-12-19  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org.el (org-scan-tags): Rescan for tags, to get the correct

+ 3 - 1
lisp/org.el

@@ -7509,6 +7509,7 @@ on the system \"/user@host:\"."
 	  (save-excursion
 	    (set-buffer (if (bufferp f) f (org-get-agenda-file-buffer f)))
 	    (if (bufferp f) (setq f (buffer-file-name (buffer-base-buffer f))))
+	    (setq f (expand-file-name f))
 	    (save-excursion
 	      (save-restriction
 		(widen)
@@ -7672,7 +7673,8 @@ operation has put the subtree."
 		    'org-olpath-completing-read
 		  'org-ido-completing-read))
 	 (extra (if org-refile-use-outline-path "/" ""))
-	 (filename (buffer-file-name (buffer-base-buffer cbuf)))
+	 (filename (expand-file-name
+		    (buffer-file-name (buffer-base-buffer cbuf))))
 	 (tbl (mapcar
 	       (lambda (x)
 		 (if (not (equal filename (nth 1 x)))