emacs-devel
[Top][All Lists]
Advanced

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

About the 'minibuffer' frame parameter


From: martin rudalics
Subject: About the 'minibuffer' frame parameter
Date: Sun, 31 Jul 2016 20:12:46 +0200

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




reply via email to

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