unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: martin rudalics <rudalics@gmx.at>, 28978@debbugs.gnu.org
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)	[thread overview]
Message-ID: <31caab4d-f332-48a7-9736-ccd172073672@default> (raw)
In-Reply-To: <59F2ED8C.3010400@gmx.at>

> 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	other threads:[~2017-10-27 14:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-24 20:20 bug#28978: 26.0; Regression: separate, dedicated `*Completions*' frame no longer has parameter `minibuffer' Drew Adams
2017-10-25  7:45 ` martin rudalics
2017-10-25 14:47   ` Drew Adams
2017-10-26  7:57     ` martin rudalics
2017-10-26 14:01       ` Drew Adams
2017-10-27  8:25         ` martin rudalics
2017-10-27 14:19           ` Drew Adams [this message]
2017-10-28  8:45             ` martin rudalics
2017-10-28 19:15               ` Drew Adams
2017-10-29 11:18                 ` martin rudalics
2017-10-29 15:59                   ` Drew Adams
2017-10-29 18:13                     ` martin rudalics
2017-10-29 23:56                       ` Drew Adams
2017-10-30  8:24                         ` martin rudalics
2017-10-30 14:32                           ` Drew Adams
2017-10-30 19:00                             ` martin rudalics
2017-10-30 19:16                               ` Drew Adams

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=31caab4d-f332-48a7-9736-ccd172073672@default \
    --to=drew.adams@oracle.com \
    --cc=28978@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).