org-link-open-as-file: Do not try dired wildcard expansion when file exists
* lisp/ol.el (org-link-open-as-file): When PATH points to an existing file and contains wildcard chars, do not try to list all the files in `dired'. Reported-by: Edgar Lux <edgarlux@mailfence.com> Link: https://orgmode.org/list/1294251072.453751.1712943418634@ichabod.co-bxl
This commit is contained in:
parent
5128460f94
commit
6cb088972f
|
@ -1326,8 +1326,9 @@ This function is meant to be used as a possible tool for
|
|||
(match-string 1 path)))
|
||||
(file-name (if (not option) path
|
||||
(substring path 0 (match-beginning 0)))))
|
||||
(if (string-match "[*?{]" (file-name-nondirectory file-name))
|
||||
(dired file-name)
|
||||
(if (and (string-match "[*?{]" (file-name-nondirectory file-name))
|
||||
(not (file-exists-p file-name)))
|
||||
(dired file-name)
|
||||
(apply #'org-open-file
|
||||
file-name
|
||||
arg
|
||||
|
|
Loading…
Reference in New Issue