summaryrefslogtreecommitdiff
path: root/lisp/erc/erc-goodies.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2019-06-19 18:20:22 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2019-06-19 18:20:22 +0200
commit71214441005c76159a21b2153b6921788bc5152d (patch)
treef91a41314f5837978be00ace628b95389dfe6336 /lisp/erc/erc-goodies.el
parentfc8a8bdb7f19db2032b7e6108ba8de9d57c7acd4 (diff)
downloademacs-71214441005c76159a21b2153b6921788bc5152d.tar.gz
Use add/remove-hook on erc-pre-send-functions
* lisp/erc/erc-goodies.el (noncommands): Ditto. * lisp/erc/erc-ring.el (ring): Use add/remove-hook.
Diffstat (limited to 'lisp/erc/erc-goodies.el')
-rw-r--r--lisp/erc/erc-goodies.el5
1 files changed, 2 insertions, 3 deletions
diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el
index 7a3910567ab..5e7946810be 100644
--- a/lisp/erc/erc-goodies.el
+++ b/lisp/erc/erc-goodies.el
@@ -177,9 +177,8 @@ does not appear in the ERC buffer after the user presses ENTER.")
"This mode distinguishes non-commands.
Commands listed in `erc-insert-this' know how to display
themselves."
- ((cl-pushnew 'erc-send-distinguish-noncommands erc-pre-send-functions))
- ((setq erc-pre-send-functions (delq 'erc-send-distinguish-noncommands
- erc-pre-send-functions))))
+ ((add-hook 'erc-pre-send-functions 'erc-send-distinguish-noncommands))
+ ((remove-hook 'erc-pre-send-functions 'erc-send-distinguish-noncommands)))
(defun erc-send-distinguish-noncommands (state)
"If STR is an ERC non-command, set `insertp' in STATE to nil."