[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 7121444: Use add/remove-hook on erc-pre-send-functi
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] master 7121444: Use add/remove-hook on erc-pre-send-functions |
Date: |
Wed, 19 Jun 2019 12:20:31 -0400 (EDT) |
branch: master
commit 71214441005c76159a21b2153b6921788bc5152d
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
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.
---
lisp/erc/erc-goodies.el | 5 ++---
lisp/erc/erc-ring.el | 5 ++---
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el
index 7a39105..5e79468 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."
diff --git a/lisp/erc/erc-ring.el b/lisp/erc/erc-ring.el
index ea57fae..453e234 100644
--- a/lisp/erc/erc-ring.el
+++ b/lisp/erc/erc-ring.el
@@ -46,11 +46,10 @@
(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)))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 7121444: Use add/remove-hook on erc-pre-send-functions,
Lars Ingebrigtsen <=