changeset 100671:b095fbcf559e

2008-12-23 Carsten Dominik <dominik@science.uva.nl> * org-remember.el (org-remember-handler): Safer way to get a new buffer accessing the target file. * org.el (org-refile-get-location): Handle case of current buffer not having a file associated with it.
author Carsten Dominik <dominik@science.uva.nl>
date Tue, 23 Dec 2008 23:12:31 +0000
parents 3a213a83e9a6
children 38e7317321ea
files lisp/org/ChangeLog lisp/org/org-remember.el lisp/org/org.el
diffstat 3 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/org/ChangeLog	Tue Dec 23 21:03:09 2008 +0000
+++ b/lisp/org/ChangeLog	Tue Dec 23 23:12:31 2008 +0000
@@ -1,3 +1,11 @@
+2008-12-23  Carsten Dominik  <dominik@science.uva.nl>
+
+	* org-remember.el (org-remember-handler): Safer way to get a new
+	buffer accessing the target file.
+
+	* org.el (org-refile-get-location): Handle case of current buffer
+	not having a file associated with it.
+
 2008-12-22  Carsten Dominik  <dominik@science.uva.nl>
 
 	* org-table.el (org-table-get-formula): Only ask to overwrite
--- a/lisp/org/org-remember.el	Tue Dec 23 21:03:09 2008 +0000
+++ b/lisp/org/org-remember.el	Tue Dec 23 23:12:31 2008 +0000
@@ -809,8 +809,7 @@
 	  (move-marker org-remember-last-stored-marker (point)))
 	(throw 'quit t))
       ;; Find the file
-      (if (not visiting) (find-file-noselect file))
-      (with-current-buffer (or visiting (get-file-buffer file))
+      (with-current-buffer (or visiting (find-file-noselect file))
 	(unless (org-mode-p)
 	  (error "Target files for remember notes must be in Org-mode"))
 	(save-excursion
--- a/lisp/org/org.el	Tue Dec 23 21:03:09 2008 +0000
+++ b/lisp/org/org.el	Tue Dec 23 23:12:31 2008 +0000
@@ -7668,13 +7668,13 @@
   (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)))