erc-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Erc-discuss] suggestion: have erc-cmd-IGNORE regexp-quote the supplied


From: Eric Hanchrow
Subject: [Erc-discuss] suggestion: have erc-cmd-IGNORE regexp-quote the supplied name
Date: Tue, 18 Jul 2006 18:18:59 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.51 (gnu/linux)

Often I want to ignore someone whose nick happens to contain
characters that are special in regular expressions.  For example,
someone's nick was something like

        idiot[abcd]

and I ignored him; I was alarmed to continue to see messages from him,
until I realized that I was not actually ignoring the string
"idiot[abcd]", but rather the four strings

        idiota
        idiotb
        idiotc
        idiotd

So I made this tiny hack.

I suspect this will bite people who are used to typing in actual
regular expressions; I can't think of a nice way to provide both
behaviors.

Anyway it's something to think about.

--- orig/lisp/erc/erc.el
+++ mod/lisp/erc/erc.el
@@ -2507,6 +2507,8 @@
 (defun erc-cmd-IGNORE (&optional user)
   "Ignore USER.  This should be a regexp matching address@hidden
 If no USER argument is specified, list the contents of `erc-ignore-list'."
+  (when user
+    (setq user (regexp-quote user)))
   (if user
       (progn
        (erc-display-line

-- 
I shrivel inside each time [Star Wars] is mentioned.
        -- Sir Alec Guinness





reply via email to

[Prev in Thread] Current Thread [Next in Thread]