Browse Source

Remember: Fix bug cause by expand-file-name on nil file.

Carsten Dominik 16 năm trước cách đây
mục cha
commit
76e18b30e9
2 tập tin đã thay đổi với 7 bổ sung2 xóa
  1. 5 0
      lisp/ChangeLog
  2. 2 2
      lisp/org.el

+ 5 - 0
lisp/ChangeLog

@@ -1,3 +1,8 @@
+2008-12-23  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org.el (org-refile-get-location): Handle case of current buffer
+	not having a file associated with it.
+
 2008-12-22  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org-table.el (org-table-get-formula): Only ask to overwrite

+ 2 - 2
lisp/org.el

@@ -7671,13 +7671,13 @@ operation has put the subtree."
   (unless org-refile-target-table
     (error "No refile targets"))
   (let* ((cbuf (current-buffer))
+	 (cfn (buffer-file-name (buffer-base-buffer cbuf)))
 	 (cfunc (if (and org-refile-use-outline-path
 			 org-outline-path-complete-in-steps)
 		    'org-olpath-completing-read
 		  'org-ido-completing-read))
 	 (extra (if org-refile-use-outline-path "/" ""))
-	 (filename (expand-file-name
-		    (buffer-file-name (buffer-base-buffer cbuf))))
+	 (filename (and cfn (expand-file-name cfn)))
 	 (tbl (mapcar
 	       (lambda (x)
 		 (if (not (equal filename (nth 1 x)))