Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[VM] Time to move to Mutt?

21 views
Skip to first unread message

John Stoffel

unread,
Jul 19, 2019, 3:45:03 PM7/19/19
to viewma...@nongnu.org

Hi all,
After way too many years to mention, I'm starting to think that
viewmail is a dead project. I can't do elisp programming, so it's
probably time to move to mutt as my CLI based mail reader.

Has anyone setup a keybindings file for mutt to emulate the VM
bindings? Otherwise I'm in for a long long long time rebinding my
fingers to read email and reply and edit and manage. And I just don't
think I can do it. *grin*

I really just love the way VM works, but it's getting flakier and
flakier as more an more email goes HTML based and it's just hard to
handle at time.

John

Daniel Barrett

unread,
Jul 19, 2019, 4:23:38 PM7/19/19
to jo...@stoffel.org, viewma...@nongnu.org
On July 19, 2019, John Stoffel wrote:
>I really just love the way VM works, but it's getting flakier and
>flakier as more an more email goes HTML based and it's just hard to
>handle at time.

What specific issues are you encountering?

I deal with HTML mail with a single middle-click that sends the
message to Chrome. If I'm connected to my computer by SSH (no
Chrome), I instead view the message with lynx.

VM has its warts, but it's the only mail client I've found that
handles 4000+ mail folders with ease (thanks to Emacs auto-complete in
the minibuffer) and has vm-pcrisis.el so I can respond with different
>From addresses.

--
Dan Barrett
dbar...@blazemonger.com


John Stoffel

unread,
Jul 19, 2019, 4:39:34 PM7/19/19
to Daniel Barrett, jo...@stoffel.org, viewma...@nongnu.org
>>>>> "Daniel" == Daniel Barrett <dbar...@blazemonger.com> writes:

Daniel> On July 19, 2019, John Stoffel wrote:
>> I really just love the way VM works, but it's getting flakier and
>> flakier as more an more email goes HTML based and it's just hard to
>> handle at time.

Daniel> What specific issues are you encountering?

Well... it's a pain visiting IMAP vs plain folders, so now I have two
sets of key bindings in message mode:

v = visit folder
i = visit IMAP folder
w = save to IMAP folder
s = save to folder

which is just clunky. HTML email is just painful, esp since I like to
hit 't' to expose the message headers, but now that's broken for html
emails unless I do Shift-d a few times to change the message
decoding.

I'm sure this is all fixable, but not with my (total lack of) elisp
skills.

Daniel> I deal with HTML mail with a single middle-click that sends
Daniel> the message to Chrome. If I'm connected to my computer by SSH
Daniel> (no Chrome), I instead view the message with lynx.

I don't even use the mouse generally, and I'm replying in VM right
now, since I *really* do like how it works to composing emails and
such.

Daniel> VM has its warts, but it's the only mail client I've found
Daniel> that handles 4000+ mail folders with ease (thanks to Emacs
Daniel> auto-complete in the minibuffer) and has vm-pcrisis.el so I
Daniel> can respond with different From addresses.

I admit I like it alot too, eps since I can search emails or folders
so nicely and easily. It's just that the warts aren't getting fixed
or even worked on. Which is a shame.

So I'm thinking that taking the parts I like:

- keybindings
- flexibility
- emacs editing

and bolting them on top of another mail reader might be the better
long term answer. Or at least something I could try to do and see how
it works out.

I do use mutt for reading one mailing list that's stupid high volume,
but replying is painful since the keybindings are oh so different.
The basic ideas are the same, it's just the implementation is
different.

So re-skinning mutt with VM bindings might be the best of both
worlds. Dunno...


Julian Bradfield

unread,
Jul 19, 2019, 5:06:55 PM7/19/19
to viewma...@nongnu.org
On 2019-07-19, John Stoffel <jo...@stoffel.org> wrote:
> which is just clunky. HTML email is just painful, esp since I like to
> hit 't' to expose the message headers, but now that's broken for html
> emails unless I do Shift-d a few times to change the message
> decoding.

My approach to HTML mail is to convert it to plain text in procmail
before it even hits my mailbox.

> I admit I like it alot too, eps since I can search emails or folders
> so nicely and easily. It's just that the warts aren't getting fixed
> or even worked on. Which is a shame.

Unfortunately, the current VM maintainer (Uday) is an academic (like
me), and the demands on our time are essentially unlimited. I can't
speak for Uday, but I only fix software when either (a) I really need
it fixed for myself, or (b) I'm desperately procrastinating!

> I do use mutt for reading one mailing list that's stupid high volume,

Hah! I feed all my mailing lists into a cnews system, and read it with
slrn. It's the best I can do to recapture that 1980s experience.


John Stoffel

unread,
Jul 19, 2019, 5:23:20 PM7/19/19
to John Stoffel, Daniel Barrett, viewma...@nongnu.org

And the other issue I notice is that when I do 'L'
(vm-list-imap-folders) in VM to view my
various folders to see which have new email on my server (based on
dovecot) I seem to be getting lots of new emails marked SEEN, so I
don't always notice when I actually have new emails. Frustrating.

I did try updating VM to search for the flags in a different way, but
that just broke things even more. I suspect it's my iPhone mail
client also interacting badly.

I need to chase this down with the dovecot developers to see if they
know why this is happening.

So not (probably) a VM problem, but annoying enough that it's making
me think of moving.


Uday S Reddy

unread,
Jul 19, 2019, 8:20:49 PM7/19/19
to jo...@stoffel.org, viewma...@nongnu.org
jo...@stoffel.org writes:

