>From 1467585c21d1bebbb3823d4c71b9265c358e1b46 Mon Sep 17 00:00:00 2001 From: "F. Jason Park" Date: Wed, 13 Jul 2022 01:54:19 -0700 Subject: [PATCH 01/10] Teach thing-at-point to recognize bracketed IPv6 URLs * lisp/thingatpt.el (thing-at-point-bounds-of-url-at-point): Allow brackets. * test/lisp/thingatpt-tests.el (thing-at-point-test-data): Add case for IPv6 URL. --- lisp/thingatpt.el | 2 +- test/lisp/thingatpt-tests.el | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el index b3dca5890f..5e597df6ff 100644 --- a/lisp/thingatpt.el +++ b/lisp/thingatpt.el @@ -430,7 +430,7 @@ thing-at-point-bounds-of-url-at-point ;; Otherwise, find the bounds within which a URI may exist. The ;; method is similar to `ffap-string-at-point'. Note that URIs ;; may contain parentheses but may not contain spaces (RFC3986). - (let* ((allowed-chars "--:=&?$+@-Z_[:alpha:]~#,%;*()!'") + (let* ((allowed-chars "--:=&?$+@-Z_[:alpha:]~#,%;*()!'[]") (skip-before "^[0-9a-zA-Z]") (skip-after ":;.,!?'") (pt (point)) diff --git a/test/lisp/thingatpt-tests.el b/test/lisp/thingatpt-tests.el index b6d0b1446a..b5f4ea8cdc 100644 --- a/test/lisp/thingatpt-tests.el +++ b/test/lisp/thingatpt-tests.el @@ -44,6 +44,7 @@ thing-at-point-test-data ;; Non alphanumeric characters can be found in URIs ("ftp://example.net/~foo!;#bar=baz&goo=bob" 3 url "ftp://example.net/~foo!;#bar=baz&goo=bob") ("bzr+ssh://user@example.net:5/a%20d,5" 34 url "bzr+ssh://user@example.net:5/a%20d,5") + ("http://[::1]:8000/foo" 10 url "http://[::1]:8000/foo") ;; markup ("Url: ..." 8 url "foo://1.example.com") ("Url: ..." 30 url "foo://2.example.com") -- 2.36.1