org-open-at-point-global: Match multiline links

* lisp/org.el (org-open-at-point-global): Match multiline links
spanning up to a paragraph.

Reported-by: Omar Antolín Camarena <omar@matem.unam.mx>
Link: https://orgmode.org/list/87o7df7psx.fsf@localhost
This commit is contained in:
Ihor Radchenko 2024-01-21 13:15:42 +01:00
parent 6e17ddd334
commit ac1c72376c
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 10 additions and 1 deletions

View File

@ -8441,7 +8441,16 @@ Raise a user error when there is nothing to follow."
(interactive)
(let ((tap-url (thing-at-point 'url))
(tap-email (thing-at-point 'email)))
(cond ((org-in-regexp org-link-any-re)
(cond ((org-in-regexp
org-link-any-re
(let ((origin (point)))
(max
(save-excursion
(backward-paragraph)
(count-lines (point) origin))
(save-excursion
(forward-paragraph)
(count-lines origin (point))))))
(org-link-open-from-string (match-string-no-properties 0)))
((or (org-in-regexp org-ts-regexp-both nil t)
(org-in-regexp org-tsr-regexp-both nil t))