Gnus development mailing list
 help / color / mirror / Atom feed
* Article mode for raw email message?
@ 2015-01-11 19:10 Peter Davis
  2015-01-11 19:34 ` Dave Goldberg
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Peter Davis @ 2015-01-11 19:10 UTC (permalink / raw)
  To: ding


I'm trying to open a raw email message file in Article mode, hoping that
it will look like it does in gnus ... headers hidden, text highlighting,
clickable links, etc.

Unfortunately, though, it's not working. When I open the file and then
explicitly select article mode, I still just see the raw text of the
file.

I did run gnus and then exit, so gnus-article-mode was defined.

Is there a way to do this?

Thank you!

-pd




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Article mode for raw email message?
  2015-01-11 19:10 Article mode for raw email message? Peter Davis
@ 2015-01-11 19:34 ` Dave Goldberg
  2015-01-12 12:20   ` Peter Davis
  2015-01-11 19:51 ` Adam Sjøgren
  2015-01-13 15:22 ` Peter Davis
  2 siblings, 1 reply; 9+ messages in thread
From: Dave Goldberg @ 2015-01-11 19:34 UTC (permalink / raw)
  To: ding

> I'm trying to open a raw email message file in Article mode, hoping that
> it will look like it does in gnus ... headers hidden, text highlighting,
> clickable links, etc.
>
> Unfortunately, though, it's not working. When I open the file and then
> explicitly select article mode, I still just see the raw text of the
> file.
>
> I did run gnus and then exit, so gnus-article-mode was defined.
>
> Is there a way to do this?

It's been years since I did the same thing so even if I still had my function around it would likely not be relevant anymore.  It wasn't as simple as running gnus-article-mode which is more about setting up key bindings and the like, but it wasn't too difficult.  You need to look at the source for gnus-summary-display-article as a starting point and figure out from there what functions to call within the article buffer to do the washing, header display, buttonizing etc that you want to have happen.

-- 
Dave Goldberg
david.goldberg6@verizon.net



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Article mode for raw email message?
  2015-01-11 19:10 Article mode for raw email message? Peter Davis
  2015-01-11 19:34 ` Dave Goldberg
@ 2015-01-11 19:51 ` Adam Sjøgren
  2015-01-12 12:22   ` Peter Davis
  2015-01-13 15:22 ` Peter Davis
  2 siblings, 1 reply; 9+ messages in thread
From: Adam Sjøgren @ 2015-01-11 19:51 UTC (permalink / raw)
  To: ding

Peter writes:

> I'm trying to open a raw email message file in Article mode, hoping that
> it will look like it does in gnus ... headers hidden, text highlighting,
> clickable links, etc.

[...]

> Is there a way to do this?

Not the same, but related: You can open a file in Gnus as a foreign
group from the *Group* buffer:

,----
| G f runs the command gnus-group-make-doc-group, which is an
| interactive compiled Lisp function in `gnus-group.el'.
| 
| It is bound to G f, <menu-bar> <Groups> <Foreign groups> <Make a doc
| group...>.
| 
| (gnus-group-make-doc-group FILE TYPE)
| 
| Create a group that uses a single file as the source.
| 
| If called with a prefix argument, ask for the file type.
`----

Maybe that'll work?


  Best regard,

    Adam

-- 
 "Äter ni middag?"                                            Adam Sjøgren
                                                         asjo@koldfront.dk




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Article mode for raw email message?
  2015-01-11 19:34 ` Dave Goldberg
@ 2015-01-12 12:20   ` Peter Davis
  0 siblings, 0 replies; 9+ messages in thread
From: Peter Davis @ 2015-01-12 12:20 UTC (permalink / raw)
  To: ding

david.goldberg6@verizon.net (Dave Goldberg) writes:

>> I'm trying to open a raw email message file in Article mode, hoping that
>> it will look like it does in gnus ... headers hidden, text highlighting,
>> clickable links, etc.
>>
>> Unfortunately, though, it's not working. When I open the file and then
>> explicitly select article mode, I still just see the raw text of the
>> file.
>>
>> I did run gnus and then exit, so gnus-article-mode was defined.
>>
>> Is there a way to do this?
>
> It's been years since I did the same thing so even if I still had my function around it would likely not be relevant anymore.  It wasn't as
> simple as running gnus-article-mode which is more about setting up key bindings and the like, but it wasn't too difficult.  You need to look
> at the source for gnus-summary-display-article as a starting point and figure out from there what functions to call within the article
> buffer to do the washing, header display, buttonizing etc that you want to have happen.

Thanks, David. I'm not a lisp maven, so I was hoping for something
simple and straightforward, but I'll see what I can figure out from the
code. 

Thanks!
-pd



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Article mode for raw email message?
  2015-01-11 19:51 ` Adam Sjøgren
@ 2015-01-12 12:22   ` Peter Davis
  2015-01-12 14:23     ` Adam Sjøgren
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Davis @ 2015-01-12 12:22 UTC (permalink / raw)
  To: Adam Sjøgren; +Cc: ding

asjo@koldfront.dk (Adam Sjøgren) writes:

> Peter writes:
>
>> I'm trying to open a raw email message file in Article mode, hoping that
>> it will look like it does in gnus ... headers hidden, text highlighting,
>> clickable links, etc.
>
> [...]
>
>> Is there a way to do this?
>
> Not the same, but related: You can open a file in Gnus as a foreign
> group from the *Group* buffer:
>
> ,----
> | G f runs the command gnus-group-make-doc-group, which is an
> | interactive compiled Lisp function in `gnus-group.el'.
> | 
> | It is bound to G f, <menu-bar> <Groups> <Foreign groups> <Make a doc
> | group...>.
> | 
> | (gnus-group-make-doc-group FILE TYPE)
> | 
> | Create a group that uses a single file as the source.
> | 
> | If called with a prefix argument, ask for the file type.
> `----
>
> Maybe that'll work?

