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: Drew Adams
Subject: bug#28978: 26.0; Regression: separate, dedicated `*Completions*' frame no longer has parameter `minibuffer'
Date: Fri, 27 Oct 2017 07:19:43 -0700 (PDT)

> The change and its motivation are:
> 
>       Fix semantics of 'minibuffer' frame parameter
> 
>       The 'minibuffer' frame parameter is now t for a normal frame
>       (a frame with a root window plus a minibuffer window) and the
>       frame's minibuffer window for a minibuffer-less frame (a frame
>       whose minibuffer window is on another frame).  See also:
>       https://urldefense.proofpoint.com/v2/url?u=https-
> 3A__lists.gnu.org_archive_html_emacs-2Ddevel_2016-
> 2D07_msg01259.html&d=DwICaQ&c=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10
> &r=qZLZosY6GBAaJtOG9v8QX7nD4BS9t9s5otgxC3d4IFU&m=iis9a2_IADv9pVb4yf4HsSV4
> tsAWIhyObsr30ujC7gQ&s=zcJ6cBmJCUoJPZS4bM11HngUAPBn-_GqScRVTZzkcas&e=
> 
>       * src/frame.c (make_frame, make_frame_without_minibuffer)
>       (make_minibuffer_frame): When assigning the frame's minibuffer
>       window also store corresponding 'minibuffer' frame parameter.
>       (store_frame_param): Move the 'minibuffer' parameter checks to
>       the beginning so we can silently override the value before it
>       gets stored in the parameter alist.  Fix error handling.
>       (Fframe_parameters): Return value of 'minibuffer' parameter
>       unmodified.
> 
>       * lisp/frameset.el (frameset-filter-minibuffer): When the cdr of
>       the parameter is a minibuffer window, save (minibuffer . nil)
>       instead of (minibuffer . t).
>       (frameset--reuse-frame): To find a non-minibuffer-only frame
>       look out for a frame whose 'minibuffer' parameter is t instead
>       of that frame's minibuffer window.
>       (frameset-minibufferless-first-p): To find a minibuffer-less
>       frame look out for a frame whose 'minibuffer' parameter is a
>       window instead of nil.

So the meaning of frame-parameter `minibuffer' has changed.
I will need to adjust my code somehow.

How would you suggest I change the test I have been using,
to detect a frame that has the active minibuffer (versus
the case I reported, where dedicated frame `*Completions*'
has no minibuffer)?

Previously this was sufficient: only a frame with a
the active minibuffer returned non-nil:

(cdr (assoc 'minibuffer (frame-parameters this-frame)))

Please see the code I use, in the attachment to an
earlier message.  Here, again, is the important
part of that code, showing the test I use:

(let* ((this-buffer-frames  (icicle-frames-on BUFFER))
       (this-frame          (car this-buffer-frames))
       mini-param)
  (unless
      (and this-frame
           (frame-visible-p this-frame)
           ;; Only one frame shows BUFFER.
           (null (cdr this-buffer-frames))

           ;; That frame has parameter `minibuffer'.
           (setq mini-param         ; <=============
                 (cdr
                  (assoc 'minibuffer
                         (frame-parameters this-frame))))
           ;; Param `minibuffer' is the active minibuffer.
           (eq mini-param (active-minibuffer-window))

           (save-window-excursion
             (select-frame this-frame)
             ;; Frame has only one window.
             (one-window-p t 'SELECTED-FRAME-ONLY)))
    ...))

I'm looking for an alternative test that will continue
to work.  (I'd prefer one test that works across Emacs
versions, but a test that works only for Emacs 26 and
later is OK too.)

In the case I cited in this bug report, `this-frame' in
that code is frame `*Completions*', which is dedicated
to buffer `*Completions*' and has no minibuffer.  That
frame is displayed via `special-display-buffer-names'.

But the code above is not just for my own use, i.e.,
with such a dedicated `*Completions*' frame.  It
needs to work also for other cases, including where
`*Completions*' is alone in its frame but that frame
has the active minibuffer.  That's what the `unless'
is for: the code should delete the frame in the case
I reported, but it should not delete the frame (or
the window) if the frame with `*Completions*' has
the active minibuffer.

Thanks for your help adjusting to this change.





reply via email to

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