Ignore erc-response objects in error-notice helper

* lisp/erc/erc-button.el (erc-button--display-error-notice-with-keys):
Remove `parsed' `erc-response' positional parameter, and don't pass it
to `erc-display-message' because the latter adds text properties
derived from such an object.  These properties can confuse other code
operating on an inserted error-notice message into thinking it
originated from the server.
* lisp/erc/erc-common.el (erc--with-dependent-type-match): Make macro
more readable.
* lisp/erc/erc-networks.el (erc-networks--set-name,
erc-networks--ensure-announced, erc-networks-on-MOTD-end): Remove
`erc-response' objects from inserted error-notices.
* test/lisp/erc/erc-button-tests.el
(erc-button--display-error-notice-with-keys): Add assertions for
overloaded first parameter.
* test/lisp/erc/erc-tests.el (erc--with-dependent-type-match): Update
expected expansion.
This commit is contained in:
F. Jason Park 2023-08-17 19:18:50 -07:00
parent 2b311a47dd
commit 75b3fb3cb4
5 changed files with 68 additions and 44 deletions

View file

@ -475,12 +475,11 @@ Use the CASEMAPPING ISUPPORT parameter to determine the style."
(defmacro erc--with-dependent-type-match (type &rest features)
"Massage Custom :type TYPE with :match function that pre-loads FEATURES."
`(backquote (,(car type)
:match
,(list '\, `(lambda (w v)
`(backquote-list* ',(car type)
:match (lambda (w v)
,@(mapcar (lambda (ft) `(require ',ft)) features)
(,(widget-get (widget-convert type) :match) w v)))
,@(cdr type))))
(,(widget-get (widget-convert type) :match) w v))
',(cdr type)))
(provide 'erc-common)