~bzg/org-mode

6cb088972f3318ec93c37b216d19d25064e13ef0 — Ihor Radchenko a month ago 5128460
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
1 files changed, 3 insertions(+), 2 deletions(-)

M lisp/ol.el
M lisp/ol.el => lisp/ol.el +3 -2
@@ 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