Discussion:
Article mode for raw email message?
Peter Davis
2015-01-11 19:10:36 UTC
Permalink
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
Dave Goldberg
2015-01-11 19:34:27 UTC
Permalink
Post by Peter Davis
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
***@verizon.net
Peter Davis
2015-01-12 12:20:19 UTC
Permalink
Post by Dave Goldberg
Post by Peter Davis
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
Adam Sjøgren
2015-01-11 19:51:33 UTC
Permalink
Post by Peter Davis
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.
[...]
Post by Peter Davis
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
***@koldfront.dk
Peter Davis
2015-01-12 12:22:34 UTC
Permalink
Post by Adam Sjøgren
Post by Peter Davis
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.
[...]
Post by Peter Davis
Is there a way to do this?
Not the same, but related: You can open a file in Gnus as a foreign
,----
| 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
Adam Sjøgren
2015-01-12 14:23:26 UTC
Permalink
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" ***@koldfront.dk
Peter Davis
2015-01-12 14:34:12 UTC
Permalink
Post by Adam Sjøgren
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
Adam Sjøgren
2015-01-12 17:43:46 UTC
Permalink
Post by Peter Davis
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!" ***@koldfront.dk
Peter Davis
2015-01-13 15:22:28 UTC
Permalink
Post by Peter Davis
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
Loading...