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'losesminibufferfocuswhenitcalls`list-processes' Date: Wed, 15 Aug 2012 12:32:34 +0200 Message-ID: <502B7AC2.70004@gmx.at> References: <501D275D.3000701@gmx.at><7E4F337C7F6A4B8281!ABE6C82A8CA70E@us.ora cle.com><501FE2D4.1 050103@gmx.at><559D41024BC44EAC92C09DC14E1B7362@us.oracle.com><5022103E.6060502@gmx.at><72C02B3C324744308FB2DF605F46CCA3@us.oracle.com> <502378A8.90!10707@gmx.at> <5026266! 6.2060809@gmx.at> <502!785DF.1040200@gmx.at> <5028! A8FD.60705@gmx .at> < EE0A8E04D35647FE8CAAC52A84777A82@us.oracle.com> <502! A160E.5040601@gmx.at> <4AF3BD064346446AB0F2AEAB5DDCB9DA@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 1345026805 31773 80.91.229.3 (15 Aug 2012 10:33:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 15 Aug 2012 10:33:25 +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 Wed Aug 15 12:33:26 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 1T1aui-0001kv-AA for geb-bug-gnu-emacs@m.gmane.org; Wed, 15 Aug 2012 12:33:24 +0200 Original-Received: from localhost ([::1]:58432 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1auh-0006EH-Bf for geb-bug-gnu-emacs@m.gmane.org; Wed, 15 Aug 2012 06:33:23 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36169) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1aue-0006Dv-Tw for bug-gnu-emacs@gnu.org; Wed, 15 Aug 2012 06:33:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1aud-0008E7-LJ for bug-gnu-emacs@gnu.org; Wed, 15 Aug 2012 06:33:20 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48364) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1aud-0008E2-HY for bug-gnu-emacs@gnu.org; Wed, 15 Aug 2012 06:33:19 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1T1b33-0006bG-V8 for bug-gnu-emacs@gnu.org; Wed, 15 Aug 2012 06:42: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: Wed, 15 Aug 2012 10:42: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.134502727425313 (code B ref 11939); Wed, 15 Aug 2012 10:42:01 +0000 Original-Received: (at 11939) by debbugs.gnu.org; 15 Aug 2012 10:41:14 +0000 Original-Received: from localhost ([127.0.0.1]:57910 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T1b2H-0006aE-LF for submit@debbugs.gnu.org; Wed, 15 Aug 2012 06:41:14 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.23]:49240) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1T1b2E-0006a6-Np for 11939@debbugs.gnu.org; Wed, 15 Aug 2012 06:41:12 -0400 Original-Received: (qmail invoked by alias); 15 Aug 2012 10:32:26 -0000 Original-Received: from 62-47-38-188.adsl.highway.telekom.at (EHLO [62.47.38.188]) [62.47.38.188] by mail.gmx.net (mp069) with SMTP; 15 Aug 2012 12:32:26 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+05Ex8YYW0MNyWiyV831Cu+F8H9JAg0+UvXafeLx 2rm4alVnlTqwiU In-Reply-To: <4AF3BD064346446AB0F2AEAB5DDCB9DA@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:63189 Archived-At: >> All I can say is that for me `one-window-p' is much too hard to >> understand. I wouldn't use it. Can't you compare the results of >> `frame-first-window' and `minibuffer-window' instead? > > Is that sure to DTRT? If so, fine. I am not familiar with > `frame-first-window'. It was certainly not obvious to me that if those two are > eq then the frame can only be showing a minibuffer window (no other windows). > > `f-f-w' is written in C, and its definition has changed somewhat over Emacs > releases. But if I pass a frame parameter ... frame argument, I suppose ... > then I guess the different > definitions should amount to the same thing. I'll give that a try. >> Hardly. Neither of these should affect focus. > > What can I say? `save-selected-window' sure seems to. What can I say? `select-window' ends up calling somewhere do_switch_frame which has #ifdef HAVE_WINDOW_SYSTEM if (track && FRAME_WINDOW_P (XFRAME (frame))) { Lisp_Object focus, xfocus; xfocus = x_get_focus_frame (XFRAME (frame)); if (FRAMEP (xfocus)) { focus = FRAME_FOCUS_FRAME (XFRAME (xfocus)); if (FRAMEP (focus) && XFRAME (focus) == SELECTED_FRAME ()) Fredirect_frame_focus (xfocus, frame); } } #endif /* HAVE_X_WINDOWS */ which _apparently_ directs focus away from one of your frames when it's called for the first time and does not direct focus back to that frame when it's called for the second time. If you (like me) do not understand why and how such a thing happens, you maybe understand why I propose to side-step `select-window' in the first place. >> No. All I can say is that manually selecting the >> `minibuffer-window' seems harmful. > > FWIW, I have not encountered any bugs selecting it Maybe because in all other cases you explicitly wanted to select it (not just temporarily/implicitly). > (whatever you might mean by > "manually"), By "manually" I mean that you "explicitly" select it. I always leave it to Emacs to select the minibuffer window. >> > You seem to be saying that Emacs has introduced bugs, and >> > nothing more. >> >> Where did I say that? > > In the text you snipped, just before that sentence of mine: > >>> I can't explain any of these. In the past, I tried to >>> make most window functions work on any window/frame to >>> work independently from the selected window. Earlier, >>> selecting a window must have been a very simple procedure. >>> Nowadays, this incurs so many side-effects in the >>> window/frame/display area that you should >>> try to avoid `select-window' wherever possible. > > And by "nothing more" I meant no more explanation: your "I can't explain any of > these". The fact that I can't explain something means just that: I'm too silly to comprehend what's going on - but not that Emacs has introduced any bugs. Meanwhile Emacs has to interact with too many different operating systems and window managers, in particular when multiple frames are involved. >> IIUC all Emacs version behave the same wrt your >> scenario. > > Correct. It is you who suggested that selecting a window used to be simpler > than now, ... because people working with a different OS want Emacs to DTRT on their OS and selecting a window which implicitly selects a frame had to cope with their needs ... > and that now it has "many" side effects - so much so that you advise > people to avoid `select-window'. My finding was that the `save-selected-window' > changes-the-focus bug is present in all Emacs releases (20 through 24). ... and to solve this we probably have to add another twist as soon as someone is able to understand and resolve this particular issue ... > It was not obvious to me that `frame-first-window' could be used to test for > only-one-window-ness, or that the doc prior to Emacs 24 for `one-window-p' was > not correct wrt a frame argument. Your simplifications are welcome, but they > were far from obvious, to me. To me as well. I tried to find out which function was present in early Emacsen and whether it could DTRT (in principle). martin