VM

Focus shifting on Aquamacs

Bug #621245 reported by Uday Reddy

This bug report was converted into a question: question #122392: Focus shifting on Aquamacs.

8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
VM
Invalid
Medium
Uday Reddy

Bug Description

Alley Stoughton reports (2010-08-19)

I'm trying to get the VM working well with Aquamacs

http://aquamacs.org

on my Mac, and have run into a annoying problem. When I am advancing
through the messages in a VM frame/folder, I find that my focus shifts
to another frame (VM or not) in a semi-random way. The focus shift
doesn't always happen, and it doesn't matter if I advance by typing
"n" or use Motion => Next Message. The same thing happens with "p"/
Previous Message.

The Aquamacs developers don't use VM, but they suggest it's a VM bug. Any thoughts
about what might be causing the problem? I'm running VM 8.1.90a and Aquamacs 2.1,
which is based on GNU Emacs 23.2.50.

Alley

Tags: emacsen
Revision history for this message
Uday Reddy (reddyuday) wrote :

More info from Alley Stoughton:

It's a problem that occurs with the version of Aquamacs that is based on Emacs 23, which uses the Cocoa library, instead of the earlier Carbon one. In fact, there is also an branch of Aquamacs that uses Emacs 22/Carbon, and the problem that I report *doesn't* happen with it.

It's happening with local folders (I don't use POP/IMAP ones -- I use fetchmail instead).

OK, I downloaded Emacs 23, built it for Mac OS X, installed VM in the site-lisp directory, and the focus problem doesn't occur. So... this seems to show that it's at least partly an Aquamacs problem, and I'll try giving the Aquamacs developers this information. On the other hand, I'm not having the focus shift problem with anything other than VM, so it seems possible that VM is doing something unusual which -- combined with something that Aquamacs does -- triggers the problem.

Revision history for this message
Bar Shirtcliff (bar-cs) wrote :

        Other people who do use VM on Aquamacs(i.e. myself), using
        the same versions of both as reported here, do not have this
        problem. Therefore it's likely to be some customization which
        one or the other no longer supports, or just possibly, some
        setting that is missing on Alley's side.

Revision history for this message
Tim Cross (tcross) wrote :

This may or may not be relevant, but there is a thread in the emacs bug tracker relating to issues relating to focus and the mouse for emacs 23 under OSX. Possibly related?
It is bug#6888

Revision history for this message
Alley Stoughton (alley-stoughton) wrote :

I tried stripping out as many Aquamacs and VM customizations as possible, and what I found was
I run into focus problems if-and-only-if I use BBDB (version 2.35, the current release). Note that
sometimes it takes a bit of use before the focus problems start up; sometimes they occur from
the get-go.

