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: Mon, 23 Jul 2012 11:34:11 +0200 Message-ID: <500D1A93.606@gmx.at> References: <500173A5.3040608@gmx.at> <1986D90E22154321A44B6E0110CA4F5A@us.oracle.com> <50019C2F.8060103@gmx.at> <6B9036DBFDEF4881AB39804520BF63B3@us.oracle.com> <5002BEC6.3040106@gmx.at> <893E59C2E4F94D6EB910560C9E8C42CD@us.oracle.com> <5002EAF4.5080107@gmx.at> <6F73D04E8EE144E780D602DFEBA48E7B@us.oracle.com> <5003DAF2.2060400@gmx.at> <50043C3D.7090201@gmx.at> <208B7D7BB4BC4339ADCC1166F76C1CD2@us.oracle.com> <500449B7.6070309@gmx.at> <023F63BCBF9442EBAEDCCE9D8A59E5E4@us.oracle.com> <5005354E.6040306@gmx.at> <62CF21F0010048E2BC1391192EB943FF@us.oracle.com> <5006E14B.3000407@gmx.at> <47731CC5C6EC4ED9AB9E9E05E259572C@us.oracle.com> <5007E47B.3050907@gmx.at> <446B437450EC47968D15C20D7142296B@us.oracle.com> <500A8C0E.4040006@gmx.at> <96A974694CF64567A3EAB85185AB3A5C@us.oracle.com> <500BBE6F.6020007@gmx.at> <1403DD3D67534F53BC023CC99A258DF5@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 1343036091 441 80.91.229.3 (23 Jul 2012 09:34:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 23 Jul 2012 09:34:51 +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 Mon Jul 23 11:34:48 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 1StF2N-0008GT-IR for geb-bug-gnu-emacs@m.gmane.org; Mon, 23 Jul 2012 11:34:47 +0200 Original-Received: from localhost ([::1]:53870 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StF2M-0002GB-TT for geb-bug-gnu-emacs@m.gmane.org; Mon, 23 Jul 2012 05:34:46 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55953) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StF2B-0001iC-9g for bug-gnu-emacs@gnu.org; Mon, 23 Jul 2012 05:34:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1StF25-0003Ba-FE for bug-gnu-emacs@gnu.org; Mon, 23 Jul 2012 05:34:35 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49425) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StF25-0003BT-Bt for bug-gnu-emacs@gnu.org; Mon, 23 Jul 2012 05:34:29 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1StF8Q-00049C-2h for bug-gnu-emacs@gnu.org; Mon, 23 Jul 2012 05:41:02 -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: Mon, 23 Jul 2012 09:41: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.134303642815889 (code B ref 11939); Mon, 23 Jul 2012 09:41:01 +0000 Original-Received: (at 11939) by debbugs.gnu.org; 23 Jul 2012 09:40:28 +0000 Original-Received: from localhost ([127.0.0.1]:58967 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1StF7r-00048D-In for submit@debbugs.gnu.org; Mon, 23 Jul 2012 05:40:27 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.23]:39109) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1StF7p-000485-2m for 11939@debbugs.gnu.org; Mon, 23 Jul 2012 05:40:26 -0400 Original-Received: (qmail invoked by alias); 23 Jul 2012 09:33:50 -0000 Original-Received: from 62-47-50-184.adsl.highway.telekom.at (EHLO [62.47.50.184]) [62.47.50.184] by mail.gmx.net (mp037) with SMTP; 23 Jul 2012 11:33:50 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19Cn6tx9WpCz5tMByM5DeO28IxWHUSYFB2q7XXn85 2Jsc5ey+BEFuLR In-Reply-To: <1403DD3D67534F53BC023CC99A258DF5@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:62303 Archived-At: >> > 1. When I do C-x C-c, and respond to the yes/no question, >> > it seems I must wait a tiny bit before typing yes/no. >> > Otherwise, the first char (e.g. `y') is lost, so >> > I end up with just `es' (I see the `y' nowhere). Not a >> > big deal; just FYI. >> >> Does this happen _only_ with your code or also in the emacs >> -Q scenarios _without_ your code? What happens with a >> `y-or-no-p' defalias? > > Not sure what you mean. There is no equivalent in the emacs -Q tests you asked > me to do. There is nothing on post-command-hook etc. So the delay is due to processing `post-command-hook'? >> That's a bad idea in my opinion. Redirect as soon as possible. Why >> don't you use `after-make-frame-functions'? > > I'm not sure what you mean. I tried this: > > 1. Remove the `redirect...' from `1on1-fit-minibuffer-frame'. > > 2. Put back the guard (eq last-event-frame (window-frame (minibuffer-window))) > at the beginning of `1on1-fit-minibuffer-frame' (so it is a no-op otherwise). > > 3. Defined this and added it to `after-make-frame-functions': > > (defun 1on1-redirect-to-minibuffer (new-frame) > "..." > (when (and 1on1-fit-minibuffer-frame-flag > (active-minibuffer-window) > (save-selected-window > (select-window (minibuffer-window)) > (one-window-p nil 'selected-frame))) > (redirect-frame-focus > new-frame > (window-frame (minibuffer-window))))) > > That did not help at all. The original symptoms returned (typing yes/no did not > go to the minibuffer etc.). Here (Emacs 24.1 release because trunk crashes to frequently these days) I can do something like (progn ;; (setq minibuffer-auto-raise t) ;; (setq pop-up-frame-function (lambda () (make-frame '((minibuffer . nil))))) (setq pop-up-frames t) (add-hook 'after-make-frame-functions #'(lambda (frame) (redirect-frame-focus frame frame))) (shell)) where the two forms in comments are optional. In all cases, focus is redirected appropriately after C-x C-c (although I think that when the new frame does have a minibuffer window, no redirection should be done at all and the prompt should appear in the new frame - but it seems difficult to get that right). And obviously things look better with `minibuffer-auto-raise' non-nil. martin