From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#11939: 24.1; `save-buffers-kill-emacs' loses minibuffer focus when it calls `list-processes' Date: Sat, 14 Jul 2012 18:19:59 +0200 Message-ID: <50019C2F.8060103@gmx.at> References: <500173A5.3040608@gmx.at> <1986D90E22154321A44B6E0110CA4F5A@us.oracle.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1342282826 27174 80.91.229.3 (14 Jul 2012 16:20:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 14 Jul 2012 16:20:26 +0000 (UTC) Cc: 11939@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 14 18:20:25 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Sq54x-0004E3-7Q for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 Jul 2012 18:20:23 +0200 Original-Received: from localhost ([::1]:39541 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sq54w-0004HZ-G7 for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 Jul 2012 12:20:22 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sq54t-0004HO-Rg for bug-gnu-emacs@gnu.org; Sat, 14 Jul 2012 12:20:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sq54s-0001YE-BC for bug-gnu-emacs@gnu.org; Sat, 14 Jul 2012 12:20:19 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59995) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sq54s-0001Y9-8L for bug-gnu-emacs@gnu.org; Sat, 14 Jul 2012 12:20:18 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Sq5AP-0004fn-OO for bug-gnu-emacs@gnu.org; Sat, 14 Jul 2012 12:26:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Jul 2012 16:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11939 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11939-submit@debbugs.gnu.org id=B11939.134228310317899 (code B ref 11939); Sat, 14 Jul 2012 16:26:01 +0000 Original-Received: (at 11939) by debbugs.gnu.org; 14 Jul 2012 16:25:03 +0000 Original-Received: from localhost ([127.0.0.1]:41308 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sq59T-0004ed-Ae for submit@debbugs.gnu.org; Sat, 14 Jul 2012 12:25:03 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:52235) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1Sq59Q-0004eD-6o for 11939@debbugs.gnu.org; Sat, 14 Jul 2012 12:25:02 -0400 Original-Received: (qmail invoked by alias); 14 Jul 2012 16:19:14 -0000 Original-Received: from 62-47-47-202.adsl.highway.telekom.at (EHLO [62.47.47.202]) [62.47.47.202] by mail.gmx.net (mp038) with SMTP; 14 Jul 2012 18:19:14 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+yi0YcSe2yk4xj8MPgaCYY4e3qUQIeA5OjdtuwVz 0SxK6Y5PvK929Q In-Reply-To: <1986D90E22154321A44B6E0110CA4F5A@us.oracle.com> X-Y-GMX-Trusted: 0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:61941 Archived-At: > In the problematic contexts, a new frame is popped up and given the focus (by MS > Windows). That is apparently somehow different from starting from a frame that > already has the focus. OK. What happens if in in `yes-or-no-p' you use (when minibuffer-auto-raise (select-frame-set-input-focus (window-frame (minibuffer-window)))) instead of `raise-frame'? > If I had to guess blindly, I'd guess that it has to do with the > timing/sequencing of things: Maybe in the problematic case the question is FIRST > posed in the minibuffer/echo area (giving the minibuffer frame focus) and THEN > the new frame is popped up and it gets the focus. I suppose `handle-switch-frame' is called after the `yes-or-no-p'. Then even the `select-frame-set-input-focus' would not help. > Whereas maybe in the case I just tested the focus never comes back to the frame > that originally had it - once the focus goes to the minibuffer frame, there is > nothing that puts it back in the original frame. Just a hunch. > > If that is the case, maybe a fix (ugly hack) would be to do this: Whenever the > minibuffer frame has focus and some other frame is created, immediately return > focus to the minibuffer frame. (Dunno _how_ that might be done.) What happens if in `with-temp-buffer-window' you add a `save-selected-window' around (with-current-buffer ,buffer (setq ,value (progn ,@body)) (setq ,window (temp-buffer-window-show ,buffer))) > Or perhaps look to what Dired does... Dired uses a `save-window-excursion' which doesn't deal with the frame but restores the selected window - maybe that's the reason. > 1. FYI - I can test only with 24.1, not something later, since other bugs still > prevent my using the later Windows builds. I'm still waiting for a build more > recent than 2012-07-02. Dunno whether this matters here. What I sent should work with 24.1. > 2. I tried to quit Emacs (C-x C-c) after creating a shell buffer (which is in a > dedicated window in a separate frame). > > The informative buffer that lists the active processes was popped up correctly > in a separate frame as the yes-or-no question was asked. But when I tried to > type yes or no, that typed input appeared nowhere. > > I would guess, from the fact that Windows gives the new frame the input focus, > that that new frame had the focus and the input was trying to go there. But > that buffer is created read-only and I saw no error message indicating that > Emacs was trying to insert the input (yes/no) into a read-only buffer. No > feedback at all - it's as if my typed input was silently sent to /dev/null. > (That in itself is not good.) > > In any case, what's important is that the typed input did not go to the > minibuffer frame. Can you try with just `pop-up-frames' t, that is, disabling special display buffers? > [...] > I thought that the patch I sent for this was going to be applied to Emacs - but > it never was. I use this code everyday, with no problem. But the dialog is > still broken in vanilla Emacs. I understand your concerns. But we have to first find out why your system behaves differently and then try to find a general solution. BTW, has bug#11566 been resolved meanwhile? martin