Thanks, Adam. Ultimately I'm hoping to trigger this from a script which
writes the message to a temp file and calls emacsclient to open it, but
maybe I can learn something from the code of this function.

Thanks!
-pd



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Article mode for raw email message?
  2015-01-12 12:22   ` Peter Davis
@ 2015-01-12 14:23     ` Adam Sjøgren
  2015-01-12 14:34       ` Peter Davis
  0 siblings, 1 reply; 9+ messages in thread
From: Adam Sjøgren @ 2015-01-12 14:23 UTC (permalink / raw)
  To: ding

Peter writes:

> Ultimately I'm hoping to trigger this from a script which writes the
> message to a temp file and calls emacsclient to open it, but maybe I
> can learn something from the code of this function.

Sounds fancy - I can't figure out when I would use something like that;
what are you going to use it for?


  Best regards,

    Adam

-- 
 "Soon we'll have spent a whole month at sea,                 Adam Sjøgren
  splitting atoms for no apparent reason"                asjo@koldfront.dk




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Article mode for raw email message?
  2015-01-12 14:23     ` Adam Sjøgren
@ 2015-01-12 14:34       ` Peter Davis
  2015-01-12 17:43         ` Adam Sjøgren
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Davis @ 2015-01-12 14:34 UTC (permalink / raw)
  To: Adam Sjøgren; +Cc: ding

asjo@koldfront.dk (Adam Sjøgren) writes:

> Peter writes:
>
>> Ultimately I'm hoping to trigger this from a script which writes the
>> message to a temp file and calls emacsclient to open it, but maybe I
>> can learn something from the code of this function.
>
> Sounds fancy - I can't figure out when I would use something like that;
> what are you going to use it for?

Forgive the heresy, but after using both mutt and gnus (and a slew of
other email clients) for years, I'm of the opinion that mutt is
generally faster and easier to use, but gnus article mode really
displays messages more attractively and usefully than mutt.

So I'm thinking of trying to set things up so I have mutt running an
emacs ansiterminal window. When I display a message, I would use mutt's pipe command
to send the message to a temp file, which I would then pass to
emacsclient to open in another window, hopefully in Article mode. I'm
not sure how feasible this is, but it seems the major pieces are there
in mutt and gnus, and it would be a matter of creating some glue to pull
all the bits together.

I welcome any thoughts or suggestions about how to accomplish this, or
why it's not possible.

Thanks!!

-pd




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Article mode for raw email message?
  2015-01-12 14:34       ` Peter Davis
@ 2015-01-12 17:43         ` Adam Sjøgren
  0 siblings, 0 replies; 9+ messages in thread
From: Adam Sjøgren @ 2015-01-12 17:43 UTC (permalink / raw)
  To: ding

Peter writes:

> Forgive the heresy, but after using both mutt and gnus (and a slew of
> other email clients) for years, I'm of the opinion that mutt is
> generally faster and easier to use, but gnus article mode really
> displays messages more attractively and usefully than mutt.

Ahh, ok. In my experience every person has a different religion when it
comes to email, so I don't consider anything heresy.

Ok, except Outlook.


  Best regards,

    Adam

-- 
 "I say, either agree with me or take a hike! I'm             Adam Sjøgren
  right, period! End of discussion!"                     asjo@koldfront.dk




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Article mode for raw email message?
  2015-01-11 19:10 Article mode for raw email message? Peter Davis
  2015-01-11 19:34 ` Dave Goldberg
  2015-01-11 19:51 ` Adam Sjøgren
@ 2015-01-13 15:22 ` Peter Davis
  2 siblings, 0 replies; 9+ messages in thread
From: Peter Davis @ 2015-01-13 15:22 UTC (permalink / raw)
  To: ding

On Sun, Jan 11, 2015 at 02:10:36PM -0500, Peter Davis wrote:
> 
> I'm trying to open a raw email message file in Article mode, hoping that
> it will look like it does in gnus ... headers hidden, text highlighting,
> clickable links, etc.
> 
> Unfortunately, though, it's not working. When I open the file and then
> explicitly select article mode, I still just see the raw text of the
> file.
> 
> I did run gnus and then exit, so gnus-article-mode was defined.
> 
> Is there a way to do this?

To follow up a bit, it turns out the perl script I'm using to "pipe" mail messages (courtesy of Mark Aufflick <http://mark.aufflick.com/o/886457>) to emacsclient does this:

        system(qq{$emacsclient -n --eval '(with-current-buffer "$buffer_name" (goto-char (point-max)) (insert "} . $acc . qq{"))'})

It's essentially passing in the entire buffer contents as a string. So it seems to me it should be possible to define a function to process that string as the contents of a mail
message and open it in Article mode. Then I guess --eval could invoke that function with the buffer name and content string as arguments. (As I said, I'm not a lisp maven, so
forgive me if I'm stating the obvious.)

Now I just have to figure out how to write that function.

Thanks,
-pd


-- 
----
Peter Davis
The Tech Curmudgeon
www.techcurmudgeon.com



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-01-13 15:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-11 19:10 Article mode for raw email message? Peter Davis
2015-01-11 19:34 ` Dave Goldberg
2015-01-12 12:20   ` Peter Davis
2015-01-11 19:51 ` Adam Sjøgren
2015-01-12 12:22   ` Peter Davis
2015-01-12 14:23     ` Adam Sjøgren
2015-01-12 14:34       ` Peter Davis
2015-01-12 17:43         ` Adam Sjøgren
2015-01-13 15:22 ` Peter Davis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).