> After way too many years to mention, I'm starting to think that
> viewmail is a dead project. I can't do elisp programming, so it's
> probably time to move to mutt as my CLI based mail reader.

CLI = command line interface?

I agree it is unlikely that VM will last long. I don't know when it will
die. Probably when new RfC's will come along and we may not have the energy
to process the new kinds of messages. But, at the moment, it seems to work
fine.

> Well... it's a pain visiting IMAP vs plain folders, so now I have two
> sets of key bindings in message mode:
>
> v = visit folder
> i = visit IMAP folder
> w = save to IMAP folder
> s = save to folder
>
> which is just clunky.

My own key bindings are:

M-x imap = visit IMAP folder
i = save to IMAP folder

We could integrate the name space so that we could use one set of key
bindings. But would you really want to type something like

s imap://myaccount@thatserver/folder

> HTML email is just painful, esp since I like to hit 't' to expose the
> message headers, but now that's broken for html emails unless I do Shift-d
> a few times to change the message decoding.

This is a valid point. I think you are using emacs-w3m? emacs-w3m rebinds
the keys so that 't' means something else. But if you move into the headers
area, there the VM key bindings still work.

I will see what can be done about adjusting the emacs-w3m key bindings.
There is a bug report about it:

https://bugs.launchpad.net/vm/+bug/912531

but I have forgotten the details now. I will see if I can resurrect this.

> I'm sure this is all fixable, but not with my (total lack of) elisp
> skills.

Learning elisp itself is not a big deal, but we are dealing with many
different tools here and we have to know what is where and how to deal with
each. That isn't easy. I don't think this problem will go away with any
other mail client you switch to either.

Cheers,
Uday

John Stoffel

unread,
Jul 20, 2019, 4:02:15 PM7/20/19
to Uday S Reddy, jo...@stoffel.org, viewma...@nongnu.org
>>>>> "Uday" == Uday S Reddy <u.s....@cs.bham.ac.uk> writes:

Uday> jo...@stoffel.org writes:
>> After way too many years to mention, I'm starting to think that
>> viewmail is a dead project. I can't do elisp programming, so it's
>> probably time to move to mutt as my CLI based mail reader.

Uday> CLI = command line interface?

Correct. Plain SSH session to my main home machine. But I also read
via iPhone, though I hate the lack of sorting/searching tools.

Uday> I agree it is unlikely that VM will last long. I don't know when
Uday> it will die. Probably when new RfC's will come along and we may
Uday> not have the energy to process the new kinds of messages. But,
Uday> at the moment, it seems to work fine.

In my case, it's probably mostly because I generally like a TTY
session without graphics.

>> Well... it's a pain visiting IMAP vs plain folders, so now I have two
>> sets of key bindings in message mode:
>>
>> v = visit folder
>> i = visit IMAP folder
>> w = save to IMAP folder
>> s = save to folder
>>
>> which is just clunky.

Uday> My own key bindings are:

Uday> M-x imap = visit IMAP folder
Uday> i = save to IMAP folder

Uday> We could integrate the name space so that we could use one set of key
Uday> bindings. But would you really want to type something like

Uday> s imap://myaccount@thatserver/folder

God no! But maybe we could do s/S for regular/IMAP save? And v/V
for visit regular/IMAP folder? But no, that then breaks the virtual
folder commands.

>> HTML email is just painful, esp since I like to hit 't' to expose the
>> message headers, but now that's broken for html emails unless I do Shift-d
>> a few times to change the message decoding.

Uday> This is a valid point. I think you are using emacs-w3m?
Uday> emacs-w3m rebinds the keys so that 't' means something else. But
Uday> if you move into the headers area, there the VM key bindings
Uday> still work.

That would explain it.

Uday> I will see what can be done about adjusting the emacs-w3m key bindings.
Uday> There is a bug report about it:

Uday> https://bugs.launchpad.net/vm/+bug/912531

Uday> but I have forgotten the details now. I will see if I can resurrect this.

I hope it's easy enough to fix. What I really want to do is keep a
log of all the keybindings I use, so I can prioritize the ones I'd
like to (maybe) migrate to mutt or some other MUA.

I do hate writing all this and getting this discussion going, because
VM has served my needs for over 20 years now, which is just amazing!

>> I'm sure this is all fixable, but not with my (total lack of) elisp
>> skills.

Uday> Learning elisp itself is not a big deal, but we are dealing with many
Uday> different tools here and we have to know what is where and how to deal with
Uday> each. That isn't easy. I don't think this problem will go away with any
Uday> other mail client you switch to either.

Believe me, (e)lisp is not a language that I can work in. I still
shudder from my college course in Lisp all those years ago. This is
my personal reason for not being able to contribute more to a tool I
love to use, and the emacs key bindings my fingers know and use all
the time.


Tim Cross

unread,
Jul 20, 2019, 11:22:51 PM7/20/19
to John Stoffel, Uday S Reddy, vm
After using VM for many many years, I switched to mu4e a couple of years back. I think VM was/is a truely remarkable bit of software and one which was way in front of many other solutions for a long time. I think the time and effort Uday has put into keeping it alive is highly commendable and I would like to send my thanks for his sustained and considerable effort and dedication. Thank you Uday. 

Just in case it helps, here are my reasons for switch from VM to mu4e and my experiences with it, both good and bad. My hope is that others might find it useful. 

