Article View: gnu.emacs.bug
Article #87759Just a suggestion for rmail ...
From: philkime
Date: Tue, 30 Aug 1994 15:18
Date: Tue, 30 Aug 1994 15:18
29 lines
2023 bytes
2023 bytes
Just a suggestion to help people write mail filters using rmail ... after
much playing around, it seems as though the best place to call filter
functions is from (rmail-get-new-mail) for two main reasons:
* rmail-show-message-hook can't really use (rmail-output-to{-rmail}-file)
as the latter calls (rmail-show-message) and you get into a horrible
recursive mess.
* rmail-mode-hook runs before useful variables are set (mesage counts etc.)
and also only runs once. It also doesn't run when using `g' in rmail.
So, how about a new hook called 'rmail-new-mail-hook ? Replacing the last
line of (rmail-get-new-mail) with
(progn
(rmail-show-message)
(run-hooks 'rmail-new-mail-hook))))
works fine. I can now set this new hook and save and delete mail to
arbitrary folders based on their contents (rmail-output-file-alist is
already there to help do this) every time I either enter rmail or type `g'
in rmail. Very useful.
p
= Phil Kime (philkime@cogsci.ed.ac.uk) =
= http://www.cogsci.ed.ac.uk/~philkime/home.html =
= Centre for Cognitive Science/Dept of Philosophy =
= Edinburgh University =
Technical Details
Message-ID:
<1596.9408301512@scott.cogsci.ed.ac.uk>Path:
arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!redstone.interpath.net!ddsw1!panix!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!math.ohio-state.edu!cis.ohio-state.edu!cogsci.edinburgh.ac.UK!philkimeShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,1db920bfe578838,start X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1994-08-30 08:24:08 PST Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!redstone.interpath.net!ddsw1!panix!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!math.ohio-state.edu!cis.ohio-state.edu!cogsci.edinburgh.ac.UK!philkime From: philkime@cogsci.edinburgh.ac.UK Newsgroups: gnu.emacs.bug Subject: Just a suggestion for rmail ... Date: 30 Aug 1994 11:18:20 -0400 Organization: GNUs Not Usenet Lines: 29 Sender: daemon@cis.ohio-state.edu Approved: bug-gnu-emacs@prep.ai.mit.edu Distribution: gnu Message-ID: <1596.9408301512@scott.cogsci.ed.ac.uk> Reply-To: philkime@cogsci.edinburgh.ac.uk (Phil Kime)