diff options
Diffstat (limited to 'lisp/erc/erc-replace.el')
-rw-r--r-- | lisp/erc/erc-replace.el | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lisp/erc/erc-replace.el b/lisp/erc/erc-replace.el index c67d7514037..d08d9850c10 100644 --- a/lisp/erc/erc-replace.el +++ b/lisp/erc/erc-replace.el @@ -1,4 +1,4 @@ -;; erc-replace.el -- wash and massage messages inserted into the buffer +;; erc-replace.el -- wash and massage messages inserted into the buffer -*- lexical-binding: t; -*- ;; Copyright (C) 2001-2002, 2004, 2006-2021 Free Software Foundation, ;; Inc. @@ -49,7 +49,6 @@ expression or a variable, or any sexp, TO can be a string or a function to call, or any sexp. If a function, it will be called with one argument, the string to be replaced, and it should return a replacement string." - :group 'erc-replace :type '(repeat (cons :tag "Search & Replace" (choice :tag "From" regexp @@ -68,23 +67,23 @@ It replaces text according to `erc-replace-alist'." (let ((from (car elt)) (to (cdr elt))) (unless (stringp from) - (setq from (eval from))) + (setq from (eval from t))) (while (re-search-forward from nil t) (cond ((stringp to) (replace-match to)) - ((and (symbolp to) (fboundp to)) + ((functionp to) (replace-match (funcall to (match-string 0)))) (t - (eval to)))))) + (eval to t)))))) erc-replace-alist)) ;;;###autoload(autoload 'erc-replace-mode "erc-replace") (define-erc-module replace nil "This mode replaces incoming text according to `erc-replace-alist'." ((add-hook 'erc-insert-modify-hook - 'erc-replace-insert)) + #'erc-replace-insert)) ((remove-hook 'erc-insert-modify-hook - 'erc-replace-insert))) + #'erc-replace-insert))) (provide 'erc-replace) |