diff options
| author | F. Jason Park | 2022-07-11 05:14:57 -0700 |
|---|---|---|
| committer | F. Jason Park | 2022-11-16 21:34:36 -0800 |
| commit | 5699e43f27ef5ca760a38572928be8a53819a430 (patch) | |
| tree | d1ffc743fd9fddf2fb5b374478ba080c8a669468 /test | |
| parent | d4028ead897464c9799847900b4acb2276acaac6 (diff) | |
| download | emacs-5699e43f27ef5ca760a38572928be8a53819a430.tar.gz emacs-5699e43f27ef5ca760a38572928be8a53819a430.zip | |
Accommodate ircs:// URLs in url-irc and browse-url
* lisp/url/url-irc.el (url-irc-function): Change signature of function
interface to expect a final "scheme" argument, such as "ircs".
(url-irc): Call `url-irc-function' with new positional argument, the
scheme extracted via `url-type' from the input URL.
(url-irc-erc, url-irc-rcirc, url-irc-zenirc): Accept a URL scheme as a
sixth positional arg.
(url-ircs-default-port, url-ircs): Add new autoloaded constant and
alias for `url-scheme-get-property' to recognize. Do this to avoid
having to add another file.
* lisp/net/browse-url.el (browse-url-irc-function): Add new option.
(browse-url--irc): Add new function to call `browse-url-irc-function'.
(browse-url-default-handlers): Add "irc://" entry.
(browse-url-irc): Add new function to serve as general handler for
"irc://" URLS. Accept trailing variadic args to accommodate
non-browse-url interfaces as well.
* test/lisp/net/browse-url-tests.el
(browse-url-tests-select-handler-irc): Add test for "irc://" URL
pattern.
* etc/NEWS: Mention select browse-url and url-irc
changes. (Bug#56514.)
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/net/browse-url-tests.el | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/lisp/net/browse-url-tests.el b/test/lisp/net/browse-url-tests.el index 1c993958b81..dc819768211 100644 --- a/test/lisp/net/browse-url-tests.el +++ b/test/lisp/net/browse-url-tests.el | |||
| @@ -56,6 +56,15 @@ | |||
| 56 | 'browse-url--man)) | 56 | 'browse-url--man)) |
| 57 | (should-not (browse-url-select-handler "man:ls" 'external))) | 57 | (should-not (browse-url-select-handler "man:ls" 'external))) |
| 58 | 58 | ||
| 59 | (ert-deftest browse-url-tests-select-handler-irc () | ||
| 60 | (should (eq (browse-url-select-handler "irc://localhost" 'internal) | ||
| 61 | 'browse-url--irc)) | ||
| 62 | (should-not (browse-url-select-handler "irc://localhost" 'external)) | ||
| 63 | (should (eq (browse-url-select-handler "irc6://localhost") | ||
| 64 | 'browse-url--irc)) | ||
| 65 | (should (eq (browse-url-select-handler "ircs://tester@irc.gnu.org/#chan") | ||
| 66 | 'browse-url--irc))) | ||
| 67 | |||
| 59 | (ert-deftest browse-url-tests-select-handler-file () | 68 | (ert-deftest browse-url-tests-select-handler-file () |
| 60 | (should (eq (browse-url-select-handler "file://foo.txt") | 69 | (should (eq (browse-url-select-handler "file://foo.txt") |
| 61 | 'browse-url-emacs)) | 70 | 'browse-url-emacs)) |