[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Stop frames stealing eachothers' minibuffers!
From: |
Eli Zaretskii |
Subject: |
Re: Stop frames stealing eachothers' minibuffers! |
Date: |
Sat, 31 Oct 2020 09:25:00 +0200 |
> Date: Fri, 30 Oct 2020 22:09:17 +0000
> Cc: emacs-devel@gnu.org
> From: Alan Mackenzie <acm@muc.de>
>
> DEFUN ("minibufferp", Fminibufferp,
> - Sminibufferp, 0, 1, 0,
> + Sminibufferp, 0, 2, 0,
> doc: /* Return t if BUFFER is a minibuffer.
> No argument or nil as argument means use current buffer as BUFFER.
> -BUFFER can be a buffer or a buffer name. */)
> - (Lisp_Object buffer)
> +BUFFER can be a buffer or a buffer name. If LIVE is non-nil, then
> +t will be returned only if BUFFER is an active minibuffer. */)
> + (Lisp_Object buffer, Lisp_Object live)
> {
This uses passive tense in the last sentence.
> + /* tem = Fmemq (buffer, Vminibuffer_list); */
> + /* return (!NILP (tem) && !EQ (tem, Vminibuffer_list)) ? Qt : Qnil; */
This seems to be a leftover from developing the new code
> + if (!NILP (live))
> + return !NILP (Fmemq (buffer, Vminibuffer_list)) ? Qt : Qnil;
> + if (EQ (buffer, Fcar (Vminibuffer_list)))
> + /* *Minibuf-0* is never active. */
> + return Qnil;
> + tem = Fcdr (Vminibuffer_list);
> + for (i = 1; i <= minibuf_level; i++)
> + {
> + if (NILP (tem))
> + return Qnil;
Why is this test inside the loop?
> @@ -416,11 +471,12 @@ read_minibuf (Lisp_Object map, Lisp_Object initial,
> Lisp_Object prompt,
> {
> Lisp_Object str
> = build_string ("Command attempted to use minibuffer while in
> minibuffer");
> - if (EQ (selected_window, minibuf_window))
> - Fsignal (Quser_error, (list1 (str)));
> + if (!minibuf_follows_frame ()
> + || EQ (selected_window, minibuf_window))
> + Fsignal (Quser_error, (list1 (str)));
I don't think I understand this change: what does
minibuffer-follows-selected-frame have to do with recursive minibuffer
usage? They are two independent features.
> - /* Empty out the minibuffers of all frames other than the one
> - where we are going to display one now.
> - Set them to point to ` *Minibuf-0*', which is always empty. */
> - empty_minibuf = get_minibuffer (0);
> -
> - FOR_EACH_FRAME (dummy, frame)
> - {
> - Lisp_Object root_window = Fframe_root_window (frame);
> - Lisp_Object mini_window = XWINDOW (root_window)->next;
> -
> - if (! NILP (mini_window) && ! EQ (mini_window, minibuf_window)
> - && !NILP (Fwindow_minibuffer_p (mini_window)))
> - /* Use set_window_buffer instead of Fset_window_buffer (see
> - discussion of bug#11984, bug#12025, bug#12026). */
> - set_window_buffer (mini_window, empty_minibuf, 0, 0);
> - }
Does this mean the minibuffers on other frames will now not be emptied?
> +/* Returns whether a Lisp_Object is a particular existing minibuffer. */
Our style of comments in these cases is like this:
"Return non-zero if BUF is a particular existing minibuffer."
> + DEFVAR_BOOL ("minibuffer-follows-selected-frame",
> minibuffer_follows_selected_frame,
> + doc: /* Non-nil means an open minibuffer will move to a newly
> selected frame.
Talking about "moving" and "newly selected" here might come as a
surprise, because the context was not described. How about
Non-nil means active minibuffer always displays on the selected frame.
Thanks.
- Re: Stop frames stealing eachothers' minibuffers!, (continued)
- Re: Stop frames stealing eachothers' minibuffers!, Alan Mackenzie, 2020/10/21
- Re: Stop frames stealing eachothers' minibuffers!, Alan Mackenzie, 2020/10/21
- Re: Stop frames stealing eachothers' minibuffers!, Eli Zaretskii, 2020/10/22
- C-x o is moving between frames. [Was: Stop frames stealing eachothers' minibuffers!], Alan Mackenzie, 2020/10/23
- Re: C-x o is moving between frames. [Was: Stop frames stealing eachothers' minibuffers!], Stefan Monnier, 2020/10/23
- Re: C-x o is moving between frames. [Was: Stop frames stealing eachothers' minibuffers!], Eli Zaretskii, 2020/10/24
- Re: C-x o is moving between frames. [Was: Stop frames stealing eachothers' minibuffers!], Alan Mackenzie, 2020/10/24
- Re: C-x o is moving between frames. [Was: Stop frames stealing eachothers' minibuffers!], Stefan Monnier, 2020/10/24
- Re: C-x o is moving between frames. [Was: Stop frames stealing eachothers' minibuffers!], Alan Mackenzie, 2020/10/24
- Re: Stop frames stealing eachothers' minibuffers!, Alan Mackenzie, 2020/10/30
- Re: Stop frames stealing eachothers' minibuffers!,
Eli Zaretskii <=
- Re: Stop frames stealing eachothers' minibuffers!, Alan Mackenzie, 2020/10/31
- Re: Stop frames stealing eachothers' minibuffers!, Eli Zaretskii, 2020/10/31
- Re: Stop frames stealing eachothers' minibuffers!, Alan Mackenzie, 2020/10/31
- Re: Stop frames stealing eachothers' minibuffers!, Eli Zaretskii, 2020/10/31
- Re: Stop frames stealing eachothers' minibuffers!, Alan Mackenzie, 2020/10/31
- Re: Stop frames stealing eachothers' minibuffers!, Gregory Heytings, 2020/10/14
- Re: Stop frames stealing eachothers' minibuffers!, Gregory Heytings, 2020/10/14
- Re: Stop frames stealing eachothers' minibuffers!, Andreas Schwab, 2020/10/13
- Re: Stop frames stealing eachothers' minibuffers!, Gregory Heytings, 2020/10/13
- Re: Stop frames stealing eachothers' minibuffers!, Stefan Monnier, 2020/10/13