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

From: martin rudalics <[email-masked]>
Date: Sat, 25 Jun 2011 19:00:13 +0200

>> I downloaded your Icicles tarball and tried with throw-10.  Everything
 >> seems to work as expected including focus redirection and resurrection
 >> of an iconified Completions frame.
 >
 > There should be no iconfied Completions frame in the test I gave you.

When I type foo and eventually get the sole completion footnote-mode the
Completions frame iconifies automatically.  I didn't check why that
happens, shouldn't it?  When I then type M-x f TAB again it gets orderly
resurrected.

 > The problem arises only when the Completions frame is newly _created_, as I
 > tried to explain.  If you use `M-x f TAB o' (recipe) after the frame has already
 > been created then the input focus is not a problem.
 >
 > If you have the frame already,

The Completions frame?  It pops up automatically when I hit TAB and
redirects focus to the Minibuffer frame.

 > then please delete it and try `M-x f TAB o'
 > again.
 >
 >> So if you don't use any additional strings the problem seems
 >> fixed.  I can't tell why it doesn't work on your machine.
 >
 > As I said, it's possible that this is Windows-specific.  Windows is I think
 > (thought) a bit peculiar when it comes to its auto-selecting a new frame -  but
 > you said that most window mgrs do that now.  I still wonder if this isn't
 > Windows-specific, since you cannot reproduce it and it is systematic for me when
 > I follow the same recipe.

But I test this on Windows XP.

 >> Maybe some .el files have to be recompiled in order to work
 >> with my later fixes
 >
 > Do you mean my .el or .el from Emacs sources?  In the files I provided for the
 > test, please use only .el, no .elc.

 From the Emacs sources.  Maybe some completions-related stuff.

 >> so it's likely best to wait till Sean uploads the new binaries
 >> (IIRC this happens every Monday).  As soon as you tried with
 >> the new binaries tell me what you get.
 >
 > I'll certainly do that.

OK.

 > But what about that `display-buffer' call in
 > `icicle-display-candidates-in-Completions'?  Can you suggest a change for it?
 > Does that code look like it _should_ work after your changes, or should it be
 > changed?

It should work vacuously.  But I'd like to know why you needed it
earlier.  Earlier Emacsen had `display-buffer' do

      ((let ((frames (or frame

here frame is the value "0" you provide as argument

			(and (or use-pop-up-frames
				 display-buffer-reuse-frames
				 (not (last-nonminibuffer-frame)))
			     0)

and the "0" you see in the previous line means exactly the same.  Any
visible or iconified frame provided you use either `pop-up-frames' or
`display-buffer-reuse-frames'.  And I suppose it doesn't make sense to
use Icicles with these set to nil.  Now if you insisted on searching
only visible frames here I would see a problem ...

			(last-nonminibuffer-frame))))
	(setq window-to-use
	      (catch 'found
		;; Search frames for a window displaying BUFFER.  Return
		;; the selected window only if we are allowed to do so.
		(dolist (window (get-buffer-window-list buffer 'nomini frames))
		  (when (or can-use-selected-window
			    (not (eq (selected-window) window)))
		    (throw 'found window))))))
       ;; The buffer is already displayed in some window; use that.
       (window--display-buffer-1 window-to-use))

I can easily resurrect the old semantics of that argument for the few
values t, 0, visible and a live frame but I would first like to see a
real use case for it.

 > And you mentioned the `save-selected-window' around that `display-buffer' call.
 > Does that need to be changed somehow?

I'm not quite sure what you expect it to do.  IIUC you want the
Completions window selected with focus redirected to the Minibuffer
window.  Now which window is the one whose selection you want to save
here?  Anyway, it shouldn't harm so leave it alone.

martin