diff options
| author | F. Jason Park | 2022-12-11 19:16:07 -0800 |
|---|---|---|
| committer | F. Jason Park | 2022-12-14 06:40:55 -0800 |
| commit | 75f26646d4a569cfb485de4baddcda66ff44b2c3 (patch) | |
| tree | aa1fbdaf6b35d49cbcf0479f09b336f6a2c37846 | |
| parent | 0155fc67be393239e5a2956d5dfaf6a0f74b517e (diff) | |
| download | emacs-75f26646d4a569cfb485de4baddcda66ff44b2c3.tar.gz emacs-75f26646d4a569cfb485de4baddcda66ff44b2c3.zip | |
; Be nicer when updating browse-url var in erc-compat
* lisp/erc/erc-compat.el: Be more cautious about modifying
`browse-url-default-handlers' when loading erc-compat on Emacs 28. A
user may have already added an entry for irc:// URLs before loading
`erc-compat'.
| -rw-r--r-- | lisp/erc/erc-compat.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/erc/erc-compat.el b/lisp/erc/erc-compat.el index bd932547586..77625398abd 100644 --- a/lisp/erc/erc-compat.el +++ b/lisp/erc/erc-compat.el | |||
| @@ -391,8 +391,11 @@ If START or END is negative, it counts from the end." | |||
| 391 | 391 | ||
| 392 | (cond ((fboundp 'browse-url-irc)) ; 29 | 392 | (cond ((fboundp 'browse-url-irc)) ; 29 |
| 393 | ((boundp 'browse-url-default-handlers) ; 28 | 393 | ((boundp 'browse-url-default-handlers) ; 28 |
| 394 | (cl-pushnew '("\\`irc6?s?://" . erc-compat--29-browse-url-irc) | 394 | (setf (alist-get "\\`irc6?s?://" browse-url-default-handlers |
| 395 | browse-url-default-handlers)) | 395 | nil nil (lambda (a _) |
| 396 | (and (stringp a) | ||
| 397 | (string-match-p a "irc://localhost")))) | ||
| 398 | #'erc-compat--29-browse-url-irc)) | ||
| 396 | ((boundp 'browse-url-browser-function) ; 27 | 399 | ((boundp 'browse-url-browser-function) ; 27 |
| 397 | (require 'browse-url) | 400 | (require 'browse-url) |
| 398 | (let ((existing browse-url-browser-function)) | 401 | (let ((existing browse-url-browser-function)) |