summaryrefslogtreecommitdiff
path: root/lisp/erc/erc-goodies.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2019-06-14 14:56:04 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2019-06-14 14:56:04 +0200
commit37a61055ffdfcd3b00bc9e972556e8c18262d781 (patch)
tree3d6f7940a023482189733b075c32a3a9ea4d2dd1 /lisp/erc/erc-goodies.el
parentfe12ec4b0d71f8adb572c68c6f662d7783382fb1 (diff)
downloademacs-37a61055ffdfcd3b00bc9e972556e8c18262d781.tar.gz
emacs-37a61055ffdfcd3b00bc9e972556e8c18262d781.tar.bz2
emacs-37a61055ffdfcd3b00bc9e972556e8c18262d781.zip
Adjust erc functions after previous erc-pre-send-function change
* lisp/erc/erc-goodies.el (noncommands): Use erc-pre-send-functions instead of the hook. (erc-send-distinguish-noncommands): Adjust function to new interface. * lisp/erc/erc-ring.el (ring): Ditto. (erc-add-to-input-ring): Ditto. * lisp/erc/erc.el (erc-send-this): Really make obsolete. (erc-pre-send-functions): Change to a list of functions to allow erc-goodies and erc-ring to work as before.
Diffstat (limited to 'lisp/erc/erc-goodies.el')
-rw-r--r--lisp/erc/erc-goodies.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el
index 884c594b9ed..41083829bac 100644
--- a/lisp/erc/erc-goodies.el
+++ b/lisp/erc/erc-goodies.el
@@ -177,18 +177,21 @@ 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."
- ((add-hook 'erc-send-pre-hook 'erc-send-distinguish-noncommands))
- ((remove-hook 'erc-send-pre-hook 'erc-send-distinguish-noncommands)))
+ ((push 'erc-send-distinguish-noncommands erc-pre-send-functions))
+ ((setq erc-pre-send-functions (delq 'erc-send-distinguish-noncommands
+ erc-pre-send-functions))))
(defun erc-send-distinguish-noncommands (str)
"If STR is an ERC non-command, set `erc-insert-this' to nil."
(let* ((command (erc-extract-command-from-line str))
(cmd-fun (and command
(car command))))
- (when (and cmd-fun
- (not (string-match "\n.+$" str))
- (memq cmd-fun erc-noncommands-list))
- (setq erc-insert-this nil))))
+ (if (and cmd-fun
+ (not (string-match "\n.+$" str))
+ (memq cmd-fun erc-noncommands-list))
+ ;; Inhibit sending this string.
+ nil
+ str)))
;;; IRC control character processing.
(defgroup erc-control-characters nil