Przeglądaj źródła

Make sure `org-files-list' returns real files

(org-files-list): Don't attempt to return a file name for Org buffers
which have no associated file.
John Wiegley 15 lat temu
rodzic
commit
57a7a4c15b
2 zmienionych plików z 4 dodań i 1 usunięć
  1. 3 0
      lisp/ChangeLog
  2. 1 1
      lisp/org.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-10-18  John Wiegley  <johnw@newartisans.com>
 
+	* org.el (org-files-list): Don't attempt to return a file name for
+	Org buffers which have no associated file.
+
 	* org-agenda.el (org-agenda-do-action): Fixed a typo.
 
 2009-10-18  Carsten Dominik  <carsten.dominik@gmail.com>

+ 1 - 1
lisp/org.el

@@ -5344,7 +5344,7 @@ open and agenda-wise Org files."
   (let ((files (mapcar 'expand-file-name org-agenda-files)))
     (dolist (buf (buffer-list))
       (with-current-buffer buf
-	(if (eq major-mode 'org-mode)
+	(if (and (eq major-mode 'org-mode) (buffer-file-name))
 	    (let ((file (expand-file-name (buffer-file-name))))
 	      (unless (member file files)
 		(push file files))))))