Subject: bug#11939: 24.1; `save-buffers-kill-emacs' loses minibuffer focus when it calls `list-processes'

From: martin rudalics <[email-masked]>
Date: Sat, 14 Jul 2012 15:27:01 +0200

> IF you use a standalone minibuffer frame, AND the popped up buffer is
 > special-display (e.g. because of `special-display-regexps'), AND you are
 > on MS Windows (which automatically shifts the focus to a new frame that
 > it creates), THEN:
 >
 > 1. When you try to exit Emacs with active processes, Emacs pops up a new
 > frame for buffer `*Process List*' and asks you about killing them.
 >
 > 2. But the minibuffer frame no longer has the focus!  So when you type
 > your answer (e.g. "yes") Emacs tries to insert it as text in buffer
 > `*Process List*'.  Poor Emacs.

What is your value of `minibuffer-auto-raise'?  Maybe `yes-or-no-p'
should do `select-frame-set-input-focus' in your case.  What happens
usually when you ask a `yes-or-no-p' question in a non-minibuffer frame?

 > Please do something to fix this.

I'm afraid, most people here can't reproduce your problem.  We probably
have to invent some new option to handle it.  In any case, we'd have to
investigate the underlying problem.

 > For inspiration, perhaps look to
 > `dired-mark-pop-up' which does something similar but gets it right.  See
 > perhaps `dired-pop-to-buffer'.
 >
 > Better would be to fix this ask-for-input-after-popping-up-some-info
 > problem generally, obviously.  But a fix for just this particular
 > query will be better than nothing.
 >
 > At least Dired DTRT now wrt focus - that's already something.
 >
 > Of course, for Dired I still have to modify `dired-mark-pop-up' anyway, to have
 > it delete the window or frame popped up, afterward, and bury its buffer.  See
 > bug #7533 - a patch was provided for this but AFAIK Emacs Dev has never applied
 > it.

Try to load the attached file and tell me which problems you see.

Thanks, martin