summaryrefslogtreecommitdiff
path: root/lisp/erc/erc-replace.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/erc/erc-replace.el')
-rw-r--r--lisp/erc/erc-replace.el15
1 files changed, 7 insertions, 8 deletions
diff --git a/lisp/erc/erc-replace.el b/lisp/erc/erc-replace.el
index 91fafbb6308..3f69c4cb9cc 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.
@@ -6,7 +6,7 @@
;; Author: Andreas Fuchs <asf@void.at>
;; Maintainer: Amin Bandali <bandali@gnu.org>
;; URL: https://www.emacswiki.org/emacs/ErcReplace
-;; Keywords: IRC, client, Internet
+;; Keywords: comm, IRC, client, Internet
;; This file is part of GNU Emacs.
@@ -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)