]> git.eshelyaron.com Git - emacs.git/commitdiff
Use add/remove-hook on erc-pre-send-functions
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 19 Jun 2019 16:20:22 +0000 (18:20 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 19 Jun 2019 16:20:22 +0000 (18:20 +0200)
* lisp/erc/erc-goodies.el (noncommands): Ditto.

* lisp/erc/erc-ring.el (ring): Use add/remove-hook.

lisp/erc/erc-goodies.el
lisp/erc/erc-ring.el

index 7a3910567ab6a78efd73bce9d61d2c6994b7b7a7..5e7946810be924de3fa4afa80bd59e2ec8d9edac 100644 (file)
@@ -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."
index ea57faebc4562fd1791a395de91f929c31b2343e..453e234a37a750acc926a7f948fd8458d31da2d5 100644 (file)
 (define-erc-module ring nil
   "Stores input in a ring so that previous commands and messages can
 be recalled using M-p and M-n."
-  ((cl-pushnew 'erc-add-to-input-ring erc-pre-send-functions)
+  ((add-hook 'erc-pre-send-functions 'erc-add-to-input-ring)
    (define-key erc-mode-map "\M-p" 'erc-previous-command)
    (define-key erc-mode-map "\M-n" 'erc-next-command))
-  ((setq erc-pre-send-functions (delq 'erc-add-to-input-ring
-                                      erc-pre-send-functions))
+  ((remove-hook 'erc-pre-send-functions 'erc-add-to-input-ring)
    (define-key erc-mode-map "\M-p" 'undefined)
    (define-key erc-mode-map "\M-n" 'undefined)))