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 whenit calls `list-processes' Date: Thu, 26 Jul 2012 11:44:11 +0200 Message-ID: <5011116B.4010106@gmx.at> References: <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><838veb209m.fsf@gnu.org> <83r4s2zcp9.fsf@gnu.org><81CFBB36FDCB4CD6B3762F9E00AC8290@us.oracle.com><83fw8iz7et.fsf@gnu.org><60948DD3935D452F85F95174474D06E9@us.oracle.com><838veaz34x.fsf@gnu.org> <83629blssa.fsf@gnu.org> 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 1343295863 26204 80.91.229.3 (26 Jul 2012 09:44:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 26 Jul 2012 09:44:23 +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 Thu Jul 26 11:44:21 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 1SuKcD-0006hq-EP for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Jul 2012 11:44:17 +0200 Original-Received: from localhost ([::1]:48285 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuKcC-0006k5-Ph for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Jul 2012 05:44:16 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuKc9-0006k0-Ux for bug-gnu-emacs@gnu.org; Thu, 26 Jul 2012 05:44:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SuKc8-0003eh-Rp for bug-gnu-emacs@gnu.org; Thu, 26 Jul 2012 05:44:13 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59040) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SuKc8-0003ed-OW for bug-gnu-emacs@gnu.org; Thu, 26 Jul 2012 05:44:12 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SuKik-0006Vl-IG for bug-gnu-emacs@gnu.org; Thu, 26 Jul 2012 05:51: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: Thu, 26 Jul 2012 09:51: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.134329625825013 (code B ref 11939); Thu, 26 Jul 2012 09:51:02 +0000 Original-Received: (at 11939) by debbugs.gnu.org; 26 Jul 2012 09:50:58 +0000 Original-Received: from localhost ([127.0.0.1]:40352 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SuKif-0006VO-NE for submit@debbugs.gnu.org; Thu, 26 Jul 2012 05:50:58 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.23]:45293) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1SuKic-0006VF-Ei for 11939@debbugs.gnu.org; Thu, 26 Jul 2012 05:50:55 -0400 Original-Received: (qmail invoked by alias); 26 Jul 2012 09:44:03 -0000 Original-Received: from 62-47-53-226.adsl.highway.telekom.at (EHLO [62.47.53.226]) [62.47.53.226] by mail.gmx.net (mp039) with SMTP; 26 Jul 2012 11:44:03 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18x3ScC3iYxyaH/D8dPFgIULfGo9K+6SbBnzx8ujj D71zyzHGu2qwvg In-Reply-To: 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:62400 Archived-At: > (add-hook 'after-make-frame-functions > (lambda (frame) > (redirect-frame-focus frame frame))) > > I then ran through the scenario that lead to a crash (C-x C-c, no to exit, C-x k > *shell* + yes, C-x k again, try to type or move cursor). > > No crash in this case, but when I try to type something or move the cursor after > the second C-x k (which is the point at which the crash occurred), I can see > that the input is being sent to buffer & frame *Process List*. That's not what > you expected, is it? It is not TRT, in any case. > > I do not understand, BTW, why you redirect the focus from the new frame to > itself, instead of to the minibuffer frame. I came to this when trying out various scenarios and it seemed this worked for me. > So I tried instead redirecting the focus to the minibuffer frame. That worked > OK, but the default buffer for killing with C-x k was ` *Minibuf-0*', not > *shell* or *Process List*. > > It seems that when a new frame is created, the default value for C-x k (and > other buffer commands) becomes *Minibuf-0*. I can of course choose not to use > the default value, but it would be good to get this part fixed also. You mean *Minibuf-0* became the current buffer? Probably so because you selected its window. > Or as a workaround I can explicitly select the frame of the buffer I want to > kill - e.g., click the title bar of frame *shell*. After I do that, that buffer > becomes the default value for C-x k. > > IOW, it seems that not only is the input focus redirected to the minibuffer > frame, but also the current buffer is changed to *Minibuf-0*. And if I do `M-: > (current-buffer)' I do get *Minibuf-0*. Is it normal for frame-focus > redirection to change the current buffer also? That does not seem right to me. I nowhere in the code see that it does. Are you sure you did not use `select-frame-set-input-focus' in this case? > Anyway, aside from this problem of default value for C-x k, things seemed to > work OK. So overall this seems like a reasonable solution, except for the > default buffer problem. This is all I did, along with my usual setup: > > (add-hook 'after-make-frame-functions > (lambda (frame) > (redirect-frame-focus frame (window-frame (minibuffer-window))))) That was my initial idea. I forgot why it didn't work (maybe it failed when I created a new frame with a minibuffer). martin