Expand the in-file path when converting

This commit is contained in:
TEC 2022-07-16 15:32:28 +08:00
parent 8e923d264a
commit 84924edff4
Signed by: tec
GPG Key ID: 779591AFDB81F06C
1 changed files with 12 additions and 11 deletions

View File

@ -195,17 +195,18 @@ files within `org-pandoc-import-filters-folder'.
If preprocessor is given, and a function, it is run with the value of IN-FILE.
The value returned is used as the new IN-FILE."
(let* ((in-file (or in-file
(if (and (not prompty)
(buffer-file-name)
(if expected-extensions
(member (file-name-extension (buffer-file-name))
expected-extensions))
t)
(buffer-file-name)
(read-file-name "File to convert: " nil nil t
(when expected-extensions
(concat "." (car expected-extensions)))))))
(let* ((in-file (expand-file-name
(or in-file
(if (and (not prompty)
(buffer-file-name)
(if expected-extensions
(member (file-name-extension (buffer-file-name))
expected-extensions))
t)
(buffer-file-name)
(read-file-name "File to convert: " nil nil t
(when expected-extensions
(concat "." (car expected-extensions))))))))
(in-file-processed (if (and preprocessor (functionp preprocessor))
(funcall preprocessor in-file)
in-file))