Discussion:
[VM] Problem with VM on Aquamacs 3.2 and 3.3dev
Piet van Oostrum
2016-06-16 16:47:45 UTC
Permalink
I was using VM (8.2.0b) on Aquamacs 3.0a on Mac OS X 10.10.5 (Yosemite).
Because this Aquamacs version often has problems with Emacs startup
(it often hangs and doesn't react nor show its windows as described in
http://thread.gmane.org/gmane.emacs.macintosh.osx/7238), I switched to
the development version (Aquamacs 3.3dev) which purports to solve that
problem.

However, I now have an annoying problem with VM. With the new
Aquamacs version, when I read an HMTL email (usually multipart/mixed),
the cursor jumps to the end of the message rather than to the beginning.
This only happens when I work from the VM Summary buffer (using the next
and previous keys n and p). When I work from the VM Presentation buffer
it works as desired.

HTML messages are handled with emacs-w3m (via vm-w3m) in my setup. Pure
ASCII messages work normally. So I wonder if something has changed in
emacs-w3m, or in the calling of external processes in general. I tried
to switch to Aquamacs 3.2, but it had the same problem.

I have now found a hack around this problem: I advice the
vm-next-message function to do a vm-beginning-of message at the end.
------------------------------------------------------------------------
(defun show-beginning-of-message (func &rest r)
(save-selected-window
(apply func r)
(vm-beginning-of-message)))

(advice-add 'vm-next-message :around #'show-beginning-of-message)
------------------------------------------------------------------------
But this only helps for moving forward and backward. There are other
cases of selecting a message where it does not work, e.g. moving the
cursor in the VM Summary buffer and then hitting SPACE.

I have posted a similar message in gmane.emacs.macintosh.osx (nntp
mirror of the emacs.macintosh.osx mailing list). It was not possible to
cross-post, as these are on different news servers.

Anybody knows what is causing this problem?
--
Piet van Oostrum <***@vanoostrum.org>
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]
rene
2016-06-19 05:49:08 UTC
Permalink
Post by Piet van Oostrum
However, I now have an annoying problem with VM. With the new
Aquamacs version, when I read an HMTL email (usually multipart/mixed),
the cursor jumps to the end of the message rather than to the beginning.
This only happens when I work from the VM Summary buffer (using the next
and previous keys n and p). When I work from the VM Presentation buffer
it works as desired.
I've been running into the very same problem for a while now.

Using Debian8, Emacs25, emacs-w3m
Post by Piet van Oostrum
I have now found a hack around this problem: I advice the
vm-next-message function to do a vm-beginning-of message at the end.
Thanks for this piece of code. It helps.

--
rene
Göran Uddeborg
2016-07-22 12:46:56 UTC
Permalink
Post by Piet van Oostrum
However, I now have an annoying problem with VM. With the new
Aquamacs version, when I read an HMTL email (usually multipart/mixed),
the cursor jumps to the end of the message rather than to the beginning.
This only happens when I work from the VM Summary buffer (using the next
and previous keys n and p). When I work from the VM Presentation buffer
it works as desired.
Thanks for digging into this, and suggesting a solution. The behviour
has irritated me too, but not enough for me to investigate. Until I
read your mail. (And a few weeks more had passed. :-))

I looked a bit into the possibility of catching the other cases too,
and run across a hook, vm-select-message-hook, that seemed to fit the
purpose. So what I have arrived to now is this quite simple code

(add-hook 'vm-select-message-hook
(lambda () (save-selected-window (vm-beginning-of-message))))

It appears to work as far as I can tell. It does also work for the
case when you move around in the summary buffer and hitting SPACE.

In case it matters, I'm using GNU Emacs 25.0.94.1 on Fedora Linux.

Fixing the underlying problem would of course be even better.
Göran Uddeborg
2016-07-27 14:32:07 UTC
Permalink
Post by Göran Uddeborg
(add-hook 'vm-select-message-hook
(lambda () (save-selected-window (vm-beginning-of-message))))
Hm, that seems to have an unintended side-effect, though. Whenever I
visit a virtual folder I've defined, it appears in the same window as
the window, frame in emacs terms, as the one I'm currently using.
Previously the virtual folder showed up in a new frame.

Loading...