bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#28978: 26.0; Regression: separate, dedicated `*Completions*' frame n


From: martin rudalics
Subject: bug#28978: 26.0; Regression: separate, dedicated `*Completions*' frame no longer has parameter `minibuffer'
Date: Sun, 29 Oct 2017 19:13:04 +0100

> And no, there is no problem such as (I think) you
> describe.  In my own setup (but the code is not just
> for my setup) ALL of the frames except my standalone
> minibuffer frame have a nil `minibuffer' parameter.
> And none are mistakenly removed.  Only the windows
> and frames showing BUFFER are affected, and only
> windows showing BUFFER are removed.

Then I have difficulties to understand what this part of your code tries
to do:

                   (setq mini-param
                         (cdr
                          (assoc
                           'minibuffer
                           (frame-parameters this-frame))))
                   (eq mini-param (active-minibuffer-window))

You set mini-param to the 'minibuffer' parameter of this-frame which is
IIUC your *Completions* frame.  If you say that this parameter is always
nil for this-frame, why do you retrieve it?  If all you want to check is
whether this-frame is the active minibuffer window's frame, then there
should be easier ways to do that like, for example,

(and (active-minibuffer-window)
     (eq this-frame (window-frame (active-minibuffer-window))))

> Really?  The window that was selected before minibuffer
> interaction?

Yes.

> I truly do not understand, in that case.  And that is
> not what I think I see.  If what you say is true then
> I should never see that the same minibuffer window
> as `active-minibuffer-window' (or even an inactive
> minibuffer window) is itself returned by the function.

Invoke

emacs -Q --eval "(setq default-frame-alist '((minibuffer . nil)))"

and switch to the minibuffer-less frame.  Type C-h f to enter the
minibuffer.  Once there, type

M-: (active-minibuffer-window)

This gets me the window of the minibuffer frame.  Now type

M-: (minibuffer-selected-window)

This gets me the window of the minibuffer-less frame.

What do you get?

> How can the minibuffer window that becomes selected
> for the minibuffer interaction have been the selected
> window before "the minibuffer interaction started"?

I don't know.  It doesn't happen with the scenario sketched above.

> And even if that is the actual meaning/behavior of
> that function, the doc string is not appropriate.
> In that case it is inappropriate because it allows
> the other meaning: after instead of before.  Either
> way, the doc string is misleading/ambiguous.

Please suggest a better one.

> Let me ask you the same question you asked me about
> my function for removing displays of a buffer: what
> are the use cases for `minibuffer-selected-window'?
> What is it intended for?  I thought I understood it
> until your reply saying that it returns the window
> selected _before_ the minibuffer interaction.

IIUC it's mainly used to find the original buffer from where the
minibuffer was entered.  Have a look at the Elisp sources.

> Could you please post the fixed string here, so I
> can see it?  Clearly I don't understand this yet.
> Hopefully that will help.  Thx.

The doc-string is probably not much better:

       doc: /* Return the window which was selected when entering the 
minibuffer.
Return nil if the selected window is not a minibuffer window.  */)

The Elisp documentation now has

     This function returns the window that was selected at the moment
     the minibuffer was entered.  If the currently selected window is
     not a minibuffer window, it returns `nil'.

which you might want to improve as well.

martin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]