Discussion:
[VM] html mail: both external and w3m?
emacs user
2012-04-25 11:38:48 UTC
Permalink
hello,
Reading html mail using vm/w3m works pretty well for me most of the time, but occasionally I do want to use an external browser to view a message. Pressing D and then $e on the attachment button then works well, except that the D step takes a very long time and I was wondering if that's just my setup...? also, could anyone suggest how I might: (1) define a function that displays a given message using an external browser, so that I can bind it to some key; (2) is it possible to view every message both in the presentation buffer and in an external browser, simultaneously, side by side? on a large monitor this may be a great option to have...? cheers, E
Uday Reddy
2012-04-28 07:18:13 UTC
Permalink
hello, Reading html mail using vm/w3m works pretty well for me most of the
time, but occasionally I do want to use an external browser to view a
message. Pressing D and then $e on the attachment button then works well,
except that the D step takes a very long time and I was wondering if
that's just my setup...?
I have this problem too. I have it on my to-do list to investigate it. One
guess is is that u-vm-color doesn't handle attachments well. You might try
turning it off and seeing if it makes a difference.

A possible idea here is to *always* display buttons for non-text/plain
parts, so that we can easily fire up external viewers. I will put it on the
wishlist.
also, could anyone suggest how I might: (1)
define a function that displays a given message using an external browser,
so that I can bind it to some key; (2) is it possible to view every
message both in the presentation buffer and in an external browser,
simultaneously, side by side? on a large monitor this may be a great
option to have...? cheers, E
There is no built-in function to display a message in an external viewer.
One has to get the button view first (using `D') and then do ']' and '$e'.
You can try making a keyboard macro for it if it is needed often.

Viewing the message in both VM and external browser is easy if it is a
multipart/alternative message. Just set `vm-mime-multipart-show-method' to
`all' and use the external browser for html. You get the plain text version
shown in VM and the html version shown externally.

If it is not a multipart/alternative message and the message has just one
text/html part, then there is currently no way to feed it to an external
viewer while also displaying it in VM.

Cheers,
Uday
emacs user
2012-04-28 12:13:39 UTC
Permalink
Post by Uday Reddy
hello, Reading html mail using vm/w3m works pretty well for me most of the
time, but occasionally I do want to use an external browser to view a
message. Pressing D and then $e on the attachment button then works well,
except that the D step takes a very long time and I was wondering if
that's just my setup...?
I have this problem too. I have it on my to-do list to investigate it. One
guess is is that u-vm-color doesn't handle attachments well. You might try
turning it off and seeing if it makes a difference.
Hi Uday, this seems to even happen for a message of the type
Content-Type: text/plain; charset="ISO-8859-1"
with no attachments and a length of about 100 characters. as far as I could see the slow part is in the following lines at the very end of vm-decode-mime-message:

(vm-display nil nil '(vm-decode-mime-message)
'(vm-decode-mime-message reading-message)))

although I couldn't go beyond that in spite of several tries. thanks for the ideas below, they don't exactly address the issue, but it's not critical in any case. cheers, E
Post by Uday Reddy
A possible idea here is to *always* display buttons for non-text/plain
parts, so that we can easily fire up external viewers. I will put it on the
wishlist.
also, could anyone suggest how I might: (1)
define a function that displays a given message using an external browser,
so that I can bind it to some key; (2) is it possible to view every
message both in the presentation buffer and in an external browser,
simultaneously, side by side? on a large monitor this may be a great
option to have...? cheers, E
There is no built-in function to display a message in an external viewer.
One has to get the button view first (using `D') and then do ']' and '$e'.
You can try making a keyboard macro for it if it is needed often.
Viewing the message in both VM and external browser is easy if it is a
multipart/alternative message. Just set `vm-mime-multipart-show-method' to
`all' and use the external browser for html. You get the plain text version
shown in VM and the html version shown externally.
If it is not a multipart/alternative message and the message has just one
text/html part, then there is currently no way to feed it to an external
viewer while also displaying it in VM.
Cheers,
Uday
Uday Reddy
2012-04-28 20:38:45 UTC
Permalink
Post by emacs user
Hi Uday, this seems to even happen for a message of the type
Content-Type: text/plain; charset="ISO-8859-1"
with no attachments and a length of about 100 characters. as far as I
could see the slow part is in the following lines at the very end of
(vm-display nil nil '(vm-decode-mime-message)
'(vm-decode-mime-message reading-message)))
Yes, after this line, u-vm-color runs because it places an advice on
vm-decode-mime-message. I have no idea why it is so slow.

If somebody can rewrite it, that would be good!

Cheers,
Uday
emacs user
2012-04-29 05:04:45 UTC
Permalink
Post by Uday Reddy
Post by emacs user
Hi Uday, this seems to even happen for a message of the type
Content-Type: text/plain; charset="ISO-8859-1"
with no attachments and a length of about 100 characters. as far as I
could see the slow part is in the following lines at the very end of
(vm-display nil nil '(vm-decode-mime-message)
'(vm-decode-mime-message reading-message)))
Yes, after this line, u-vm-color runs because it places an advice on
Post by emacs user
Hi Uday, this seems to even happen for a message of the type
Content-Type: text/plain; charset="ISO-8859-1"
with no attachments and a length of about 100 characters. as far as I
could see the slow part is in the following lines at the very end of
(vm-display nil nil '(vm-decode-mime-message)
'(vm-decode-mime-message reading-message)))
Yes, after this line, u-vm-color runs because it places an advice on
vm-decode-mime-message. I have no idea why it is so slow.
brilliant of you... So if I set "enter debug on c-g" and then do control-g while it's taking forever, I get this:
u-vm-color-fontify-regexp(69482 79728781 "^ *[-A-Za-z0-9]*> *.*$" ((0 u-vm-color-citation-1-face)))

my inbox is about 79Mb large; 69482 is the beginning of the text of the first message in the inbox, right after its header. In this case I am applyhing "D" to the very last message. Does this mean that u-vm-color is trying to fontify the entire inbox rather than only the message that is being toggled with "D"?
emacs user
2012-04-29 05:04:45 UTC
Permalink
Post by Uday Reddy
Post by emacs user
Hi Uday, this seems to even happen for a message of the type
Content-Type: text/plain; charset="ISO-8859-1"
with no attachments and a length of about 100 characters. as far as I
could see the slow part is in the following lines at the very end of
(vm-display nil nil '(vm-decode-mime-message)
'(vm-decode-mime-message reading-message)))
Yes, after this line, u-vm-color runs because it places an advice on
Post by emacs user
Hi Uday, this seems to even happen for a message of the type
Content-Type: text/plain; charset="ISO-8859-1"
with no attachments and a length of about 100 characters. as far as I
could see the slow part is in the following lines at the very end of
(vm-display nil nil '(vm-decode-mime-message)
'(vm-decode-mime-message reading-message)))
Yes, after this line, u-vm-color runs because it places an advice on
vm-decode-mime-message. I have no idea why it is so slow.
brilliant of you... So if I set "enter debug on c-g" and then do control-g while it's taking forever, I get this:
u-vm-color-fontify-regexp(69482 79728781 "^ *[-A-Za-z0-9]*> *.*$" ((0 u-vm-color-citation-1-face)))

my inbox is about 79Mb large; 69482 is the beginning of the text of the first message in the inbox, right after its header. In this case I am applyhing "D" to the very last message. Does this mean that u-vm-color is trying to fontify the entire inbox rather than only the message that is being toggled with "D"?
emacs user
2012-04-29 20:47:57 UTC
Permalink
Post by Uday Reddy
Post by emacs user
could see the slow part is in the following lines at the very end of
(vm-display nil nil '(vm-decode-mime-message)
'(vm-decode-mime-message reading-message)))
Yes, after this line, u-vm-color runs because it places an advice on
vm-decode-mime-message. I have no idea why it is so slow.
u-vm-color-fontify-regexp(69482 79728781 "^ *[-A-Za-z0-9]*> *.*$" ((0 u-vm-color- >citation-1-face)))
my inbox is about 79Mb large; 69482 is the beginning of the text of the first message in the
inbox, right after its header. In this case I am applying "D" to the very last message. Does
this mean that u-vm-color is trying to fontify the entire inbox rather than only the message
that is being toggled with "D"?
so the recommended advice in the u-vm-color file header is to use

;; (defadvice vm-decode-mime-message (after u-vm-color activate)
;; (u-vm-color-fontify-buffer-even-more))

this function does (widen), and perhaps that's too much of a widening?
if I change to this advice:
(defadvice vm-decode-mime-message (after u-vm-color activate)
(u-vm-color-fontify-buffer))
I think things are a bit better. perhaps you can see if this works for you too.
Uday Reddy
2012-04-30 11:09:01 UTC
Permalink
Post by emacs user
so the recommended advice in the u-vm-color file header is to use
;; (defadvice vm-decode-mime-message (after u-vm-color activate)
;; (u-vm-color-fontify-buffer-even-more))
this function does (widen), and perhaps that's too much of a widening?
Yes, in fact, u-vm-color warns you that doing this will slow things down.

Unfortunately, VM's message displaying code is very complicated with the
control going back and forth between vm-decode-mime-message,
vm-present-current-message and vm-show-current-message. The way things
stand, it is probably not possible to write u-vm-color properly. Those
advices should not be necessary in an ideal world.

I will have to find time to straighten this out at some point...

Cheers,
Uday

emacs user
2012-04-29 20:47:57 UTC
Permalink
Post by Uday Reddy
Post by emacs user
could see the slow part is in the following lines at the very end of
(vm-display nil nil '(vm-decode-mime-message)
'(vm-decode-mime-message reading-message)))
Yes, after this line, u-vm-color runs because it places an advice on
vm-decode-mime-message. I have no idea why it is so slow.
u-vm-color-fontify-regexp(69482 79728781 "^ *[-A-Za-z0-9]*> *.*$" ((0 u-vm-color- >citation-1-face)))
my inbox is about 79Mb large; 69482 is the beginning of the text of the first message in the
inbox, right after its header. In this case I am applying "D" to the very last message. Does
this mean that u-vm-color is trying to fontify the entire inbox rather than only the message
that is being toggled with "D"?
so the recommended advice in the u-vm-color file header is to use

;; (defadvice vm-decode-mime-message (after u-vm-color activate)
;; (u-vm-color-fontify-buffer-even-more))

this function does (widen), and perhaps that's too much of a widening?
if I change to this advice:
(defadvice vm-decode-mime-message (after u-vm-color activate)
(u-vm-color-fontify-buffer))
I think things are a bit better. perhaps you can see if this works for you too.
emacs user
2012-04-28 12:13:39 UTC
Permalink
Post by Uday Reddy
hello, Reading html mail using vm/w3m works pretty well for me most of the
time, but occasionally I do want to use an external browser to view a
message. Pressing D and then $e on the attachment button then works well,
except that the D step takes a very long time and I was wondering if
that's just my setup...?
I have this problem too. I have it on my to-do list to investigate it. One
guess is is that u-vm-color doesn't handle attachments well. You might try
turning it off and seeing if it makes a difference.
Hi Uday, this seems to even happen for a message of the type
Content-Type: text/plain; charset="ISO-8859-1"
with no attachments and a length of about 100 characters. as far as I could see the slow part is in the following lines at the very end of vm-decode-mime-message:

(vm-display nil nil '(vm-decode-mime-message)
'(vm-decode-mime-message reading-message)))

although I couldn't go beyond that in spite of several tries. thanks for the ideas below, they don't exactly address the issue, but it's not critical in any case. cheers, E
Post by Uday Reddy
A possible idea here is to *always* display buttons for non-text/plain
parts, so that we can easily fire up external viewers. I will put it on the
wishlist.
also, could anyone suggest how I might: (1)
define a function that displays a given message using an external browser,
so that I can bind it to some key; (2) is it possible to view every
message both in the presentation buffer and in an external browser,
simultaneously, side by side? on a large monitor this may be a great
option to have...? cheers, E
There is no built-in function to display a message in an external viewer.
One has to get the button view first (using `D') and then do ']' and '$e'.
You can try making a keyboard macro for it if it is needed often.
Viewing the message in both VM and external browser is easy if it is a
multipart/alternative message. Just set `vm-mime-multipart-show-method' to
`all' and use the external browser for html. You get the plain text version
shown in VM and the html version shown externally.
If it is not a multipart/alternative message and the message has just one
text/html part, then there is currently no way to feed it to an external
viewer while also displaying it in VM.
Cheers,
Uday
Continue reading on narkive:
Loading...