From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Aidan Gauland Newsgroups: gmane.emacs.devel Subject: Re: ERC match ACTION patch Date: Tue, 12 Feb 2013 16:15:44 +1300 Message-ID: <87ip5ygr33.fsf@dimension8.tehua.net> References: <87ehgmfz7m.fsf@dimension8.tehua.net> <87a9rafz4q.fsf@dimension8.tehua.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1360638963 23722 80.91.229.3 (12 Feb 2013 03:16:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 12 Feb 2013 03:16:03 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 12 04:16:24 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U56M4-0006H4-EW for ged-emacs-devel@m.gmane.org; Tue, 12 Feb 2013 04:16:24 +0100 Original-Received: from localhost ([::1]:50713 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U56Lk-0000xL-No for ged-emacs-devel@m.gmane.org; Mon, 11 Feb 2013 22:16:04 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:50439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U56Lg-0000xC-L9 for emacs-devel@gnu.org; Mon, 11 Feb 2013 22:16:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U56Lf-0001cO-4N for emacs-devel@gnu.org; Mon, 11 Feb 2013 22:16:00 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:37291) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U56Le-0001c7-Tv for emacs-devel@gnu.org; Mon, 11 Feb 2013 22:15:59 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1U56Lu-00064u-EX for emacs-devel@gnu.org; Tue, 12 Feb 2013 04:16:14 +0100 Original-Received: from 114-134-8-58.rurallink.co.nz ([114.134.8.58]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 12 Feb 2013 04:16:14 +0100 Original-Received: from aidalgol by 114-134-8-58.rurallink.co.nz with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 12 Feb 2013 04:16:14 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 42 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 114-134-8-58.rurallink.co.nz User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:D8MVcLM/PEgH7ecSO2mvL04r1jU= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:156977 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Aidan Gauland 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 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=erc-match-ACTION-fix.patch Content-Description: erc-match ACTION patch === 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 --=-=-=--