all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: About the 'minibuffer' frame parameter
Date: Sat, 06 Aug 2016 11:33:55 +0200	[thread overview]
Message-ID: <57A5AF03.30807@gmx.at> (raw)
In-Reply-To: <837fbvkofs.fsf@gnu.org>

 > We could simply change the above code to follow suit.

Change what?  Initially I only wanted to simplify code like

(FRAME_HAS_MINIBUF_P (f) && !FRAME_MINIBUF_ONLY_P (f))

because once f has been created, FRAME_HAS_MINIBUF_P (f) and
!FRAME_MINIBUF_ONLY_P (f) invariantly hold for the entire lifetime of f.
A bit field telling whether a frame owns a minibuffer or is
minibuffer-only/-less seems more practical instead of these macros.  The
value stored in that bit field would have to reflect the value stored in
the 'minibuffer' frame parameter.  But for a minibuffer-less frame we
OT1H store the minibuffer window in that parameter and OTOH we report
the value nil for that parameter in ‘frame-parameters’.

We could either modify that code in store_frame_param

   if (EQ (prop, Qminibuffer) && WINDOWP (val))
     {
       if (! MINI_WINDOW_P (XWINDOW (val)))
	error ("Surrogate minibuffer windows must be minibuffer windows");

       if ((FRAME_HAS_MINIBUF_P (f) || FRAME_MINIBUF_ONLY_P (f))
	  && !EQ (val, f->minibuffer_window))
	error ("Can't change the surrogate minibuffer of a frame with its own minibuffer");

       /* Install the chosen minibuffer window, with proper buffer.  */
       fset_minibuffer_window (f, val);
     }

to store Qnil instead of the minibuffer window or do away with the
special treatment of the 'minibuffer' parameter in ‘frame-parameters’ as
I mentioned earlier.

The former should be sane because so far C-code always goes for the
value of FRAME_MINIBUF_WINDOW to find the minibuffer window of a frame.
However, we'd still have to explain that ‘set-frame-parameter’ can
change a frame's minibuffer window without reflecting the change in the
return value of ‘frame-parameters’.

As mentioned before, removing the special treatment of the 'minibuffer'
parameter in ‘frame-parameters’ would imply that Elisp code relying on
the values we report currently might be broken in the future.  The doc
change required for this solution would be marginal.

Things would be much clearer if we had provided some orthogonality of
‘minibuffer-window’ and ‘set-minibuffer-window’.

martin




  reply	other threads:[~2016-08-06  9:33 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-31 18:12 About the 'minibuffer' frame parameter martin rudalics
2016-08-05 13:33 ` Eli Zaretskii
2016-08-05 16:37   ` martin rudalics
2016-08-05 17:18     ` Drew Adams
2016-08-05 17:35       ` martin rudalics
2016-08-05 17:52         ` Drew Adams
2016-08-05 18:19           ` martin rudalics
2016-08-05 18:37             ` Drew Adams
2016-08-06  9:32               ` martin rudalics
2016-08-06 16:46                 ` Drew Adams
2016-08-07  8:46                   ` martin rudalics
2017-01-14  0:59                     ` Juanma Barranquero
2017-01-14  7:47                       ` Eli Zaretskii
2017-01-14  9:18                         ` Juanma Barranquero
2017-01-14 10:42                           ` Eli Zaretskii
2017-01-14 11:05                           ` martin rudalics
2017-01-14 14:01                             ` Juanma Barranquero
2017-01-19  3:54                               ` John Wiegley
2017-01-14 15:56                             ` Drew Adams
2017-01-15  3:01                           ` Richard Stallman
2016-08-05 19:25     ` Eli Zaretskii
2016-08-06  9:33       ` martin rudalics [this message]
2016-08-07 13:54         ` Eli Zaretskii
2016-08-08  8:27           ` martin rudalics
2016-08-08 15:34             ` Eli Zaretskii
2016-08-09  8:27               ` martin rudalics
2016-08-09 14:51                 ` Eli Zaretskii
2016-08-09 16:07                   ` martin rudalics
2016-08-09 16:21                     ` Eli Zaretskii
2016-08-09 17:34                       ` martin rudalics
2016-08-09 17:51                         ` Eli Zaretskii
2016-08-10 12:15                           ` martin rudalics
2016-08-10 14:23                             ` Stefan Monnier
2016-08-10 14:54                               ` Eli Zaretskii
2016-08-10 14:49                             ` Eli Zaretskii
2016-08-21  9:41                               ` martin rudalics
2016-08-21 20:51                                 ` Kaushal Modi
2016-08-22 12:49                                   ` Kaushal Modi
2016-08-22 13:03                                     ` Kaushal Modi
2016-08-22 15:51                                       ` Kaushal Modi
2016-08-22 16:01                                       ` martin rudalics
2016-08-22 16:27                                         ` Kaushal Modi
2016-08-23  8:19                                           ` martin rudalics

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

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

  git send-email \
    --in-reply-to=57A5AF03.30807@gmx.at \
    --to=rudalics@gmx.at \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.