org-babel-result-to-file: Fix when in indirect buffer

* lisp/ob-core.el (org-babel-result-to-file): Consider file name in
base buffer when calculating base directory.

Reported-by: 赵一宇 <zhyznd@163.com>
Link: https://list.orgmode.org/orgmode/3d69c850.69db.18953ae45da.Coremail.zhyznd@163.com/
This commit is contained in:
Ihor Radchenko 2023-07-17 12:04:05 +03:00
parent 26440689aa
commit c730caf512
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 1 additions and 1 deletions

View File

@ -2741,7 +2741,7 @@ specified as an an \"attachment:\" style link."
(when (stringp result)
(let* ((result-file-name (expand-file-name result))
(base-file-name (buffer-file-name (buffer-base-buffer)))
(base-directory (and buffer-file-name
(base-directory (and base-file-name
(file-name-directory base-file-name)))
(same-directory?
(and base-file-name