My main reason for switching was because of how my use of email has changed. I no longer run a local SMTP server and no longer do local mail routing or fiddling with fetchmail, procmail etc. Main reason is that in this day of mobile devices, I tend to access my email from multiple devices (phone, tablet, desktop, laptop etc) and I want all my mail accessible on all devices. In basic terms, I now manage email via imap. At the time when I moved VM had some issues with IMAP, especailly with Google. 

Another reason I moved was that I found VM's support for HTML mail wasn't great. Personally, I hate HTML mail and think it was possible the single worst thing that ever happened to email, but the reality is it is here and here to stay. I'm not sure what the current situation is with VM, but mu4e uses the recent EWW mode in emacs, which I find works really well for HTML messages. 

One of the things I liked about VM was the ability to mange multiple 'folders' and to easily have my mail in different folders and search for messages. The search facilities of mu4e are powerful and fast. I am able to have multiple 'folders' for my mail, though there are some inherent issues with doing this if your a gmail users (see below). 

The other thing I like about mu4e is that it has good integration with org-mode. I am a heavy org-mode user and the ability to both link to mail messages and use org formatting in messages is really useful. 

There are some warts though. However, they are similar to the warts I found in many other solutions I tried. Note that I did use mutt for a while and I really like mutt. However, mutt from within Emacs just doesn't work and I really wanted to do my email in emacs. I also tried mew, which I think was quite good. However, there were some issues and it lacked the org integration I wanted. I also tried Gnus and Wonderlust, but never warmed to either of them. 

Main issue I have with mu4e is that it doesn't actually do any mail retrieval from remote servers. You need to use some other program to do this. You can use fetchmail or similar. I use mbsync. It works well, but can be a little slow. However, if you set it up to run in daemon mode and check for new mail every x minutes, you don't really notice this. 

I gind GMAIL to be the biggest problem and the one which took the longest to setup. The problem is, Gmail doesn't actually have distinct folders. It uses labels. All mail is actually just in one mailbox/folder. If your like me, this can create a challenging setup so that you get the right balance between having the mail you want and not having to wait minutes for everything to be downloaded. It also means that if you want separate local folders for the messages, you are downloading the messages multiple times. My way of working around this was to only have distinct local folders for the 'mailboxes' I visit a lot and then use mu4e's search facilities to present different views of the messages in the 'main' folder. This works quite well. You can setup key bindings for this. The downside is the time it can take to setup initially. However, once working, it works quite well. 

Something I really loved about VM was pcrisis - I really liked how easy it was to change 'personalities' when sending mail. In mu4e, you have the ability to setup different personalities as well, so I can easily switch between personal, work, volunteer and other 'identities' I use. 

