From: "Francesco Potortì" <pot@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 29659@debbugs.gnu.org
Subject: bug#29659: Fwd: Re: bug#29659: 25.2; better rmail-summary-by-topic
Date: Wed, 24 Jan 2018 13:00:59 +0100 [thread overview]
Message-ID: <E1eeJjf-0007No-EJ@tucano.isti.cnr.it> (raw)
In-Reply-To: <E1eONBu-0002Ux-4t@tucano.isti.cnr.it>
(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ì" <pot@gnu.org>
Date: Tue, 12 Dec 2017 18:49:20 +0100
To: Eli Zaretskii <eliz@gnu.org>
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 -------
next prev parent reply other threads:[~2018-01-24 12:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-11 12:28 bug#29659: 25.2; better rmail-summary-by-topic Francesco Potortì
2017-12-11 15:35 ` Eli Zaretskii
2017-12-11 15:50 ` Francesco Potortì
2017-12-11 17:37 ` Eli Zaretskii
2017-12-11 17:47 ` Francesco Potortì
2017-12-11 18:08 ` Eli Zaretskii
2017-12-12 17:49 ` Francesco Potortì
2017-12-22 13:50 ` Eli Zaretskii
2018-01-24 12:00 ` Francesco Potortì [this message]
2018-01-26 14:12 ` bug#29659: Fwd: " Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1eeJjf-0007No-EJ@tucano.isti.cnr.it \
--to=pot@gnu.org \
--cc=29659@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.