From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Francesco =?UTF-8?Q?Potort=C3=AC?= Newsgroups: gmane.emacs.bugs Subject: bug#29659: Fwd: Re: bug#29659: 25.2; better rmail-summary-by-topic Date: Wed, 24 Jan 2018 13:00:59 +0100 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Trace: blaine.gmane.org 1516795347 28719 195.159.176.226 (24 Jan 2018 12:02:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 24 Jan 2018 12:02:27 +0000 (UTC) Cc: 29659@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 24 13:02:22 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eeJkp-0006dF-DY for geb-bug-gnu-emacs@m.gmane.org; Wed, 24 Jan 2018 13:02:11 +0100 Original-Received: from localhost ([::1]:44483 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeJmp-0000VT-TB for geb-bug-gnu-emacs@m.gmane.org; Wed, 24 Jan 2018 07:04:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeJkp-0000Ed-I0 for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2018 07:04:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eeJkg-0004CA-FZ for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2018 07:02:11 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60752) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eeJkg-0004Bj-9s for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2018 07:02:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eeJkf-0000JX-Qs for bug-gnu-emacs@gnu.org; Wed, 24 Jan 2018 07:02:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Francesco =?UTF-8?Q?Potort=C3=AC?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Jan 2018 12:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29659 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 29659-submit@debbugs.gnu.org id=B29659.151679526730546 (code B ref 29659); Wed, 24 Jan 2018 12:02:01 +0000 Original-Received: (at 29659) by debbugs.gnu.org; 24 Jan 2018 12:01:07 +0000 Original-Received: from localhost ([127.0.0.1]:40416 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eeJjn-0007wD-83 for submit@debbugs.gnu.org; Wed, 24 Jan 2018 07:01:07 -0500 Original-Received: from mx2.isti.cnr.it ([194.119.192.4]:40177 helo=blade4.isti.cnr.it) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eeJjl-0007tp-LK for 29659@debbugs.gnu.org; Wed, 24 Jan 2018 07:01:06 -0500 Original-Received: from savesent-daemon.mx-all.isti.cnr.it by mx-all.isti.cnr.it (PMDF V6.7-x04 #1884) id <01QO86Y1K3SGFJDABA@mx-all.isti.cnr.it> for 29659@debbugs.gnu.org; Wed, 24 Jan 2018 13:00:56 +0100 (MET) Original-Received: from tucano.isti.cnr.it ([146.48.81.102]) by mx-all.isti.cnr.it (PMDF V6.7-x04 #1884) with ESMTPSA id <01QO86XZQPFMFKM8GW@mx-all.isti.cnr.it>; Wed, 24 Jan 2018 13:00:54 +0100 (MET) Original-Received: from pot by tucano.isti.cnr.it with local (Exim 4.90) (envelope-from ) id 1eeJjf-0007No-EJ; Wed, 24 Jan 2018 13:00:59 +0100 X-INSM-ip-source: 146.48.81.102 Auth Done X-fingerprint: 4B02 6187 5C03 D6B1 2E31 7666 09DF 2DC9 BE21 6115 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:142466 Archived-At: (resending after reopening the bug) There is an obvious error in the following code, which for some reason did work for me but works no more after an Emacs restart. The regexp variable should start with a double backslash: (regexp "\\`[ \t\n]*\\(\\(\\w\\{1,3\\}:\\|\\[[^]]+]\\)[ \t\n]+\\)*")) rather than (regexp "\`[ \t\n]*\\(\\(\\w\\{1,3\\}:\\|\\[[^]]+]\\)[ \t\n]+\\)*")) ------- Start of forwarded message ------- From: "Francesco Potortì" Date: Tue, 12 Dec 2017 18:49:20 +0100 To: Eli Zaretskii CC: 29659@debbugs.gnu.org In-reply-to: <83o9n5rvco.fsf@gnu.org> (eliz@gnu.org) Subject: Re: bug#29659: 25.2; better rmail-summary-by-topic This is my current attempt, seems to work, please give it a try. (defun rmail-simplified-subject (&optional msgnum) "Return the simplified subject of message MSGNUM (or current message). Simplifying the subject means stripping leading and trailing whitespace, replacing whitespace runs with a single space and removing prefixes such as Re:, Fwd: and so on and mailing list tags such as [tag]." (let ((subject (or (rmail-get-header "Subject" msgnum) "")) (regexp "\`[ \t\n]*\\(\\(\\w\\{1,3\\}:\\|\\[[^]]+]\\)[ \t\n]+\\)*")) (setq subject (rfc2047-decode-string subject)) (setq subject (replace-regexp-in-string regexp "" subject)) (replace-regexp-in-string "[ \t\n]+" " " subject))) ------- End of forwarded message -------