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'losesminibufferfocuswhenitcalls`list-processes' Date: Mon, 13 Aug 2012 15:20:53 -0700 Message-ID: References: <50156DFE.6090807@gmx.at><50165035.409040 1@gmx.at><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> 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 1344896497 24345 80.91.229.3 (13 Aug 2012 22:21:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 13 Aug 2012 22:21:37 +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 Tue Aug 14 00:21:37 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 1T130w-0006oW-B4 for geb-bug-gnu-emacs@m.gmane.org; Tue, 14 Aug 2012 00:21:34 +0200 Original-Received: from localhost ([::1]:42122 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T130v-0005D8-A6 for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Aug 2012 18:21:33 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54444) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T130s-0005D3-1c for bug-gnu-emacs@gnu.org; Mon, 13 Aug 2012 18:21:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T130q-0006uT-Ma for bug-gnu-emacs@gnu.org; Mon, 13 Aug 2012 18:21:29 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44842) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T130q-0006uL-Il for bug-gnu-emacs@gnu.org; Mon, 13 Aug 2012 18:21:28 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1T1398-0002Ho-Ja for bug-gnu-emacs@gnu.org; Mon, 13 Aug 2012 18:30: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, 13 Aug 2012 22:30: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.13448969748721 (code B ref 11939); Mon, 13 Aug 2012 22:30:02 +0000 Original-Received: (at 11939) by debbugs.gnu.org; 13 Aug 2012 22:29:34 +0000 Original-Received: from localhost ([127.0.0.1]:54386 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T138g-0002Gb-9e for submit@debbugs.gnu.org; Mon, 13 Aug 2012 18:29:34 -0400 Original-Received: from rcsinet15.oracle.com ([148.87.113.117]:47258) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T138d-0002GU-Pr for 11939@debbugs.gnu.org; Mon, 13 Aug 2012 18:29:33 -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 q7DMKtNa026583 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 13 Aug 2012 22:20:56 GMT Original-Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q7DMKsUw022502 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 13 Aug 2012 22:20:55 GMT Original-Received: from abhmt106.oracle.com (abhmt106.oracle.com [141.146.116.58]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q7DMKsqv027667; Mon, 13 Aug 2012 17:20:54 -0500 Original-Received: from dradamslap1 (/130.35.178.248) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 13 Aug 2012 15:20:54 -0700 X-Priority: 1 (Highest) X-MSMail-Priority: High X-Mailer: Microsoft Office Outlook 11 Thread-Index: Ac15IxZik1v5ur83S6KlJS2YrcJW1AAL/lSQABBBMzA= X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 In-Reply-To: Importance: High 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:63124 Archived-At: Coming back to an earlier part of this thread. I have some news. I found today that the code you sent does not help in at least one situation. I presume that's because it deals only with temporary buffers, but I'm not sure. The buffer popped up in a separate frame is *Completions*. By "does not help" I mean that it makes no difference in this case whether I load your code or not. Anyway, the scenario involves using my one-on-one stuff with a vanilla Emacs call to `completing-read' or `completing-read-multiple'. [I discovered this because the latter (`c-r-m') does not use anything particular in Icicles, so `customize-face' (via `read-face-name') just calls vanilla `completing-read-multiple' even in Icicle mode.] M-x customize-face b TAB then, trying to type more chars raises an error saying that *Completions* is read-only (IOW, the *Completions* frame was somehow given the input focus). I looked into the problem a little more closely. None of the hacks I had tried previously with `1on1-fit-minibuffer-frame' took care of this problem: neither guarding the minibuffer frame-fitting, using (eq last-event-frame (window-frame (minibuffer-window))) nor adding explicit redirection to the minibuffer frame at the end of `1on1-fit-minibuffer-frame'. It turns out that the problem was 3-fold. That is, there were three places in the code of `1on1-fit-minibuffer-frame' that caused the problem: each was _alone_ capable of causing the problem, so all three needed to be fixed. Here they are. 1. This was one of the guards of the body of `1on1-fit-minibuffer-frame': (save-selected-window (select-window (minibuffer-window)) (one-window-p nil 'selected-frame)) The call to `save-selected-window' somehow gave the focus to the *Completions* frame. The solution was to change `save-selected-window' to `save-window-excursion' here. I don't know why, but I'm hoping you will. 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))) The fix here too was to use `save-window-excursion' instead of `save-selected-window'. 3. At the end of the `1on1-fit-minibuffer-frame' body there is this call: (1on1-set-minibuffer-frame-top/bottom) The code for that function is this: (defun 1on1-set-minibuffer-frame-top/bottom () (when 1on1-minibuffer-frame (condition-case nil (if (fboundp 'redisplay) (redisplay t) (force-mode-line-update t)) (error nil)) ; Ignore errors from, e.g., killed buffers. (modify-frame-parameters 1on1-minibuffer-frame `((top ,@ (or 1on1-minibuffer-frame-top/bottom (- (* 2 (frame-char-height 1on1-minibuffer-frame))))))))) Here the problem was the call to `redisplay'. I changed (foundp 'redisplay) to just nil to fix things - `force-mode-line-update' works without changing the focus. `redisplay' is defined in C code. I do not know why it causes a problem here (why would redisplay change the input focus?), and I don't know what the proper solution might be, except to just use `force-mode-line-update' as I was already doing in older Emacs versions (which do not have `redisplay'). Do you have an idea about this? Does any of this make sense to you? Each of these fixes is needed for `1on1-fit-minibuffer-frame'. Reverting any of them brings back the problem (giving *Completions* the focus). I do not understand any of these fixes (why they work), and I am certainly not claiming anything about them or about the problem, which I do not understand. I am only saying that together these changes fix the problem I encountered. But if you can explain things I will be glad to learn. Thx/HTH - Drew