all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stephen Berman <stephen.berman@gmx.net>
To: martin rudalics <rudalics@gmx.at>
Cc: 9639@debbugs.gnu.org
Subject: bug#9639: 24.0.90; Problem with bury-buffer in minibuffer-hide-completions
Date: Sat, 01 Oct 2011 12:03:06 +0200	[thread overview]
Message-ID: <87r52xkp0l.fsf@escher.home> (raw)
In-Reply-To: <4E86D879.7060105@gmx.at> (martin rudalics's message of "Sat, 01 Oct 2011 11:08:09 +0200")

On Sat, 01 Oct 2011 11:08:09 +0200 martin rudalics <rudalics@gmx.at> 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





  reply	other threads:[~2011-10-01 10:03 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-30 22:09 bug#9639: 24.0.90; Problem with bury-buffer in minibuffer-hide-completions Stephen Berman
2011-10-01  9:08 ` martin rudalics
2011-10-01 10:03   ` Stephen Berman [this message]
2011-10-01 10:57     ` martin rudalics
2011-10-01 14:41       ` Stefan Monnier
2011-10-01 17:04         ` martin rudalics
2011-10-02  0:38           ` Stefan Monnier
2011-10-02 10:09             ` martin rudalics
2011-10-02 13:39               ` Stefan Monnier
2011-10-04 15:50                 ` martin rudalics
2011-10-04 17:45                   ` Stefan Monnier
2011-10-02 15:35             ` Drew Adams
2011-10-03  0:41               ` Stefan Monnier
2011-10-03  0:48                 ` Drew Adams
2011-10-04 15:51                   ` martin rudalics
2011-10-04 16:03                     ` Drew Adams
2011-10-12  1:36                     ` Christoph Scholtes
2011-10-12  6:52                       ` martin rudalics
2011-10-04 15:51         ` martin rudalics
2011-10-01 14:38   ` Drew Adams
2011-10-01 23:38     ` Leo
2011-10-04 15:50 ` martin rudalics
2011-10-15 10:26   ` bug#5357: 23.1; Attempt to drag rightmost scrollbar martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r52xkp0l.fsf@escher.home \
    --to=stephen.berman@gmx.net \
    --cc=9639@debbugs.gnu.org \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.