branch: externals/org commit 73da6beb50d3b891d0f003a27dd8652f2d6ebdc3 Author: Ihor Radchenko <yanta...@posteo.net> Commit: Ihor Radchenko <yanta...@posteo.net>
org-link-plain-re: Improve heuristic regexp for plain link detection * lisp/ol.el (org-link-make-regexps): Allow trailing ?- at the end of the plain links. * etc/ORG-NEWS (Trailing =-= is now allowed in plain links): Announce the change. Link: https://orgmode.org/list/87sexh9ddv.fsf@ice9.digital --- etc/ORG-NEWS | 17 +++++++++++++++++ lisp/ol.el | 6 ++++++ 2 files changed, 23 insertions(+) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index a1efc445fa..483a1c0c73 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -60,6 +60,23 @@ all the references are resolved in the generated png. # This also includes changes in function behavior from Elisp perspective. ** Miscellaneous +*** Trailing =-= is now allowed in plain links + +Previously, plain links like + +: https://domain/test- + +did not include the trailing =-= punctuation. + +Now, the =-= is allowed at the end, and is considered a part of the plain link. + +#+begin_quote +These types of links will likely be encountered for sites where anchor +targets are automatically generated from documentation headings which +are questions. + https://list.orgmode.org/orgmode/87sexh9ddv.fsf@ice9.digital/ +#+end_quote + *** =org-attach= now considers symlinked files when searching pre-existing attach dirs When Org buffer is opened from a symlink, Org mode looks into the diff --git a/lisp/ol.el b/lisp/ol.el index 514d5c81f7..a8a59ddaae 100644 --- a/lisp/ol.el +++ b/lisp/ol.el @@ -944,6 +944,12 @@ This should be called after the variable `org-link-parameters' has changed." (1+ (or (regex ,non-space-bracket) ,parenthesis)) (or (regexp "[^[:punct:] \t\n]") + ;; Allow "-" punctuation, as an exception + ;; See https://list.orgmode.org/orgmode/87sexh9ddv.fsf@ice9.digital/ + ;; This is also in line with the heuristics + ;; above - it also does not include "-" + ;; punctuation. + ?- ?/ ,parenthesis))))) org-link-bracket-re