* On 11 Jan 2015, Peter Davis wrote: 
> I'm trying to use emacs as an alternative pager for mutt. Specifically, I'd 
> like to use the gnus Article mode to display articles. I've
> tried just setting emacsclient as the pager, but I have some questions:
> 
> 1) What exactly is passed to the pager? From my experiments, it appears the 
> message is pre-formatted before passing it to the pager. That
> prevents me from latting the pager format it, so I'd like to avoid this. I 
> tried moving my .mailcap file, but I'm still seeing already
> formatted messages. Is there any way to get mutt to send the whole raw 
> message to the pager?

Yes and no.  In mutt, "paging" always means to format the message for
some kind of text viewer.  If you want to pass the full rfc822 message
data to some external program, you really want "piping" (to mutt's world
view).  So the right approach here is to write a macro that pipes to
your external pager, and bind that to the keystrokes that you associate
mentally with the pager.  Be sure to unset pipe_decode if you really
want the external pager to receive the unadulterated message data.

This doesn't interfere with other uses of <pipe-entry> or your | key --
you're just using the same internal mechanism to view the content in a
particular way.

(I don't know anything about gnus or article-mode, so can't speak to
how well this works in specifics.)


> 2) Does mutt use the same temp filename for passing to the pager that it uses 
> for passing to the editor? I'd like to be able to distinguish
> in emacs, so that pager output gets displayed in gnus Article mode, and 
> replies, etc. that I'm editing get opened in Mail mode.

It uses the same temp file template for generating random temp file
names -- not sure whether that's what you mean.  Can you just invoke
emacs or an emacs shell wrapper with different options?


> 3) Is there some way to keep mutt active while a message is being displayed 
> by a pager? Ultimately, I'd like to have mutt open in emacs in
> one window, and message contents displayed in Article mode in another window. 
> Then I'd like to be able to use keystrokes in the mutt window
> to move to different messages, mailboxes, etc.

You would need a shell script that captures the temporary file content
(or copies it blindly, or hard-links to it) and feeds it to a launch
of your viewer into the background.  This technique generally has been
discussed on the list but offhand I'm not sure what search terms would
find the discussions.  Another old-timer might.

The general idea is that the shell script that mutt is aware of must
terminate for it to move on with things, and mutt will delete the temp
file.  So you capture the file content through some means, eliminate
your dependency on the filename itself, and launch a background viewer
before letting the launcher script exit.

> Is there some more detailed doc. about defining alternate pagers somewhere? 
> All I see in the manual is that you can specify an external pager.

None that I recall, sorry.

-- 
David Champion • d...@bikeshed.us

Reply via email to