unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* About the 'minibuffer' frame parameter
@ 2016-07-31 18:12 martin rudalics
  2016-08-05 13:33 ` Eli Zaretskii
  0 siblings, 1 reply; 43+ messages in thread
From: martin rudalics @ 2016-07-31 18:12 UTC (permalink / raw)
  To: emacs-devel

With emacs -Q evaluate:

(progn
   (setq minibuffer-less-frame (make-frame '((minibuffer . nil))))
   (setq minibuffer-only-frame (make-frame '((minibuffer . only))))

   (set-frame-parameter
    minibuffer-less-frame 'minibuffer (frame-root-window minibuffer-only-frame))
   (frame-parameter minibuffer-less-frame 'minibuffer))

This reveals a number of problems with how we currently handle the
'minibuffer' frame parameter and how it's documented.  In section
28.4.3.5 we say about this parameter:

`minibuffer'
      Whether this frame has its own minibuffer.  The value `t' means
      yes, `nil' means no, `only' means this frame is just a minibuffer.
      If the value is a minibuffer window (in some other frame), the
      frame uses that minibuffer.

      This frame parameter takes effect when the frame is created, and
      can not be changed afterwards.

The sentence "If the value is a minibuffer window (in some other frame),
the frame uses that minibuffer." is misleading.  A minibuffer window is
reported iff that window is on the _same_ frame and that frame is not a
minibuffer-only frame.  A minibuffer window in some other frame is never
reported.

But if the frame is minibuffer-less and uses the minibuffer window of
some other frame, we return as value nil although the real, internal
frame parameter's value (not the one produced by the

   store_in_alist (&alist, Qminibuffer,
		  (! FRAME_HAS_MINIBUF_P (f) ? Qnil
		   : FRAME_MINIBUF_ONLY_P (f) ? Qonly
		   : FRAME_MINIBUF_WINDOW (f)));

construct) is actually that window.  Otherwise, evaluating the
‘set-frame-parameter’ above would have produced an error.  Which means
that the sentence "This frame parameter takes effect when the frame is
created, and can not be changed afterwards." is misleading as well.  In
fact, setting the 'minibuffer' frame parameter is the only way to change
the minibuffer window for a specific frame.

Note in this context that ‘minibuffer-window’ returns the correct
minibuffer window for its FRAME argument while ‘set-minibuffer-window’
does not allow to set the minibuffer window for a specific frame.

I'm not sure how to deal with this situation.  Personally, I'd prefer to
report the real, internal 'minibuffer' parameter but am afraid that
might break existing code.  In any case, the documentation should be
fixed.  Somehow.

martin




^ permalink raw reply	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2017-01-19  3:54 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).