mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-29 18:36:26 +00:00
ol: Fix opening file link with a starred search option
* lisp/ol.el (org-link-open-as-file): Fix logic so initial regexp is matched against the file-name only, not the search option.
This commit is contained in:
parent
1a84a8b611
commit
7707f898a1
14
lisp/ol.el
14
lisp/ol.el
|
@ -1269,14 +1269,14 @@ search options, separated from the file name with \"::\".
|
||||||
|
|
||||||
This function is meant to be used as a possible tool for
|
This function is meant to be used as a possible tool for
|
||||||
`:follow' property in `org-link-parameters'."
|
`:follow' property in `org-link-parameters'."
|
||||||
(if (string-match "[*?{]" (file-name-nondirectory path))
|
(let* ((option (and (string-match "::\\(.*\\)\\'" path)
|
||||||
(dired path)
|
(match-string 1 path)))
|
||||||
(let* ((option (and (string-match "::\\(.*\\)\\'" path)
|
(file-name (if (not option) path
|
||||||
(match-string 1 path)))
|
(substring path 0 (match-beginning 0)))))
|
||||||
(path (if (not option) path
|
(if (string-match "[*?{]" (file-name-nondirectory file-name))
|
||||||
(substring path 0 (match-beginning 0)))))
|
(dired file-name)
|
||||||
(apply #'org-open-file
|
(apply #'org-open-file
|
||||||
path
|
file-name
|
||||||
arg
|
arg
|
||||||
(cond ((not option) nil)
|
(cond ((not option) nil)
|
||||||
((string-match-p "\\`[0-9]+\\'" option)
|
((string-match-p "\\`[0-9]+\\'" option)
|
||||||
|
|
Loading…
Reference in a new issue