1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-23 07:18:53 +00:00

ob-core: Fix failing tests.

* lisp/ob-core.el (org-babel-result-to-file): Do not assume current
  buffer is visiting a file.
This commit is contained in:
Nicolas Goaziou 2018-04-03 00:11:14 +02:00
parent 20b5d8aaec
commit 003af466c5

View File

@ -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)