Subject: bug#8856: 24.0.50; regression: special-display-frame is no longer dedicated

From: "Drew Adams" <[email-masked]>
Date: Sun, 26 Jun 2011 07:56:33 -0700

> I see it now.  The Completions buffer pop ups up in a normal 
> frame instead.  I attached a fixed copy of window.el, please try it.
> Completing now deletes the Completions frame.  I also restored the
> old meaning of the third argument of `display-buffer' for the
> described frame values.

Bravo!  And thank you.  Completions is now correctly redirected: no more
read-only error.

However, I now see this problem, which might or might not be due to this fix -
dunno.  It seems that the *Completions* window is still not a proper dedicated
window, at least some of the time (?).

`C-g' and `C-]' in Icicles during completion invoke
`icicle-abort-recursive-edit' (in file icicles-mcmd.el), which does this:

(if (not (active-minibuffer-window))
    (when (get-buffer "*Completions*")
      (kill-buffer (get-buffer "*Completions*")))
  (icicle-remove-Completions-window 'FORCE))
(abort-recursive-edit)

This should remove the *Completions* window/frame.  In the case in question, the
second branch of the `if' is taken, invoking `icicle-remove-Completions-window'
(which is also in file icicles-mcmd.el).

What is happening now is that the first `C-g' does not remove Completions (e.g.
delete the frame) - a second `C-g' is needed.

Similarly, if you do `C-x 0' in the minibuffer it should remove Completions (it
is bound to `icicle-remove-Completions-window').  That also does not work (no
matter how many times you use it in a row).

Here is what is happening, by `M-x debug-on-entry icicle-abort-recursive-edit'.

Debugger entered--returning value: nil
  window-dedicated-p(#<window 14 on *Completions*>)
* (if (window-dedicated-p (get-buffer-window "*Completions*" (quote visible)))
(progn (condition-case nil (icicle-delete-windows-on "*Completions*") (error
nil))))
* (when (window-dedicated-p (get-buffer-window "*Completions*" (quote visible)))
(condition-case nil (icicle-delete-windows-on "*Completions*") (error nil)))
* (cond ((and (get-buffer-window "*Completions*") (or force (and (window-live-p
swin) (not (eq (window-buffer swin) (get-buffer "*Completions*"))))
(interactive-p))) (condition-case nil (delete-window (get-buffer-window
"*Completions*")) (error nil)) (bury-buffer (get-buffer "*Completions*"))) ((and
(get-buffer-window "*Completions*" (quote visible)) (or force (and
(window-live-p swin) (not (eq (window-buffer swin) (get-buffer
"*Completions*")))) (interactive-p))) (when (window-dedicated-p
(get-buffer-window "*Completions*" (quote visible))) (condition-case nil
(icicle-delete-windows-on "*Completions*") (error nil))) (bury-buffer
(get-buffer "*Completions*"))))
* (let ((swin (selected-window))) (when (and (window-minibuffer-p swin) (fboundp
(quote minibuffer-selected-window))) (setq swin (minibuffer-selected-window)))
(cond ((and (get-buffer-window "*Completions*") (or force (and (window-live-p
swin) (not (eq ... ...))) (interactive-p))) (condition-case nil (delete-window
(get-buffer-window "*Completions*")) (error nil)) (bury-buffer (get-buffer
"*Completions*"))) ((and (get-buffer-window "*Completions*" (quote visible)) (or
force (and (window-live-p swin) (not (eq ... ...))) (interactive-p))) (when
(window-dedicated-p (get-buffer-window "*Completions*" (quote visible)))
(condition-case nil (icicle-delete-windows-on "*Completions*") (error nil)))
(bury-buffer (get-buffer "*Completions*")))))
* icicle-remove-Completions-window(FORCE)
* (if (not (active-minibuffer-window)) (when (get-buffer "*Completions*")
(kill-buffer (get-buffer "*Completions*"))) (icicle-remove-Completions-window
(quote FORCE)))
  icicle-abort-recursive-edit()
  call-interactively(icicle-abort-recursive-edit nil nil)

Thx - Drew