]> git.eshelyaron.com Git - emacs.git/commit
Revise FORM-as-function interface in erc-button-alist
authorF. Jason Park <jp@neverwas.me>
Sat, 15 Apr 2023 16:52:05 +0000 (09:52 -0700)
committerF. Jason Park <jp@neverwas.me>
Sat, 6 May 2023 00:18:01 +0000 (17:18 -0700)
commit5adda2f4683fe23efd659fc7418044c8230772c5
tree4c2e3ebc7fd83628da56b6341ed303833239cef6
parent35dd1ade7f1e583f736e6f707343402fe868daec
Revise FORM-as-function interface in erc-button-alist

* lisp/erc/erc-button.el (erc-button-alist): Remove redundant "<URL:
foo>" entry, which adds nothing beyond highlighting the surrounding
bookends at the expense of doubling up on face properties for no
reason.  Revise the FORM-as-function interface by removing the dynamic
binding of face options and treating all implementers as replacements
for `erc-button-add-button'.
(erc-button--maybe-warn-arbitrary-sexp): Make more robust by having it
handle all accepted FORM types other than booleans.
(erc-button-add-buttons-1): Rework to only check FORM field once.
(erc-button--substitute-command-keys-in-region,
erc-button--display-error-with-buttons): Rename former as latter and
change signature to conform to new `erc-button-add-buttons' interface.
(erc-button--display-error-notice-with-keys): Call renamed helper.
* test/lisp/erc/erc-button-tests.el (erc-button-alist--url,
erc-button-tests--form, erc-button-tests--some-var,
erc-button-tests--erc-button-alist--function-as-form,
erc-button-alist--function-as-form,
erc-button-tests--erc-button-alist--nil-form,
erc-button-alist---nil-form): Add tests and helpers.  (Bug#60933)
etc/ERC-NEWS
lisp/erc/erc-button.el
test/lisp/erc/erc-button-tests.el