diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-08-19 16:48:59 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-08-19 16:48:59 -0700 |
commit | 07fcbb558d797272b9f43547da60beda485873a3 (patch) | |
tree | 77d5da14e9f9d9d8b1d877c70c01296fd3893796 /lisp/erc/erc-replace.el | |
parent | c9bdeff3e45a7ac84a74a81bb048046f82dddc91 (diff) | |
parent | fb81c8c3adf8633f2f617c82f6019aef630860c7 (diff) | |
download | emacs-07fcbb558d797272b9f43547da60beda485873a3.tar.gz |
Merge remote-tracking branch 'origin/master' into athena/unstable
Diffstat (limited to 'lisp/erc/erc-replace.el')
-rw-r--r-- | lisp/erc/erc-replace.el | 15 |
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) |