1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-26 07:33:47 +00:00

; Really respect browse-url var in erc-compat

* lisp/erc/erc-compat.el: Do what was supposed to be done by
75f26646d4 "; Be nicer when updating
browse-url var in erc-compat".  This is the less harmful version of
that patch (from bug#59976#8) but without the cl-lib requirement since
users may not want to load the main ERC library right away.
* lisp/erc/erc.el: Clarify some comments regarding the core API.
This commit is contained in:
F. Jason Park 2022-12-11 19:16:07 -08:00
parent 64163618d2
commit 63cdbd986b
2 changed files with 11 additions and 11 deletions

View File

@ -391,11 +391,11 @@ If START or END is negative, it counts from the end."
(cond ((fboundp 'browse-url-irc)) ; 29 (cond ((fboundp 'browse-url-irc)) ; 29
((boundp 'browse-url-default-handlers) ; 28 ((boundp 'browse-url-default-handlers) ; 28
(setf (alist-get "\\`irc6?s?://" browse-url-default-handlers (add-to-list 'browse-url-default-handlers
nil nil (lambda (a _) '("\\`irc6?s?://" . erc-compat--29-browse-url-irc)
(and (stringp a) nil (lambda (_ a)
(string-match-p a "irc://localhost")))) (and (stringp (car-safe a))
#'erc-compat--29-browse-url-irc)) (string-match-p (car a) "irc://localhost")))))
((boundp 'browse-url-browser-function) ; 27 ((boundp 'browse-url-browser-function) ; 27
(require 'browse-url) (require 'browse-url)
(let ((existing browse-url-browser-function)) (let ((existing browse-url-browser-function))

View File

@ -1765,8 +1765,7 @@ all channel buffers on all servers."
;; to, it was never realized. ;; to, it was never realized.
;; ;;
;; New library code should use the `erc--target' struct instead. ;; New library code should use the `erc--target' struct instead.
;; Third-party code can continue to use this until a getter for ;; Third-party code can continue to use this and `erc-default-target'.
;; `erc--target' (or whatever replaces it) is exported.
(defvar-local erc-default-recipients nil (defvar-local erc-default-recipients nil
"List of default recipients of the current buffer.") "List of default recipients of the current buffer.")
@ -6012,13 +6011,14 @@ See also `erc-downcase'."
;; While `erc-default-target' happens to return nil in channel buffers ;; While `erc-default-target' happens to return nil in channel buffers
;; you've parted or from which you've been kicked, using it to detect ;; you've parted or from which you've been kicked, using it to detect
;; whether a channel is currently joined may become unreliable in the ;; whether a channel is currently joined may become unreliable in the
;; future. For now, new code should consider using ;; future. For now, third-party code can use
;; ;;
;; (erc-get-channel-user (erc-current-nick)) ;; (erc-get-channel-user (erc-current-nick))
;; ;;
;; and expect a nicer option eventually. For retrieving a target ;; A predicate may be provided eventually. For retrieving a target's
;; regardless of subscription or connection status, use replacements ;; name regardless of subscription or connection status, new library
;; based on `erc--target' instead. See also `erc--default-target'. ;; code should use `erc--default-target'. Third-party code should
;; continue to use `erc-default-target'.
(defun erc-default-target () (defun erc-default-target ()
"Return the current default target (as a character string) or nil if none." "Return the current default target (as a character string) or nil if none."