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#9639: 24.0.90; Problem with bury-buffer in minibuffer-hide-completions Date: Sat, 01 Oct 2011 11:08:09 +0200 Message-ID: <4E86D879.7060105@gmx.at> References: <87hb3thebv.fsf@escher.home> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1317460145 1750 80.91.229.12 (1 Oct 2011 09:09:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 1 Oct 2011 09:09:05 +0000 (UTC) Cc: 9639@debbugs.gnu.org To: Stephen Berman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 01 11:09:01 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 1R9vZ7-0006ST-45 for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Oct 2011 11:09:01 +0200 Original-Received: from localhost ([::1]:55395 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9vZ6-0001I1-J4 for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Oct 2011 05:09:00 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:57605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9vZ0-0001AF-AG for bug-gnu-emacs@gnu.org; Sat, 01 Oct 2011 05:08:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R9vYy-0001sE-Iq for bug-gnu-emacs@gnu.org; Sat, 01 Oct 2011 05:08:54 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60411) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9vYy-0001s4-81 for bug-gnu-emacs@gnu.org; Sat, 01 Oct 2011 05:08:52 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1R9va6-00088G-LR for bug-gnu-emacs@gnu.org; Sat, 01 Oct 2011 05:10: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: Sat, 01 Oct 2011 09:10: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.131746016631201 (code B ref 9639); Sat, 01 Oct 2011 09:10:02 +0000 Original-Received: (at 9639) by debbugs.gnu.org; 1 Oct 2011 09:09:26 +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 1R9vZW-00087B-FF for submit@debbugs.gnu.org; Sat, 01 Oct 2011 05:09:26 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.23]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1R9vZT-000871-Bu for 9639@debbugs.gnu.org; Sat, 01 Oct 2011 05:09:24 -0400 Original-Received: (qmail invoked by alias); 01 Oct 2011 09:08:10 -0000 Original-Received: from 62-47-56-209.adsl.highway.telekom.at (EHLO [62.47.56.209]) [62.47.56.209] by mail.gmx.net (mp047) with SMTP; 01 Oct 2011 11:08:10 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/mYrJbIc7m5jpLzD2k0cJMwvG2JApD36d7+xCUIX NBoZq5gB6FZpNA User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) In-Reply-To: <87hb3thebv.fsf@escher.home> 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 05:10: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:52031 Archived-At: > 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))))))) > (Interestingly, the C code of bury-buffer prior to the move to Lisp in > revision 104559 (and long before that) has the equivalent of the above > clause.) ISTR that completion windows were dedicated then and typing "v TAB" would trigger the following code in `minibuffer-completion-help' ;; If there are no completions, or if the current input is already the ;; only possible completion, then hide (previous&stale) completions. (let ((window (and (get-buffer "*Completions*") (get-buffer-window "*Completions*" 0)))) (when (and (window-live-p window) (window-dedicated-p window)) (condition-case () (delete-window window) (error (iconify-frame (window-frame window)))))) which I can't find anymore. But I might be wrong. martin