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
This commit is contained in:
Ihor Radchenko 2024-06-14 16:03:05 +02:00
parent 9f0a9ec34a
commit 73da6beb50
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
2 changed files with 23 additions and 0 deletions

View File

@ -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

View File

@ -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