unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* ERC match ACTION patch
@ 2013-02-11 19:05 Aidan Gauland
  2013-02-11 19:07 ` Aidan Gauland
  0 siblings, 1 reply; 3+ messages in thread
From: Aidan Gauland @ 2013-02-11 19:05 UTC (permalink / raw)
  To: emacs-devel

`erc-match-message' truncates the beginning of ACTION messages.  This
should fix it, but I'm not certain that I have not missed any obscure
edge cases.

–Aidan




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

* Re: ERC match ACTION patch
  2013-02-11 19:05 ERC match ACTION patch Aidan Gauland
@ 2013-02-11 19:07 ` Aidan Gauland
  2013-02-12  3:15   ` Aidan Gauland
  0 siblings, 1 reply; 3+ messages in thread
From: Aidan Gauland @ 2013-02-11 19:07 UTC (permalink / raw)
  To: emacs-devel

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

Aidan Gauland <aidalgol@no8wireless.co.nz> writes:
> `erc-match-message' truncates the beginning of ACTION messages.  This
> should fix it, but I'm not certain that I have not missed any obscure
> edge cases.
>
> –Aidan

Aaaaand here's the patch I forgot.

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

=== 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 18:36:54 +0000
@@ -454,7 +454,15 @@
 		     (match-end 0)))
 	 (message (buffer-substring (if (and nick-end
 					     (<= (+ 2 nick-end) (point-max)))
-					(+ 2 nick-end)
+					(+ 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))
 				      (point-min))
 				    (point-max))))
     (when (and vector


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

* Re: ERC match ACTION patch
  2013-02-11 19:07 ` Aidan Gauland
@ 2013-02-12  3:15   ` Aidan Gauland
  0 siblings, 0 replies; 3+ messages in thread
From: Aidan Gauland @ 2013-02-12  3:15 UTC (permalink / raw)
  To: emacs-devel

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

Aidan Gauland <aidalgol@no8wireless.co.nz> writes:
> `erc-match-message' truncates the beginning of ACTION messages.  This
> should fix it, but I'm not certain that I have not missed any obscure
> edge cases.

Actually, that patch raised an error every time.  The conditional in
this one does not, and is simpler (and should still be correct,
obviously).

–Aidan

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

=== 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-12 03:13:26 +0000
@@ -454,7 +454,14 @@
 		     (match-end 0)))
 	 (message (buffer-substring (if (and nick-end
 					     (<= (+ 2 nick-end) (point-max)))
-					(+ 2 nick-end)
+					;; Message starts 2 characters after
+					;; the nick except for CTCP ACTION
+					;; messages.  Nick surrounded by angle
+					;; brackets only in normal messages.
+					(+ nick-end
+					   (if (eq ?> (char-after nick-end))
+					       2
+					     1))
 				      (point-min))
 				    (point-max))))
     (when (and vector


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

end of thread, other threads:[~2013-02-12  3:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-11 19:05 ERC match ACTION patch Aidan Gauland
2013-02-11 19:07 ` Aidan Gauland
2013-02-12  3:15   ` Aidan Gauland

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).