[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nmh-workers] exciting new stuff for 2.0
From: |
Ralph Corderoy |
Subject: |
Re: [Nmh-workers] exciting new stuff for 2.0 |
Date: |
Wed, 08 Feb 2012 21:56:59 +0000 |
Hi Paul,
> > (My ~/bin/readlp abuses lesskey(1) so little-used keys in less for
> > reading email, e.g. D, do "quit ^@", and this is picked up by the
> > script which then adds it to the "delete" sequence and moves onto
> > the next email to show. N - next, P - previous, S - spam, etc.)
>
> okay, that's subtle, and very cool. from the lesskey manpage: "The
> extra string has a special meaning for the "quit" action: when less
> quits, first character of the extra string is used as its exit
> status."
>
> nice trick. care to share your readlp script? i use less to read a
> pre-formatted concatenation of unread messages, but then i have to
> delete the unwanted ones specifically when i'm done.
That's what I used to do, fine if `rmm lp' was the typical next command.
Or I'd read them singularly but get fed up with `q' to quit less and a
local shorthand for `rmm; show lp:next' after each one, even q,
cursor-up, Enter, is two too many.
I don't think my readlp would be much use to anyone else; too many
dependencies on ~/bin. The idea's pretty simple, it plods linearly back
and forth through sequence lp, my default pick's sequence, maintaining
three sequences which are cleared at the beginning; keep, delete, spam.
Whenever I move backwards I remove the new `cur' from those three so I'm
forced to choose again. Nothing happens to them automatically at the
end, they're just defined for me to use as I see fit.
A bit of mucking around with awk means that less is fed at least the
number of lines used by the terminal less a little, this ensure less's
END prompt is consistently placed. The awk also put a bit up front of
show's output, e.g.
Sample for List 2/20
(Message inbox:6329)
from: Bryan Hogan <address@hidden>
subject: Re: [Rpcemu] Some ques re RPCemu-0.8.9 on Linux
to: address@hidden
date: Mon, 06 Feb 2012 01:57:02 GMT
shows I'm on 2 out of 20 and `readlp Sample for List' was run. (First
line is in bold.) (I've a ~/bin/readmail that runs readlp after any
pick that's successful and it passes a title describing this sequence's
topic.)
I use show for the email, though `M' kicks off mhshow on the current
email instead; that's a child of readlp, on exitting that less in the
normal manner I'm back in the abused less looking at show's output of
the same email again.
H runs lynx/links on the HTML body. U runs, effectively, `urlview
$(mhpath .)', so I can quickly open URLs in the email without needing
the mouse. Seeing what URLs are in an email can also be handy for
spotting spam that's got through.
I move back and forth through the sequence with ...:prev and :next,
getting the message number of cur with scan and comparing it with
the, gathered once, :first and :last. If I try and N or P past the ends
then the awk-generated header line has an inverse "...at end of lp"
addition and I stay put. I should change this really, I'd like to
instead view a "blank" email as sometimes I end up hitting N a few times
on mails that are very similar before I realise I'm at the end.
Cheers, Ralph.