My BBDB settings are very simple:

   (require 'bbdb)
   (bbdb-initialize 'vm)
   (setq bbdb/mail-auto-create-p nil)

Revision history for this message
Uday Reddy (reddyuday) wrote : [Bug 621245] Re: Focus shifting on Aquamacs

> I tried stripping out as many Aquamacs and VM customizations as
> possible, and what I found was I run into focus problems
> if-and-only-if I use BBDB (version 2.35, the current release).

Great, thanks for the info. The recipe is still the same as I
mentioned in the newsgroup: place debug-on-entry on set-buffer and
switch-to-buffer and see if they get any suspicious calls. If they
are under save-excursion or save-current-buffer, then they are safe.
If they are not under one of these primitives, then they are changing
buffer for good.

By "changing focus", did you mean changing buffer or changing frame
(window)? If the latter, what happens if there is no other frame?

Revision history for this message
Bar Shirtcliff (barshirtcliff) wrote :

If I'm right about having reproduced the bug, it suddenly switches
frame, specifically between VM frames. It doesn't happen if you have
only one VM frame open.

I removed bbdb... I hope Alley can help you debug this one.

Uday Reddy writes:
| > I tried stripping out as many Aquamacs and VM customizations as
| > possible, and what I found was I run into focus problems
| > if-and-only-if I use BBDB (version 2.35, the current release).
|
| Great, thanks for the info. The recipe is still the same as I
| mentioned in the newsgroup: place debug-on-entry on set-buffer and
| switch-to-buffer and see if they get any suspicious calls. If they
| are under save-excursion or save-current-buffer, then they are safe.
| If they are not under one of these primitives, then they are changing
| buffer for good.
|
| By "changing focus", did you mean changing buffer or changing frame
| (window)? If the latter, what happens if there is no other frame?
|
| --
| Focus shifting on Aquamacs
| https://bugs.launchpad.net/bugs/621245
| You received this bug notification because you are subscribed to VM.
|
| Status in VM (View Mail) for Emacs: Incomplete
|
| Bug description:
| Alley Stoughton reports (2010-08-19)
|
| I'm trying to get the VM working well with Aquamacs
|
| http://aquamacs.org
|
| on my Mac, and have run into a annoying problem. When I am advancing
| through the messages in a VM frame/folder, I find that my focus shifts
| to another frame (VM or not) in a semi-random way. The focus shift
| doesn't always happen, and it doesn't matter if I advance by typing
| "n" or use Motion => Next Message. The same thing happens with "p"/
| Previous Message.
|
| The Aquamacs developers don't use VM, but they suggest it's a VM bug. Any thoughts
| about what might be causing the problem? I'm running VM 8.1.90a and Aquamacs 2.1,
| which is based on GNU Emacs 23.2.50.
|
| Alley
|

--

----------------------------------------------------------------------
"All men are born mad. Some remain so."

                                     --Samuel Beckett

Revision history for this message
Alley Stoughton (alley-stoughton) wrote :

Thanks, Bar, for your effort at reproducing the bug!

Uday: it's changing frames, and the problem only occurs when there is more than one frame.

I'll try the debugging you suggest shortly, but I think I understand what's happening now:

BBDB creates a buffer named *BBDB*, containing contact info, and this buffer is included at
the bottom of multiple VM frames. When navigation is done inside a frame/folder, the contents of *BBDB* is
changed, and these changes must be displayed in all the frames in which *BBDB* is included.

Suppose we have two VM frames open, A and B, with *BBDB* included in both frames. When
we move forward or backward in frame A, causing the contents of *BBDB* to be updated,
the changes must be reflected in frame B as well as A. But in Aquamacs 2.1 (Cocoa), the
updating of *BBDB* in frame B causes focus to shift to Frame B. This doesn't happen in
Emacs 23 (Cocoa) or in Aquamacs Class (Carbon), in which frame A retains focus.

Revision history for this message
Alley Stoughton (alley-stoughton) wrote :

Uday: I tried doing the debugging you suggest. When I call debug-on-entry with argument switch-to-buffer, I'm told
"Definition of switch-to-buffer is not a list". Doing debug-on-entry with set-buffer works, but immediately enters
set-buffer. I don't really understand what happens next, probably because I don't understand the debugger at
all well. Given what I wrote above, is there still useful info to be gained by the debugging you suggest? If so,
I can try some more.

Revision history for this message
Uday Reddy (reddyuday) wrote :

Alley Stoughton writes:

> Uday: it's changing frames, and the problem only occurs when there
> is more than one frame.

Ok, I think we have enough information to narrow down the problem. No
further debugging necessary, at least for now.

It is clear that Aquamacs is taking liberties with the semantics of
switch-to-buffer. Whether it is a bug or an intentional change, I
don't know. I will write to the aquamacs list, giving my
understanding the problem.

Uday

Revision history for this message
Uday Reddy (reddyuday) wrote :

Given the corrupted buffer that Barbara showed, I think the safest way
to work around the problem is to set bbdb-use-pop-up to nil.

Alley, you might also try setting bbdb-multiple-buffers to
'bbdb-multiple-buffers-default. That will allow each VM folder, I
think, to have its own BBDB buffer.

Uday

Revision history for this message
Alley Stoughton (alley-stoughton) wrote :

Hi Uday,

 > Given the corrupted buffer that Barbara showed, I think the safest way
 > to work around the problem is to set bbdb-use-pop-up to nil.

Perhaps, but that would make using BBDB much less attractive. It's
really nice to see the BBDB buffer at the bottom of a message, reminding
me of what organization someone comes from, or even of their name,
in case they don't include their full name in the from line.

I'm not at all sure why Barbara had such a corrupted frame. That
doesn't happen to me, and it would be good to get to the bottom on
this.

 > Alley, you might also try setting bbdb-multiple-buffers to
 > 'bbdb-multiple-buffers-default. That will allow each VM folder, I
 > think, to have its own BBDB buffer.

This is a good idea, and having a one-to-one correspondence between
frames and BBDB buffers is actually very sensible. That way, the
contact info at the bottom of a message always pertains to that
message.

But when I do this, it works, but I'm getting "No buffer named *BBDB*"
messages each time I navigate or expand someone's name. I'll see if I
can figure out what's going on, but if you have any suggestions,
please let me have them.

Are you still going to write to Aquamacs Developers? David Reitter
believes that switch-to-buffer has different semantics than you do,
it seems.

Looking ahead, it would be great to get VM/BBDB as a package for
Aquamacs. I would think it would be a win-win for VM and Aquamacs.

Alley

Revision history for this message
Alley Stoughton (alley-stoughton) wrote :

Uday Reddy writes:
 > Alley, you might also try setting bbdb-multiple-buffers to
 > 'bbdb-multiple-buffers-default. That will allow each VM folder, I
 > think, to have its own BBDB buffer.

I updated to the development version of BBDB (2.36 devo, from the CVS),
and this now works fine. In my opinion, it's a more sensible setting
than having a single *BBDB* buffer.

Alley

Revision history for this message
Uday Reddy (reddyuday) wrote :

If you find that VM + BBDB is changing focus while navigating through the folders in Aquamacs, please use the solutions mentioned at the bottom of this session. There is a known incompatibility between BBDB and Aquamacs.

Uday Reddy

Changed in vm:
status: Incomplete → Invalid
milestone: 8.1.94a → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.