emacs-devel
[Top][All Lists]
Advanced

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

Someone broke erc-match


From: Aidan Gauland
Subject: Someone broke erc-match
Date: Wed, 13 Feb 2013 14:55:48 +1300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

To Stefan Monnier:

When applying my erc-match patch, you broke another part:

=== modified file 'lisp/erc/erc-match.el'
--- lisp/erc/erc-match.el       2013-01-02 16:13:04 +0000
+++ lisp/erc/erc-match.el       2013-02-11 22:53:36 +0000
@@ -447,16 +447,24 @@
                        (nth 0 (erc-parse-user nickuserhost))))
         (old-pt (point))
         (nick-beg (and nickname
-                       (re-search-forward (regexp-quote nickname)
+                       (re-search-forward "\\(\\* \\)?"(regexp-quote nickname)
                                           (point-max) t)

It's not clear what was intended, so I cannot suggest a fix (aside from
simply reverting).

I also submitted a patch that supersedes my patch, which actually caused
an out-of-range error for every non-ACTION message.  Obviously worse
than truncating ACTION messages.  Here's my patch fix:

=== modified file 'lisp/erc/erc-match.el'
--- lisp/erc/erc-match.el       2013-02-11 22:53:36 +0000
+++ lisp/erc/erc-match.el       2013-02-13 01:54:07 +0000
@@ -455,14 +455,14 @@
         (message (buffer-substring
                   (if (and nick-end
                            (<= (+ 2 nick-end) (point-max)))
+                      ;; Message starts 2 characters after the nick
+                      ;; except for CTCP ACTION messages.  Nick
+                      ;; surrounded by angle brackets only in normal
+                      ;; messages.
                       (+ nick-end
-                         ;; Message starts 2 characters after the nick except
-                         ;; for CTCP ACTION messages.
-                         (if (string= "* "
-                                      (buffer-substring (- nick-beg 2)
-                                                        nick-beg))
-                             1
-                           2))
+                         (if (eq ?> (char-after nick-end))
+                             2
+                           1))
                     (point-min))
                   (point-max))))
     (when (and vector

Regards,
Aidan Gauland

reply via email to

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