All in all, while it has been necessary for me to establish a new workflow for managing my email, I find with mu4e that I'm as fast and productive as I use to be with VM. I have a much smaller 'inbox' and better records in org-mode and overall, have probably got a more unified solution than I did with VM. The eww browser mode in Emacs works really well  and if absolutely necessary, I can open a message in an external browser with no difficulty. I don't use BBDB any more as I prefer to manage my contacts in the cloud so that they are available across devices. The ability for mu4e to use such cloud data is not great, but it does automatically maintain contacts from messages you have received (but to be honest, I haven't looked hard at this level of integration yet). 

All in all, if your thinking of switching from VM (and I'm not suggesting you need to at this stage - if its working for you, stick with it as long as you can!), consider mu4e. Like all change, there will be a transition period and a degree of frustration, but in the end, I think much of what I liked in VM is satisfied with mu4e. 

Of course, none of this detracts from the fact email is becoming less relevant. I note from speaking to my kids (both over 18) that they hardly use email at all and rarely even check their email accounts. Even my sone tells me that most of his interaction with the administration at the University he is at is over other channels, such as instant messages, twitter and various chat services. As far as they are concerned, email is this old fashioned thing from the past! 
--
regards,

Tim

--
Tim Cross

Mark Diekhans

unread,
Jul 21, 2019, 8:09:21 PM7/21/19
to viewma...@nongnu.org

While I have some frustration with VM, it continues to be a
powerful and useful client. I haven't found a good replacement.

VM suffers from the interrelated problems of only one main developer, a
small user base and a lack of visibility.

If VM is going to continue to exist, I feel we need to develop a more
active user and developer community. It would be great to hear some ideas
on how to accomplish this.

One thought is that launchpad is not the best environment for
loose collaborations. Either mirroring on github or moving there
completely would make it easier for contributions.

VM could use an informative web site,

https://www.nongnu.org/viewmail/

doesn't inspire someone want to try it.

I have plans to make a VM package. but haven't gotten to it yet :-(

We can't just expect Uday to do everything. Even if someone
isn't an e-lisp programmer, there is a lot that needs to be done
that doesn't require code.

Mark

Uday S Reddy <u.s....@cs.bham.ac.uk> writes:
> I agree it is unlikely that VM will last long. I don't know when it will
> die. Probably when new RfC's will come along and we may not have the energy
> to process the new kinds of messages. But, at the moment, it seems to work
> fine.



Daniel Barrett

unread,
Jul 22, 2019, 12:42:16 AM7/22/19
to jo...@stoffel.org, viewma...@nongnu.org, Daniel Barrett
On July 19, 2019, John Stoffel wrote:
>Well... it's a pain visiting IMAP vs plain folders, so now I have two
>sets of key bindings in message mode:
>
>v = visit folder
>i = visit IMAP folder
>...

Ah, I see. I don't run into that issue because I download all the
email from my IMAP server using fetchmail every 5 minutes. Then it's
local mail, so VM deals with only local folders.

Dan

Robert Marshall

unread,
Jul 22, 2019, 3:00:42 AM7/22/19
to viewma...@nongnu.org
On Fri, Jul 19 2019, "John Stoffel" <jo...@stoffel.org> wrote:

>>>>>> "Daniel" == Daniel Barrett <dbar...@blazemonger.com> writes:
>
> Daniel> On July 19, 2019, John Stoffel wrote:
>>> I really just love the way VM works, but it's getting flakier and
>>> flakier as more an more email goes HTML based and it's just hard to
>>> handle at time.
>
> Daniel> What specific issues are you encountering?
>
> Well... it's a pain visiting IMAP vs plain folders, so now I have two
> sets of key bindings in message mode:
>
> v = visit folder
> i = visit IMAP folder
> w = save to IMAP folder
> s = save to folder
>
> which is just clunky. HTML email is just painful, esp since I like to
> hit 't' to expose the message headers, but now that's broken for html
> emails unless I do Shift-d a few times to change the message
> decoding.
>

typing 't' just 'works for me but maybe that's because I'm using emacs'
shr as a text/html handler? (this seems to work well since I added the
code in my version)

On keybindings, I use

(define-key vm-mode-map "Vi" 'vm-visit-imap-folder)
(define-key vm-mode-map "I" 'vm-save-message-to-imap-folder)

but i suppose that muddles up vm-visit-imap-folder with the virtual
commands (which I rarely use), I might try
(define-key map "I" vm-mode-imap-map)

and add a few things from there?


Robert
--
Robert Marshall twitter: @rajm


John Stoffel

unread,
Jul 22, 2019, 9:21:57 AM7/22/19
to Daniel Barrett, jo...@stoffel.org, viewma...@nongnu.org
>>>>> "Daniel" == Daniel Barrett <dbar...@blazemonger.com> writes:

Daniel> On July 19, 2019, John Stoffel wrote:
>> Well... it's a pain visiting IMAP vs plain folders, so now I have two
>> sets of key bindings in message mode:
>>
>> v = visit folder
>> i = visit IMAP folder
>> ...

Daniel> Ah, I see. I don't run into that issue because I download all the
Daniel> email from my IMAP server using fetchmail every 5 minutes. Then it's
Daniel> local mail, so VM deals with only local folders.

I run my own dovecot instance in the cloud just so I can read emails
from anywhere, and so can the kids and wife as well. I could
outsource this all, but I prefer to run my own domain.



John Stoffel

unread,
Jul 22, 2019, 9:33:17 AM7/22/19
to Robert Marshall, viewma...@nongnu.org
>>>>> "Robert" == Robert Marshall <rob...@capuchin.co.uk> writes:

Robert> On Fri, Jul 19 2019, "John Stoffel" <jo...@stoffel.org> wrote:
>>>>>>> "Daniel" == Daniel Barrett <dbar...@blazemonger.com> writes:
>>
Daniel> On July 19, 2019, John Stoffel wrote:
>>>> I really just love the way VM works, but it's getting flakier and
>>>> flakier as more an more email goes HTML based and it's just hard to
>>>> handle at time.
>>
Daniel> What specific issues are you encountering?
>>
>> Well... it's a pain visiting IMAP vs plain folders, so now I have two
>> sets of key bindings in message mode:
>>
>> v = visit folder
>> i = visit IMAP folder
>> w = save to IMAP folder
>> s = save to folder
>>
>> which is just clunky. HTML email is just painful, esp since I like to
>> hit 't' to expose the message headers, but now that's broken for html
>> emails unless I do Shift-d a few times to change the message
>> decoding.
>>

Robert> typing 't' just 'works for me but maybe that's because I'm
Robert> using emacs' shr as a text/html handler? (this seems to work
Robert> well since I added the code in my version)

I think I need to look into this then. Which version of emacs? And
how did you set this up?

Robert> On keybindings, I use

Robert> (define-key vm-mode-map "Vi" 'vm-visit-imap-folder)
Robert> (define-key vm-mode-map "I" 'vm-save-message-to-imap-folder)

Robert> but i suppose that muddles up vm-visit-imap-folder with the virtual
Robert> commands (which I rarely use), I might try
Robert> (define-key map "I" vm-mode-imap-map)

Robert> and add a few things from there?

I don't use the V virtual bindings very much either, if at all.

I do love the M mark bindings though, one of the best ways to quickly
filter and find and save emails.


One thought is that maybe it's time to think about either overloading
the regular 's' and 'v' keys to support regular/IMAP folder access
more easily. But of course it needs to be quick and simple and not
take alot more key strokes.

And of course better integration with bbdb or some other tool to let
you tab-complete addresses would be nice. I admit I tried using bbdb
a long time ago and didn't care for it, but maybe it's time?

Just even having a way to starting writing a new email and entering
the first few letters and hitting tab to show matches from the
existing folder would be awesome. No idea how to do it in elisp.

John

John Stoffel

unread,
Jul 22, 2019, 9:49:19 AM7/22/19
to Tim Cross, John Stoffel, Uday S Reddy, vm

Hi Tim,
Thanks for your long reply about the switch to mu4e, which sounded
familiar to me, but only after I spent some time looking did I realize
it's an emacs frontend to the 'mu' project. Which I recall looking at
but decided it wasn't what I wanted.

I guess my desires are:

1. IMAP support that works well. VM is pretty close here, but slow at
times. Need this for multiple device support.

mu/mu4e and other non-IMAP based tools just don't fit into my needs
which is seemless access to all/most of my email from both VM and
other clients.

2. emacs editing/searching/composing for basic key bindings. Again VM
works well here. I do have thoughts on more M* bindings for more
grouping options, such as by sender:, list-id:, etc. It would be
nice to be able to mark by arbitrary headers more easily.

3. HTML -> Text support. I read VM exclusively inside SSH/putty
sessions. I never use emacs in GUI mode with inline graphics.
Maybe time to do so?

a. An easy way to find and copy URLs so I can copy them to use in
my local web browser would be nice. I just found out about the
[ and ] keys in w3m mode, which I currently use, even though it
annoyingly over-rides the 't' mode to toggel showing the full
headers.

b. A bunch of times I'll save an email and pull out my phone just
to look at the images or to find and click on that damn
un-subscribe link button hidden deep in the HTML stream. LOL.

But don't get me wrong, I find VM makes my life so much easier (even
though my friends whine about how funky my supercite'd emacs look on
their phones when they read email....

Its be best too I've found so far, I just wish we could do more.

Uday S Reddy

unread,
Jul 22, 2019, 9:52:33 AM7/22/19
to jo...@stoffel.org, Uday S Reddy, viewma...@nongnu.org
jo...@stoffel.org writes:

> Uday> We could integrate the name space so that we could use one set of key
> Uday> bindings. But would you really want to type something like
>
> Uday> s imap://myaccount@thatserver/folder
>
> God no! But maybe we could do s/S for regular/IMAP save? And v/V
> for visit regular/IMAP folder? But no, that then breaks the virtual
> folder commands.

I leave the key bindings to you to decide for yourself. There aren't that
many keys around. So you would need to decide which commands actually need
key bindings. I decided for example that vm-visit-folder and
vm-visit-imap-folder don't need key bindings. So I just define aliases
'folder' and 'imap' so that I can type M-x folder or M-x imap.

For save, the old Kyle Jones' style maildrop specs should still work:

``imap:HOST:PORT:MAILBOX:AUTH:USER:PASSWORD''

They are obviously a pain to type, especially without any file name
completion. I considered introducing a URI syntax like the above but I
decided they would still be a pain to type. Hence I added a new command that
allows ACCOUNT:FOLDER style of specification *with file name completion*.
The price to pay for that is a separate key binding.

> Believe me, (e)lisp is not a language that I can work in. I still
> shudder from my college course in Lisp all those years ago. This is
> my personal reason for not being able to contribute more to a tool I
> love to use, and the emacs key bindings my fingers know and use all
> the time.

I can understand that a lot of people are allergic to Lisp syntax. But it is
not at all hard to learn. It probably took me only one evening to learn it
when I had to do a homework assignment as a grad student.

Cheers,
Uday


Robert Marshall

unread,
Jul 22, 2019, 11:20:28 AM7/22/19
to viewma...@nongnu.org
On Mon, Jul 22 2019, "John Stoffel" <jo...@stoffel.org> wrote:

>>>>>> "Robert" == Robert Marshall <rob...@capuchin.co.uk> writes:
>
> Robert> On Fri, Jul 19 2019, "John Stoffel" <jo...@stoffel.org> wrote:
>>>>>>>> "Daniel" == Daniel Barrett <dbar...@blazemonger.com> writes:
>>>
> Daniel> On July 19, 2019, John Stoffel wrote:
>>>>> I really just love the way VM works, but it's getting flakier and
>>>>> flakier as more an more email goes HTML based and it's just hard to
>>>>> handle at time.
>>>
> Daniel> What specific issues are you encountering?
>>>
>>> Well... it's a pain visiting IMAP vs plain folders, so now I have two
>>> sets of key bindings in message mode:
>>>
>>> v = visit folder
>>> i = visit IMAP folder
>>> w = save to IMAP folder
>>> s = save to folder
>>>
>>> which is just clunky. HTML email is just painful, esp since I like to
>>> hit 't' to expose the message headers, but now that's broken for html
>>> emails unless I do Shift-d a few times to change the message
>>> decoding.
>>>
>
> Robert> typing 't' just 'works for me but maybe that's because I'm
> Robert> using emacs' shr as a text/html handler? (this seems to work
> Robert> well since I added the code in my version)
>
> I think I need to look into this then. Which version of emacs? And
> how did you set this up?
>

I edited vm-mime.el to

diff vm-mime.el vm-mime.el~
2045,2055c2045,2052
< (cond
< ((locate-library "shr")
< 'emacs-shr)
< ((locate-library "w3m")
< 'emacs-w3m)
< ((locate-library "w3")
< 'w3)
< ((executable-find "w3m")
< 'w3m)
< ((executable-find "lynx")
< 'lynx)))
---
> (cond ((locate-library "w3m")
> 'emacs-w3m)
> ((locate-library "w3")
> 'w3)
> ((executable-find "w3m")
> 'w3m)
> ((executable-find "lynx")
> 'lynx)))
2730,2732c2727
< (defun vm-mime-display-internal-emacs-shr-text/html (start end layout)
< (shr-render-region start end)
< )
---
>

so making shr the default render method - or just set
vm-mime-text/html-handler to 'emacs-shr (with that defun).
I see I should really be making a change to the docstring for
vm-mime-text/html-handler...

I'm using emacs from git but I have been using shr for this for a few
years (2016 I think) - the library comes by default with fairly recent
emacs. I don't configure shr things so it always pulls remote images if
you render the html (you may not wish for this ;) ) but it's settable
via shr-inhibit-images - not sure how to then download if you want..

There's also a tendency for stray 'z's to appear which don't get removed
on reply vm-mime-display-internal-text/html messes around with this I
see for w3m's benefit, I should add a condition around that code!


> Robert> On keybindings, I use
>
> Robert> (define-key vm-mode-map "Vi" 'vm-visit-imap-folder)
> Robert> (define-key vm-mode-map "I" 'vm-save-message-to-imap-folder)
>
> Robert> but i suppose that muddles up vm-visit-imap-folder with the virtual
> Robert> commands (which I rarely use), I might try
> Robert> (define-key map "I" vm-mode-imap-map)
>
> Robert> and add a few things from there?
>
> I don't use the V virtual bindings very much either, if at all.
>
> I do love the M mark bindings though, one of the best ways to quickly
> filter and find and save emails.
>
>
> One thought is that maybe it's time to think about either overloading
> the regular 's' and 'v' keys to support regular/IMAP folder access
> more easily. But of course it needs to be quick and simple and not
> take alot more key strokes.
>

I wondered (today) about inspecting the type of the folder and by
default using the same folder type and provide some means (C-u?) of
overriding that?

Robert Marshall

unread,
Jul 23, 2019, 2:40:25 AM7/23/19
to viewma...@nongnu.org
On Mon, Jul 22 2019, Robert Marshall <rob...@capuchin.co.uk> wrote:

[on adding functionality to use emacs' inbuilt shr library for rendering
html mail]:
>
> There's also a tendency for stray 'z's to appear which don't get removed
> on reply vm-mime-display-internal-text/html messes around with this I
> see for w3m's benefit, I should add a condition around that code!
>

Something like this

diff vm-mime.el vm-mime.el~
2786,2788c2786
< (if (eq vm-mime-text/html-handler 'emacs-shr)
< ()
< (insert-before-markers "z"))
---
> (insert-before-markers "z")
2797,2799c2795
< (if (eq vm-mime-text/html-handler 'emacs-shr)
< ()
< (delete-char -1))
---
> (delete-char -1)

Tim Cross

unread,
Jul 23, 2019, 8:27:12 PM7/23/19
to John Stoffel, Uday S Reddy, vm
Hi John,

just a few brief comments  in-line to clarify some points.

On Mon, 22 Jul 2019 at 23:49, John Stoffel <jo...@stoffel.org> wrote:

Hi Tim,
Thanks for your long reply about the switch to mu4e, which sounded
familiar to me, but only after I spent some time looking did I realize
it's an emacs frontend to the 'mu' project.  Which I recall looking at
but decided it wasn't what I wanted.

I guess my desires  are:

1. IMAP support that works well.  VM is pretty close here, but slow at
   times.  Need this for multiple device support. 

This is how I use mu4e. While mbsync does download local copies, it does not remove them from the remote server, so they are still accessible from other devices. When setup correctly, it synchronises things, so when I look at my mail from my phone for example, messages I've already read are flagged as read and ones I haven't are flagged unread. Likewise, the sent and deleted items are synced, so I can see messages sent  regardless of where device they were sent from. I access my mail from phone, tablet, emacs and outlook/apple mail (work) - all synced. 

mbsync is still slow - probably faster than VM imap, but as I run it as a daemon, I don';t really notice that. My mail is just updated every X minutes.  

   mu/mu4e and other non-IMAP based tools just don't fit into my needs
   which is seemless access to all/most of my email from both VM and
   other clients. 

2. emacs editing/searching/composing for basic key bindings.  Again VM
   works well here.  I do have thoughts on more M* bindings for more
   grouping options, such as by sender:, list-id:, etc.  It would be
   nice to be able to mark by arbitrary headers more easily.

mu4e is very powerful in this area - as good as VM IMO, but of course, it has a learning curve. It uses the Gnus message mode for composing mail.
 

3. HTML -> Text support.  I read VM exclusively inside SSH/putty
   sessions.  I never use emacs in GUI mode with inline graphics.
   Maybe time to do so?

By default, uses Emacs eww, which is pretty good. I've not bothered with w3m for quite some time now due to eww.
With the right setup with browse-rul, it is also easy to have things so that when you want to, you can send the message for display in the GUI browser. Most of the time, I just use eww though.
 

   a. An easy way to find and copy URLs so I can copy them to use in
      my local web browser would be nice.  I just found out about the
      [ and ] keys in w3m mode, which I currently use, even though it
      annoyingly over-rides the 't' mode to toggel showing the full
      headers.

You can easily setup key bindings to use browser-url to send links to your web browser.  

   b. A bunch of times I'll save an email and pull out my phone just
      to look at the images or to find and click on that damn
      un-subscribe link button hidden deep in the HTML stream.  LOL.

But don't get me wrong, I find VM makes my life so much easier (even
though my friends whine about how funky my supercite'd emacs look on
their phones when they read email....

Its be best too I've found so far, I just wish we could do more.

I think of VM with considerable fondness - I used it for many many years and if it wasn't for the issues I had with IMAP, I probably would have stuck with it. The issue with it is, as you note, the small user base. Another contributing factor is that VM also gtries to do most of what it does itself, which can mean it is more immune from external changes, but also means it is larger and more complex, requiring more maintenance. Mu4e on the other hand is more minimal, buit still as functional. It takes greater advantage of already existing functionality e.g. Gnus, shr/eww etc and delegates some responsibilities to external apps (mu, mbsync). 

Stick with VM as long as you can. However, when that is no longer viable, consider mu4e. I suspect it will meet most, if not all, of yhour requirements.

Uday S Reddy

unread,
Jul 25, 2019, 1:33:07 PM7/25/19
to John Stoffel, Daniel Barrett, viewma...@nongnu.org
John Stoffel writes:

>
> And the other issue I notice is that when I do 'L'
> (vm-list-imap-folders) in VM to view my
> various folders to see which have new email on my server (based on
> dovecot) I seem to be getting lots of new emails marked SEEN, so I
> don't always notice when I actually have new emails. Frustrating.

Indeed, it is not VM doing it. VM is just showing you the output from the
IMAP server.

Cheers,
Uday

John Stoffel

unread,
Jul 25, 2019, 2:38:20 PM7/25/19
to Uday S Reddy, John Stoffel, Daniel Barrett, viewma...@nongnu.org
>>>>> "Uday" == Uday S Reddy <u.s....@cs.bham.ac.uk> writes:

Uday> John Stoffel writes:
>>
>> And the other issue I notice is that when I do 'L'
>> (vm-list-imap-folders) in VM to view my
>> various folders to see which have new email on my server (based on
>> dovecot) I seem to be getting lots of new emails marked SEEN, so I
>> don't always notice when I actually have new emails. Frustrating.

Uday> Indeed, it is not VM doing it. VM is just showing you the output from the
Uday> IMAP server.

Yup, I figure it's got to be something my iphone is doing when it also
checks for mail on the dovecot server and then it changes messages
from UNSEEN to SEEN. Totally annoying.

I tried hacking VM to use something like this, but it broken even
harder:

quad:~/elisp/vm-8.2.0c/lisp> diff -u ~/elisp/vm-8.2.0b/lisp/vm-imap.el vm-imap.el
--- /home/john/elisp/vm-8.2.0b/lisp/vm-imap.el 2017-03-17 10:32:24.000000000 -0400
+++ vm-imap.el 2017-03-13 11:45:55.000000000 -0400
@@ -4382,7 +4382,7 @@
;;-----------------------------
(vm-imap-send-command
process
- (format "STATUS %s (MESSAGES RECENT)" (vm-imap-quote-string mailbox)))
+ (format "STATUS %s (MESSAGES RECENT UNSEEN)" (vm-imap-quote-string mailbox)))
(while need-ok
(setq response (vm-imap-read-response-and-verify process "STATUS"))
(cond ((vm-imap-response-matches response 'VM 'OK)


John Stoffel

unread,
Jul 25, 2019, 3:12:51 PM7/25/19
to Robert Marshall, viewma...@nongnu.org

Hi Robert,
I just tried patching my vm-8.2.0b version (as vm-8.2.0c) but when I
now look at emails with HTML, I get an error like this:

Inline text/html by emacs-shr display failed: Variable binding depth exceeds max-specpdl-size

And I based my changes on your example code.


quad:~/elisp/vm-8.2.0c/lisp> diff -u ../../vm-8.2.0b/lisp/vm-mime.el vm-mime.el
--- ../../vm-8.2.0b/lisp/vm-mime.el 2011-12-27 17:19:28.000000000 -0500
+++ vm-mime.el 2019-07-25 14:44:49.000000000 -0400
@@ -2042,7 +2042,9 @@
(defun vm-mime-text/html-handler ()
(if (eq vm-mime-text/html-handler 'auto-select)
(setq vm-mime-text/html-handler
- (cond ((locate-library "w3m")
+ (cond ((locate-library "shr")
+ 'emacs-shr)
+ ((locate-library "w3m")
'emacs-w3m)
((locate-library "w3")
'w3)
@@ -2718,6 +2720,10 @@
(vm-inform 5 "No data for cid %S" url))
part))

+(defun vm-mime-display-internal-emacs-shr-text/html (start end layout)
+ (shr-render-region start end)
+ )
+
(defun vm-mime-display-internal-w3m-text/html (start end layout)
(let ((charset (or (vm-mime-get-parameter layout "charset") "us-ascii")))
(shell-command-on-region


And in my ~/.vm file I have a line:

vm-mime-text/html-handler 'emacs-shr


which is probably wrong. I guess it's time I try to learn more elisp... :-)


Robert Marshall

unread,
Jul 25, 2019, 4:12:38 PM7/25/19
to John Stoffel, viewma...@nongnu.org
John


John Stoffel writes:
>
> Hi Robert,
> I just tried patching my vm-8.2.0b version (as vm-8.2.0c) but when I
> now look at emails with HTML, I get an error like this:
>
> Inline text/html by emacs-shr display failed: Variable binding depth exceeds max-specpdl-size
>
> And I based my changes on your example code.
>
All that looks ok to me - though you don't need to make the
> + (cond ((locate-library "shr")
> + 'emacs-shr)

if you're setting vm-mime-text/html-handler in your .vm file but it's
clearly using that setting in view of the emacs-shr error (so I
wouldn't change anything there). What do you get if you set

M-x set-variable debug-on-error t

and try it again? You may need to trim the output a bit.

Which version of emacs is this? Have you byte-compiled vm-mime after editing it?

Robert

Uday Reddy

unread,
Jul 25, 2019, 4:19:57 PM7/25/19
to John Stoffel, viewma...@nongnu.org
John Stoffel writes:

> I tried hacking VM to use something like this, but it broken even
> harder:
>
> quad:~/elisp/vm-8.2.0c/lisp> diff -u ~/elisp/vm-8.2.0b/lisp/vm-imap.el vm-imap.el
> --- /home/john/elisp/vm-8.2.0b/lisp/vm-imap.el 2017-03-17 10:32:24.000000000 -0400
> +++ vm-imap.el 2017-03-13 11:45:55.000000000 -0400
> @@ -4382,7 +4382,7 @@
> ;;-----------------------------
> (vm-imap-send-command
> process
> - (format "STATUS %s (MESSAGES RECENT)" (vm-imap-quote-string mailbox)))
> + (format "STATUS %s (MESSAGES RECENT UNSEEN)" (vm-imap-quote-string mailbox)))
> (while need-ok
> (setq response (vm-imap-read-response-and-verify process "STATUS"))
> (cond ((vm-imap-response-matches response 'VM 'OK)
>
>

Now, I understand what you are talking about. You want the number of UNSEEN
messages instead of RECENT messages. (Note that the two different concepts.)

To achieve that, you can replace all occurrences of RECENT in the vm-imap.el
file with UNSEEN.

Cheers,
Uday

John Stoffel

unread,
Jul 25, 2019, 4:27:21 PM7/25/19
to Robert Marshall, John Stoffel, viewma...@nongnu.org
>>>>> "Robert" == Robert Marshall <rob...@capuchin.co.uk> writes:

Robert> John


Robert> John Stoffel writes:
>>
>> Hi Robert,
>> I just tried patching my vm-8.2.0b version (as vm-8.2.0c) but when I
>> now look at emails with HTML, I get an error like this:
>>
>> Inline text/html by emacs-shr display failed: Variable binding depth exceeds max-specpdl-size
>>
>> And I based my changes on your example code.
>>
Robert> All that looks ok to me - though you don't need to make the
>> + (cond ((locate-library "shr")
>> + 'emacs-shr)

Robert> if you're setting vm-mime-text/html-handler in your .vm file
Robert> but it's clearly using that setting in view of the emacs-shr
Robert> error (so I wouldn't change anything there). What do you get
Robert> if you set

Robert> M-x set-variable debug-on-error t

Robert> and try it again? You may need to trim the output a bit.

I'll give it a shot. I bumped up the max-specpdl-size to 13400 from
1300, but now it just seems to hang when doing stuff. More once I get
some debug info.

Robert> Which version of emacs is this? Have you byte-compiled vm-mime
Robert> after editing it?

Yup, I did byte-compile it all. Got tons of warnings about stuff lie
this:


"emacs" -batch -q -no-site-file -no-init-file -l ./vm-build.el -f
batch-byte-compile vm-w3m.el

In end of data:
vm-w3m.el:167:1:Warning: the following functions might not be defined
at
runtime: vm-mime-cid-retrieve, vm-mm-layout-type,
vm-mime-transfer-decode-region
Wrote /home/john/elisp/vm-8.2.0c/lisp/vm-w3m.elc



I'm running emacs 24.5.1 on Debian 9.9. And I see that I can install
emacs25, so I'll try using that next as well.


Robert> Robert

John Stoffel

unread,
Jul 25, 2019, 5:14:28 PM7/25/19
to Uday Reddy, John Stoffel, viewma...@nongnu.org
>>>>> "Uday" == Uday Reddy <usr.vm...@gmail.com> writes:

Uday> John Stoffel writes:
>> I tried hacking VM to use something like this, but it broken even
>> harder:
>>
>> quad:~/elisp/vm-8.2.0c/lisp> diff -u ~/elisp/vm-8.2.0b/lisp/vm-imap.el vm-imap.el
>> --- /home/john/elisp/vm-8.2.0b/lisp/vm-imap.el 2017-03-17 10:32:24.000000000 -0400
>> +++ vm-imap.el 2017-03-13 11:45:55.000000000 -0400
>> @@ -4382,7 +4382,7 @@
>> ;;-----------------------------
>> (vm-imap-send-command
>> process
>> - (format "STATUS %s (MESSAGES RECENT)" (vm-imap-quote-string mailbox)))
>> + (format "STATUS %s (MESSAGES RECENT UNSEEN)" (vm-imap-quote-string mailbox)))
>> (while need-ok
>> (setq response (vm-imap-read-response-and-verify process "STATUS"))
>> (cond ((vm-imap-response-matches response 'VM 'OK)
>>
>>

Uday> Now, I understand what you are talking about. You want the number of UNSEEN
Uday> messages instead of RECENT messages. (Note that the two different concepts.)

Uday> To achieve that, you can replace all occurrences of RECENT in
Uday> the vm-imap.el file with UNSEEN.

I'll have to try that. Basically, I want VM to show me the count of
Un-read (which I guess maps to UNSEEN) instead of RECENT, esp since I
have mutltiple clients. Looking more closely at the RFC3501 flags
section, I now understand the \Recent flag better.

So I guess what I want is \Unseen (or more accuraltely !\Seen).

This might be a useful change to make for VM, so that you can choose
what version you want.


Robert Marshall

unread,
Jul 31, 2019, 2:28:58 PM7/31/19
to John Stoffel, viewma...@nongnu.org
John Stoffel writes:
>
>
> I'm running emacs 24.5.1 on Debian 9.9. And I see that I can install
> emacs25, so I'll try using that next as well.
>

I've built an emacs 25 (25-1 I had to fiddle with configure options to
build under ubuntu, would probably have been ok with 25-2 looking at
an emacs bug report) here and after recompiling vm (byte code
versions...) the emacs-shr version worked ok on the 2 emails I tested

I got some messages saying

error in process filter: Args out of range: #<buffer MyImapBoxName Presentation>, 1, 1

but I remember seeing those before - I assume later versions of emacs
have fixed whatever that problem was but it didn't interfere with
viewing the emails

If I try to build 24-1 I get a crash out of make with a _GL_WARN_ON_USE
which I'm looking at :)
0 new messages