Explorar o código

ob-core: Fix failing tests.

* lisp/ob-core.el (org-babel-result-to-file): Do not assume current
  buffer is visiting a file.
Nicolas Goaziou %!s(int64=7) %!d(string=hai) anos
pai
achega
003af466c5
Modificáronse 1 ficheiros con 5 adicións e 3 borrados
  1. 5 3
      lisp/ob-core.el

+ 5 - 3
lisp/ob-core.el

@@ -2501,9 +2501,11 @@ in the buffer."
 If the `default-directory' is different from the containing
 file's directory then expand relative links."
   (when (stringp result)
-    (let ((same-directory? (not (string= (expand-file-name default-directory)
-					 (expand-file-name
-					  (file-name-directory buffer-file-name))))))
+    (let ((same-directory?
+	   (and buffer-file-name
+		(not (string= (expand-file-name default-directory)
+			      (expand-file-name
+			       (file-name-directory buffer-file-name)))))))
       (format "[[file:%s]%s]"
 	      (if (and default-directory buffer-file-name same-directory?)
 		  (if (eq org-link-file-path-type 'adaptive)