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: Tue, 14 Aug 2012 18:04:58 +0200 Message-ID: <502A772A.9030902@gmx.at> References: <501BAAB0.1020!807@gmx!.at><6461CCBF2903416 0B48D267E46D6FF0E@us.oracle.com><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> 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 1344960332 14468 80.91.229.3 (14 Aug 2012 16:05:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 14 Aug 2012 16:05:32 +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 Tue Aug 14 18:05:32 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 1T1Jca-0002Wy-Bg for geb-bug-gnu-emacs@m.gmane.org; Tue, 14 Aug 2012 18:05:32 +0200 Original-Received: from localhost ([::1]:55249 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1JcZ-0002vv-Dp for geb-bug-gnu-emacs@m.gmane.org; Tue, 14 Aug 2012 12:05:31 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1JcU-0002vl-He for bug-gnu-emacs@gnu.org; Tue, 14 Aug 2012 12:05:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1JcS-00070M-0k for bug-gnu-emacs@gnu.org; Tue, 14 Aug 2012 12:05:26 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46989) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1JcR-00070F-So for bug-gnu-emacs@gnu.org; Tue, 14 Aug 2012 12:05:23 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1T1Jko-0000JY-6k for bug-gnu-emacs@gnu.org; Tue, 14 Aug 2012 12:14: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: Tue, 14 Aug 2012 16:14: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.13449608021140 (code B ref 11939); Tue, 14 Aug 2012 16:14:02 +0000 Original-Received: (at 11939) by debbugs.gnu.org; 14 Aug 2012 16:13:22 +0000 Original-Received: from localhost ([127.0.0.1]:56531 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T1Jk9-0000IK-TD for submit@debbugs.gnu.org; Tue, 14 Aug 2012 12:13:22 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.23]:60999) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1T1Jk7-0000IC-D9 for 11939@debbugs.gnu.org; Tue, 14 Aug 2012 12:13:20 -0400 Original-Received: (qmail invoked by alias); 14 Aug 2012 16:04:39 -0000 Original-Received: from 62-47-55-43.adsl.highway.telekom.at (EHLO [62.47.55.43]) [62.47.55.43] by mail.gmx.net (mp033) with SMTP; 14 Aug 2012 18:04:39 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+64n1SIj+6Kmytu7mQraxnWp17K+4RU3TGp+kz8e IlNIu03VIvzxH5 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:63158 Archived-At: >> Any reason why you don't use >> (one-window-p nil (window-frame (minibuffer-window))) >> here? > > The doc for `one-window-p', for Emacs < 24, says this: > > "If ALL-FRAMES is neither nil nor t, count only the selected frame." [...] IIUC `one-window-p' calls `next-window' ever since with the ALL-FRAMES argument unchanged and `next-window' has its traditional interpretation of that argument. So it seems that the old doc-string was inaccurate in this regard. But why you don't you check for yourself? With Emacs 22 (progn (setq old-frame (selected-frame)) (setq new-frame (make-frame)) (select-frame new-frame) (split-window) (select-frame old-frame) (one-window-p nil new-frame)) gets me nil as expected. > Note: I have this comment in the code just before the call to `one-window-p'. I > do not recall the issue, but the comment has been there for quite a while: > > ;; We should be able to use just (one-window-p), > ;; but an Emacs bug means we need this: > (one-window-p nil 'selected-frame))) > > Does that ring a bell? No. > Even if that bug has since been fixed, I will presumably > need to keep that, for older releases. Just wondering if you recall anything > about that bug. 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? >> You mean that `save-select[ed]-window' can redirect focus and not >> direct it back to where it was before calling it? > > That's certainly what it seems like. And there is definitely a difference here > wrt what `save-window-excursion' does (that function DTRT here). Perhaps this > info gives you a starting point for investigating. Hardly. Neither of these should affect focus. >> If this is the case, please check whether it happens in Emacs 23 >> as well and file a bug report (without referencing >> `1on1-fit-minibuffer-frame', if possible). > > Yes, AFAICT the behavior is the same in all Emacs versions. > > Do you have a suggestion for a simpler test? If so, perhaps you can test it. No idea. >> > 2. This was called near the beginning of the >> > `1on1-fit-minibuffer-frame' body: >> > >> > (let* ((frame (save-selected-window >> > (select-window (minibuffer-window)) >> > (selected-frame))) >> >> Do you mean (window-frame (minibuffer-window)) here? > > I suppose so. _Should_ that make a difference? Apparently it does make a difference in your case. >> No. Can't you distill a simple test case? `redisplay' shouldn't care >> about frame focus either. > > You are saying the same thing I am. Can you distill a simpler test case? No. All I can say is that manually selecting the `minibuffer-window' seems harmful. > You seem to be saying that Emacs has introduced bugs, and nothing more. Where did I say that? IIUC all Emacs version behave the same wrt your scenario. > OK, so > I hear the admonition to avoid `select-window' wherever possible. That's a > sorry state, though. You seem to be saying that things that used to work, and > work simply, are now so bugged or complicated that all we can advise is to avoid > using `select-window'. Selecting a window or a frame for the sole purpose to retrieve or compare a value related to that window is plain overkill given that `select-window' also selects a frame, makes a buffer current ... > I would like to know about `one-window-p', however. Is the Emacs 24 doc string > wrong? The code is identical to the code for Emacs 20.7, but suddenly we have a > very different behavior description. Is the new description correct for Emacs > 24 plus older releases? That would be good news (just an old-doc bug). For the > moment, the situation is not clear. I think it was a bug in the old doc-string. martin