]> git.eshelyaron.com Git - emacs.git/commit
Add erc-button helper for substituting command keys
authorF. Jason Park <jp@neverwas.me>
Mon, 19 Dec 2022 03:01:40 +0000 (19:01 -0800)
committerF. Jason Park <jp@neverwas.me>
Sat, 8 Apr 2023 21:23:51 +0000 (14:23 -0700)
commit8184a815aff52cbf1f1b8680d80af2fbf2dce248
treef168a082dd2c4f9bfd8f33fa0700ad175a671093
parent1f1cd467c6afc8100a338e9b44bae8cebfa093f6
Add erc-button helper for substituting command keys

* lisp/erc/erc-button.el (erc-button-mode, erc-button-enable): Warn if
`erc-button-alist' contains deprecated FORM field in `nicknames'
entry.
(erc-button-alist): Discourage arbitrary sexp form for third item of
entries and offer more useful bounds-modifying function in its place.
Mention that anything other than `erc-button-buttonize-nicks' is
deprecated as the FORM field in a `nicknames' entry.  Bump
package-version even though this doesn't introduce a visible change in
the default value.
(erc-button--maybe-warn-arbitrary-sexp): Add helper for validating
third `erc-button-alist' field.
(erc-button--check-nicknames-entry): Add helper to check for
deprecated items in `erc-button-alist'.
(erc-button--preserve-bounds): Add function to serve as default value
for `erc-button--modify-nick-function).
(erc-button--modify-nick-function): Add new variable to hold a
function that filters nickname bounds when buttonizing.
(erc-button--phantom-users, erc-button--add-phantom-speaker,
erc-button--phantom-users-mode): Add new internal minor mode for
treating unseen speakers of PRIVMSGs as known members of the server
for things like coloring nicks during buffer playback.
(erc-button--get-user-from-speaker-naive): Add temporary utility
function to scrape nick from speaker in narrowed buffer.  This will be
replaced by an account-aware version in next major ERC release.
(erc-button-add-nickname-buttons): Accommodate function variant for
"form" field of `erc-button-alist' entries.  Minor optimizations.
This function will likely become the primary juncture for applying
text properties that support nickname-related user-intelligence
features.
(erc-button-add-buttons-1): Show warning when arbitrary sexp for third
"form" field encountered.  Accommodate binary function instead.
(erc-button--substitute-command-keys-in-region): Add helper function
for applying key substitutions in ERC warning messages.
(erc-button--display-error-notice-with-keys): Add new helper function
for displaying ad hoc warnings that possibly require key substitution.
(erc-button--display-error-notice-with-keys-and-warn): Add variant of
`erc-button--display-error-notice-with-keys' that also emits warnings.
* lisp/erc/erc-networks.el (erc-networks--ensure-announced,
erc-networks--on-MOTD-end): Use new key-substitutions helper from
erc-button.
* test/lisp/erc/erc-tests.el
(erc-button--display-error-notice-with-keys): New test.
* test/lisp/erc/resources/base/assoc/bouncer-history/foonet.eld: Add
unknown speaker in channel for phantom store to handle.  Currently
requires manual intervention to leverage.  (Bug#60933.)
lisp/erc/erc-button.el
lisp/erc/erc-networks.el
test/lisp/erc/erc-tests.el
test/lisp/erc/resources/base/assoc/bouncer-history/foonet.eld