From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" 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 09:12:00 -0700 Message-ID: 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> <500D1A93.606@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1343059959 4055 80.91.229.3 (23 Jul 2012 16:12:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 23 Jul 2012 16:12:39 +0000 (UTC) Cc: 11939@debbugs.gnu.org To: "'martin rudalics'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 23 18:12:38 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 1StLFN-0004g6-OA for geb-bug-gnu-emacs@m.gmane.org; Mon, 23 Jul 2012 18:12:38 +0200 Original-Received: from localhost ([::1]:44419 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StLFN-0003zF-09 for geb-bug-gnu-emacs@m.gmane.org; Mon, 23 Jul 2012 12:12:37 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StLFG-0003ys-1G for bug-gnu-emacs@gnu.org; Mon, 23 Jul 2012 12:12:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1StLFE-0004th-9v for bug-gnu-emacs@gnu.org; Mon, 23 Jul 2012 12:12:29 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51694) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StLFE-0004sO-3k for bug-gnu-emacs@gnu.org; Mon, 23 Jul 2012 12:12:28 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1StLLa-0000oH-Fd for bug-gnu-emacs@gnu.org; Mon, 23 Jul 2012 12:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Jul 2012 16:19:02 +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.13430603213046 (code B ref 11939); Mon, 23 Jul 2012 16:19:02 +0000 Original-Received: (at 11939) by debbugs.gnu.org; 23 Jul 2012 16:18:41 +0000 Original-Received: from localhost ([127.0.0.1]:33004 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1StLLE-0000my-FQ for submit@debbugs.gnu.org; Mon, 23 Jul 2012 12:18:41 -0400 Original-Received: from rcsinet15.oracle.com ([148.87.113.117]:36235) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1StLLC-0000mm-ES for 11939@debbugs.gnu.org; Mon, 23 Jul 2012 12:18:39 -0400 Original-Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q6NGC2jV009106 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 23 Jul 2012 16:12:02 GMT Original-Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q6NGC1TD009884 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 23 Jul 2012 16:12:01 GMT Original-Received: from abhmt115.oracle.com (abhmt115.oracle.com [141.146.116.67]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q6NGC1q7014404; Mon, 23 Jul 2012 11:12:01 -0500 Original-Received: from dradamslap1 (/130.35.179.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 23 Jul 2012 09:12:01 -0700 X-Mailer: Microsoft Office Outlook 11 In-reply-to: <500D1A93.606@gmx.at> Thread-Index: Ac1otkaDlNjcXDsxSGmPyy4rwlV3uwAMwUPA X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: acsinet21.oracle.com [141.146.126.237] 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:62315 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'? Is that a question or an answer? ;-) If it is a question, I don't have the answer. I can only report the symptom: the first char is seemingly lost (does not show up in the minibuffer, at least, and I have not seen it anywhere else). As I said, this is not a big deal. I mention it FYI. > >> 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. Yes, if I try that with emacs -Q then it does what you say (with Emacs 24.1 and later). And uncommenting those two lines also behaves as I think you intend. In both cases, the question is posed, and the response is accepted, in the minibuffer of frame *shell* (i.e., not the minibuffer of frame *Process List* in the case where it has one). But if *Process List* has no minibuffer (uncommented test case), and it is selected (e.g., later, manually, after replying "no" once) when you hit `C-x C-c' (i.e., the second `C-x C-c'), then frame *shell* is raised and receives the input, even though there is nothing on that frame that the user needs to see (apart from the question/answer). It is better, IMO, for the question/response to be in frame *Process List*, as we discussed earlier. (This is all for the case where there is no standalone minibuffer frame.) The reason I provided the description I did was that I thought we were talking about my setup with a standalone minibuffer frame. See my previous description (quoted above) for what happens in that context. For that context, your suggestion of using `after-make-frame-functions', as I understood it, did not help.