Fix path-spec completion of non-file and space buf

The %S formatting of file names ensures the path is quoted, allowing for
paths with spaces. Before constructing an include based on the file name
though, we now first check that the buffer in fact has a file name.
This commit is contained in:
TEC 2022-12-08 02:12:42 +08:00
parent 06df322b30
commit 44aa088f9b
Signed by: tec
SSH Key Fingerprint: SHA256:eobz41Mnm0/iYWBvWThftS0ElEs1ftBr6jamutnXc/A
1 changed files with 3 additions and 2 deletions

View File

@ -428,8 +428,9 @@ The PATH-SPEC is formed with respect to the current buffer."
(or (and (stringp path-spec)
(org-glossary--parse-include-value path-spec))
path-spec
(org-glossary--parse-include-value
(buffer-file-name))
(and (buffer-file-name)
(org-glossary--parse-include-value
(format "%S" (buffer-file-name))))
(current-buffer)))
(defun org-glossary--include-once (parameters)