From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#9639: 24.0.90; Problem with bury-buffer in minibuffer-hide-completions Date: Sat, 01 Oct 2011 12:03:06 +0200 Message-ID: <87r52xkp0l.fsf@escher.home> References: <87hb3thebv.fsf@escher.home> <4E86D879.7060105@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1317463440 19297 80.91.229.12 (1 Oct 2011 10:04:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 1 Oct 2011 10:04:00 +0000 (UTC) Cc: 9639@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 01 12:03:56 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R9wQG-0001C8-6B for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Oct 2011 12:03:56 +0200 Original-Received: from localhost ([::1]:36899 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9wQF-0003ID-LH for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Oct 2011 06:03:55 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:54873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9wQD-0003Ac-0t for bug-gnu-emacs@gnu.org; Sat, 01 Oct 2011 06:03:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R9wQB-0004K3-HI for bug-gnu-emacs@gnu.org; Sat, 01 Oct 2011 06:03:52 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48793) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9wQB-0004Jz-DF for bug-gnu-emacs@gnu.org; Sat, 01 Oct 2011 06:03:51 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1R9wRK-0000uf-8w for bug-gnu-emacs@gnu.org; Sat, 01 Oct 2011 06:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 01 Oct 2011 10:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9639 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9639-submit@debbugs.gnu.org id=B9639.13174634553459 (code B ref 9639); Sat, 01 Oct 2011 10:05:02 +0000 Original-Received: (at 9639) by debbugs.gnu.org; 1 Oct 2011 10:04:15 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R9wQZ-0000tj-2P for submit@debbugs.gnu.org; Sat, 01 Oct 2011 06:04:15 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.23]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1R9wQW-0000tZ-BO for 9639@debbugs.gnu.org; Sat, 01 Oct 2011 06:04:13 -0400 Original-Received: (qmail invoked by alias); 01 Oct 2011 10:02:59 -0000 Original-Received: from i59F56B46.versanet.de (EHLO escher.home) [89.245.107.70] by mail.gmx.net (mp055) with SMTP; 01 Oct 2011 12:02:59 +0200 X-Authenticated: #20778731 X-Provags-ID: V01U2FsdGVkX19Uqh4ojj9UtghIMrFvdMeD+FQc2zi/3ApV04S8TE S/y5lbo8QO0TMx Original-Received: by escher.home (Postfix, from userid 1000) id 41A1021B58; Sat, 1 Oct 2011 12:03:07 +0200 (CEST) In-Reply-To: <4E86D879.7060105@gmx.at> (martin rudalics's message of "Sat, 01 Oct 2011 11:08:09 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux) X-Y-GMX-Trusted: 0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 01 Oct 2011 06:05:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) 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:52033 Archived-At: On Sat, 01 Oct 2011 11:08:09 +0200 martin rudalics wrote: >> 1. emacs -Q >> 2. Type `M-x glo TAB' and at the completion "M-x global-" type TAB again, >> making a *Completions* buffer pop up. >> 3. Type `v TAB', yielding the completion "M-x global-visual-line-mode". >> => The window that had been displaying the *Completions* buffer now >> displays the *Messages* buffer. >> >> AFAICT this is due to the following cond clause in bury-buffer (which is >> called by minibuffer-hide-completions): >> >> ((not (window-dedicated-p)) >> (switch-to-prev-buffer nil 'bury)) > > ... plus the fact that switching buffers should not delete windows ... > >> Only after typing RET in the minibuffer to accept the completion is the >> window that had been displaying the *Completions* buffer and now >> displays the *Messages* buffer deleted; in Emacs 23.2 it is deleted as >> soon as the sole completion is displayed in the minibuffer. Commenting >> out the above clause restores the 23.2 behavior. But this presumably >> has bad effects elsewhere. > > Presumably `minibuffer-hide-completions' should iconify a standalone > completions frame while deleting a split-off completions window. So > maybe the following DTRT: > > (defun minibuffer-hide-completions () > "Get rid of an out-of-date *Completions* buffer." > ;; FIXME: We could/should use minibuffer-scroll-window here, but it > ;; can also point to the minibuffer-parent-window, so it's a bit tricky. > (let* ((window (get-buffer-window "*Completions*" 0)) > (buffer (window-buffer window))) > (when window > (let ((deletable (window-deletable-p window))) > (cond > ((eq deletable 'frame) > ;; Iconify frame. > (iconify-frame (window-frame window)) > (bury-buffer-internal buffer)) > (deletable > ;; Delete window > (delete-window window) > (bury-buffer-internal buffer)) > (t > ;; Switch to another buffer. > (switch-to-prev-buffer window 'bury))))))) I confirm this DTRT for my case. Steve Berman