unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Someone broke erc-match
@ 2013-02-13  1:55 Aidan Gauland
  2013-02-13  4:02 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Aidan Gauland @ 2013-02-13  1:55 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 878 bytes --]

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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: erc-match ACTION repatch --]
[-- Type: text/x-diff, Size: 810 bytes --]

=== 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


[-- Attachment #3: Type: text/plain, Size: 24 bytes --]


Regards,
Aidan Gauland

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Someone broke erc-match
  2013-02-13  1:55 Someone broke erc-match Aidan Gauland
@ 2013-02-13  4:02 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2013-02-13  4:02 UTC (permalink / raw)
  To: Aidan Gauland; +Cc: emacs-devel

> -                       (re-search-forward (regexp-quote nickname)
> +                       (re-search-forward "\\(\\* \\)?"(regexp-quote nickname)
[...]
> It's not clear what was intended, so I cannot suggest a fix (aside from
> simply reverting).

Sorry, I wish I could say my cat did it.  I obviously wasn't really
awake when I installed your patch (I also messed up the ChangeLog part).

> 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:

Thanks, installed, hopefully I did it right this time!


        Stefan



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-02-13  4:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-13  1:55 Someone broke erc-match Aidan Gauland
2013-02-13  4:02 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).