summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2018-04-03 00:11:14 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2018-04-03 00:11:14 +0200
commit003af466c5230d11ac1492ad725d98a7ed072942 (patch)
tree6ddbeb7a885ebb756f6b53629db5bf40ee37327b
parent20b5d8aaec5c8bd40a1eb454a3586126eac2f1c8 (diff)
downloadorg-mode-003af466c5230d11ac1492ad725d98a7ed072942.tar.gz
ob-core: Fix failing tests.
* lisp/ob-core.el (org-babel-result-to-file): Do not assume current buffer is visiting a file.
-rw-r--r--lisp/ob-core.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index e331682..129e17f 100644
--- a/lisp/ob-core.el
+++ b/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)