Przeglądaj źródła

org-archive: error when buffer isn't visiting a file

* lisp/org-archive.el (org-archive-subtree): while it might be
  possible to archive an headline of a temporary buffer (i.e. not
  visiting a file), it wouldn't be really sensical.
Nicolas Goaziou 14 lat temu
rodzic
commit
0b4b66b302
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      lisp/org-archive.el

+ 3 - 1
lisp/org-archive.el

@@ -207,7 +207,9 @@ this heading."
 	   (this-buffer (current-buffer))
 	   ;; start of variables that will be used for saving context
 	   ;; The compiler complains about them - keep them anyway!
-	   (file (abbreviate-file-name (buffer-file-name (buffer-base-buffer))))
+	   (file (abbreviate-file-name
+		  (or (buffer-file-name (buffer-base-buffer))
+		      (error "No file associated to buffer"))))
 	   (olpath (mapconcat 'identity (org-get-outline-path) "/"))
 	   (time (format-time-string
 		  (substring (cdr org-time-stamp-formats) 1 -1)