On 4/25/2011 8:13 AM, Salome Södergran wrote:

How do I have to change the code below to get a function that will
make vm visit the inbox of my imap-account? (Whereas "myimap" is the
shortname for the connection to my imap-account, stored in an
encrypted authinfo.pgp-file. M-x vm-visit-imap-folder myimap:inbox
works just fine.)

(defvar vm-myiamp "myimap:inbox")
(defun vm-visit-myimap ()
   (interactive)
   (vm-visit-imap-folder vm-myimap))

The short name of IMAP accounts is only available for the interactive user interface. When you call vm-visit-imap-folder from a program, you need to specify the full IMAP maildrop specification of the folder.

(That is how the function was defined originally, and it can't be changed without breaking the existing code. I have added the short names for interactive use. The situation is still not entirely ideal. I intend to move to the URL notation for a future version of VM.)

On another note, I personally don't like using up valuable key-bindings for commands that I use only occasionally. Rather, I define short command names, e.g.,

  (defalias 'imap 'vm-visit-imap-folder)
  (defalias 'pop 'vm-visit-pop-folder)
  (defalias 'folder 'vm-visit-folder)
  (defalias 'virtual 'vm-visit-virtual-folder)

Then I just have to type `M-x imap' to visit an IMAP folder.

You might also try using the menubar, which not only lists these commands, but also the folders visited during the current session so that you can easily go back to them.

Cheers,
Uday

Reply via email to