* bug#6945: active-minibuffer-window returns nil when prompt overwritten by message
@ 2010-08-30 10:30 Lennart Borgman
2010-08-30 12:44 ` Stephen Berman
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Lennart Borgman @ 2010-08-30 10:30 UTC (permalink / raw)
To: 6945
Eval the following
(defun temp-active-mb ()
(message "active-minibuffer-window = %s" (active-minibuffer-window)))
(progn
(run-with-idle-timer 1 nil 'message "idle message")
(run-with-idle-timer 2 nil 'temp-active-mb)
(y-or-n-p "Prompt: ")
)
This gives me the message "active-minibuffer-window = nil".
Is there any way then to discover whether Emacs is displaying a prompt
and waiting for input?
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#6945: active-minibuffer-window returns nil when prompt overwritten by message
2010-08-30 10:30 bug#6945: active-minibuffer-window returns nil when prompt overwritten by message Lennart Borgman
@ 2010-08-30 12:44 ` Stephen Berman
2010-08-30 13:09 ` Lennart Borgman
2010-08-30 13:11 ` Andreas Schwab
2020-08-20 18:25 ` Lars Ingebrigtsen
2 siblings, 1 reply; 8+ messages in thread
From: Stephen Berman @ 2010-08-30 12:44 UTC (permalink / raw)
To: Lennart Borgman; +Cc: 6945
On Mon, 30 Aug 2010 12:30:37 +0200 Lennart Borgman <lennart.borgman@gmail.com> wrote:
> Eval the following
>
>
> (defun temp-active-mb ()
> (message "active-minibuffer-window = %s" (active-minibuffer-window)))
>
> (progn
> (run-with-idle-timer 1 nil 'message "idle message")
> (run-with-idle-timer 2 nil 'temp-active-mb)
> (y-or-n-p "Prompt: ")
> )
>
> This gives me the message "active-minibuffer-window = nil".
When I eval the above sexps on GNU Emacs 24.0.50.1 (i686-pc-linux-gnu,
GTK+ Version 2.18.6) of 2010-08-22 on escher, I first briefly see the
message "Prompt: (y or n)", then "idle message", then
"active-minibuffer-window = " with the cursor after "= "; as soon as I
type any other key, I get "Prompt: (y or n)" again.
> Is there any way then to discover whether Emacs is displaying a prompt
> and waiting for input?
Are you trying this on MS-Windows? If so, it seems to be a problem
there.
Steve Berman
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#6945: active-minibuffer-window returns nil when prompt overwritten by message
2010-08-30 12:44 ` Stephen Berman
@ 2010-08-30 13:09 ` Lennart Borgman
2010-08-30 13:48 ` Stephen Berman
0 siblings, 1 reply; 8+ messages in thread
From: Lennart Borgman @ 2010-08-30 13:09 UTC (permalink / raw)
To: Stephen Berman; +Cc: 6945
On Mon, Aug 30, 2010 at 2:44 PM, Stephen Berman <stephen.berman@gmx.net> wrote:
> On Mon, 30 Aug 2010 12:30:37 +0200 Lennart Borgman <lennart.borgman@gmail.com> wrote:
>
>> Eval the following
>>
>>
>> (defun temp-active-mb ()
>> (message "active-minibuffer-window = %s" (active-minibuffer-window)))
>>
>> (progn
>> (run-with-idle-timer 1 nil 'message "idle message")
>> (run-with-idle-timer 2 nil 'temp-active-mb)
>> (y-or-n-p "Prompt: ")
>> )
>>
>> This gives me the message "active-minibuffer-window = nil".
>
> When I eval the above sexps on GNU Emacs 24.0.50.1 (i686-pc-linux-gnu,
> GTK+ Version 2.18.6) of 2010-08-22 on escher, I first briefly see the
> message "Prompt: (y or n)", then "idle message", then
> "active-minibuffer-window = " with the cursor after "= "; as soon as I
> type any other key, I get "Prompt: (y or n)" again.
>
>> Is there any way then to discover whether Emacs is displaying a prompt
>> and waiting for input?
>
> Are you trying this on MS-Windows? If so, it seems to be a problem
> there.
Thanks Stephen. However it looks to me from what you write above like
active-minibuffer-window does not return a window in this case on
GNU/Linux either.
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#6945: active-minibuffer-window returns nil when prompt overwritten by message
2010-08-30 10:30 bug#6945: active-minibuffer-window returns nil when prompt overwritten by message Lennart Borgman
2010-08-30 12:44 ` Stephen Berman
@ 2010-08-30 13:11 ` Andreas Schwab
2010-08-30 13:46 ` Lennart Borgman
2020-08-20 18:25 ` Lars Ingebrigtsen
2 siblings, 1 reply; 8+ messages in thread
From: Andreas Schwab @ 2010-08-30 13:11 UTC (permalink / raw)
To: Lennart Borgman; +Cc: 6945
Lennart Borgman <lennart.borgman@gmail.com> writes:
> (defun temp-active-mb ()
> (message "active-minibuffer-window = %s" (active-minibuffer-window)))
>
> (progn
> (run-with-idle-timer 1 nil 'message "idle message")
> (run-with-idle-timer 2 nil 'temp-active-mb)
> (y-or-n-p "Prompt: ")
> )
>
> This gives me the message "active-minibuffer-window = nil".
y-or-n-p does not use the minibuffer, so this is correct.
> Is there any way then to discover whether Emacs is displaying a prompt
This is just a message in the echo area.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#6945: active-minibuffer-window returns nil when prompt overwritten by message
2010-08-30 13:11 ` Andreas Schwab
@ 2010-08-30 13:46 ` Lennart Borgman
0 siblings, 0 replies; 8+ messages in thread
From: Lennart Borgman @ 2010-08-30 13:46 UTC (permalink / raw)
To: Andreas Schwab; +Cc: 6945
On Mon, Aug 30, 2010 at 3:11 PM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> Lennart Borgman <lennart.borgman@gmail.com> writes:
>
>> (defun temp-active-mb ()
>> (message "active-minibuffer-window = %s" (active-minibuffer-window)))
>>
>> (progn
>> (run-with-idle-timer 1 nil 'message "idle message")
>> (run-with-idle-timer 2 nil 'temp-active-mb)
>> (y-or-n-p "Prompt: ")
>> )
>>
>> This gives me the message "active-minibuffer-window = nil".
>
> y-or-n-p does not use the minibuffer, so this is correct.
>
>> Is there any way then to discover whether Emacs is displaying a prompt
>
> This is just a message in the echo area.
Thanks, I see. I had forgotten that.
Correct, but very inconvenient.
Is there a way to detect this situation then? (Emacs is "paused",
waiting for input while a "prompt" is displayed.)
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#6945: active-minibuffer-window returns nil when prompt overwritten by message
2010-08-30 13:09 ` Lennart Borgman
@ 2010-08-30 13:48 ` Stephen Berman
2010-08-30 13:57 ` Lennart Borgman
0 siblings, 1 reply; 8+ messages in thread
From: Stephen Berman @ 2010-08-30 13:48 UTC (permalink / raw)
To: Lennart Borgman; +Cc: 6945
On Mon, 30 Aug 2010 15:09:23 +0200 Lennart Borgman <lennart.borgman@gmail.com> wrote:
> On Mon, Aug 30, 2010 at 2:44 PM, Stephen Berman <stephen.berman@gmx.net> wrote:
>> On Mon, 30 Aug 2010 12:30:37 +0200 Lennart Borgman <lennart.borgman@gmail.com> wrote:
>>
>>> Eval the following
>>>
>>>
>>> (defun temp-active-mb ()
>>> (message "active-minibuffer-window = %s" (active-minibuffer-window)))
>>>
>>> (progn
>>> (run-with-idle-timer 1 nil 'message "idle message")
>>> (run-with-idle-timer 2 nil 'temp-active-mb)
>>> (y-or-n-p "Prompt: ")
>>> )
>>>
>>> This gives me the message "active-minibuffer-window = nil".
>>
>> When I eval the above sexps on GNU Emacs 24.0.50.1 (i686-pc-linux-gnu,
>> GTK+ Version 2.18.6) of 2010-08-22 on escher, I first briefly see the
>> message "Prompt: (y or n)", then "idle message", then
>> "active-minibuffer-window = " with the cursor after "= "; as soon as I
Correction: "active-minibuffer-window = nil" and "= nil", i.e. same as you.
>> type any other key, I get "Prompt: (y or n)" again.
>>
>>> Is there any way then to discover whether Emacs is displaying a prompt
>>> and waiting for input?
>>
>> Are you trying this on MS-Windows? If so, it seems to be a problem
>> there.
>
> Thanks Stephen. However it looks to me from what you write above like
> active-minibuffer-window does not return a window in this case on
> GNU/Linux either.
I guess I misunderstood -- I thought you were reporting you saw no
prompt and could not get it with the above recipe. As for
active-minibuffer-window not returning a window, maybe I still
misunderstand, but I get the message "active-minibuffer-window = nil"
not only with the above progn, but also with this:
"active-minibuffer-window = nil".
>>
>> When I eval the above sexps on GNU Emacs 24.0.50.1 (i686-pc-linux-gnu,
>> GTK+ Version 2.18.6) of 2010-08-22 on escher, I first briefly see the
>> message "Prompt: (y or n)", then "idle message", then
>> "active-minibuffer-window = " with the cursor after "= "; as soon as I
Correction: "active-minibuffer-window = nil" and "= nil"
>> type any other key, I get "Prompt: (y or n)" again.
>>
>>> Is there any way then to discover whether Emacs is displaying a prompt
>>> and waiting for input?
>>
>> Are you trying this on MS-Windows? If so, it seems to be a problem
>> there.
>
> Thanks Stephen. However it looks to me from what you write above like
> active-minibuffer-window does not return a window in this case on
> GNU/Linux either.
I guess I misunderstood -- I thought you were reporting you saw no
prompt and could not get it with the above recipe. As for
active-minibuffer-window not returning a window, maybe I still
misunderstand, but I get the message "active-minibuffer-window = nil"
not only with the above progn, but also with this:
"active-minibuffer-window = nil".
>>
>> When I eval the above sexps on GNU Emacs 24.0.50.1 (i686-pc-linux-gnu,
>> GTK+ Version 2.18.6) of 2010-08-22 on escher, I first briefly see the
>> message "Prompt: (y or n)", then "idle message", then
>> "active-minibuffer-window = " with the cursor after "= "; as soon as I
Correction: "active-minibuffer-window = nil" and "= nil"
>> type any other key, I get "Prompt: (y or n)" again.
>>
>>> Is there any way then to discover whether Emacs is displaying a prompt
>>> and waiting for input?
>>
>> Are you trying this on MS-Windows? If so, it seems to be a problem
>> there.
>
> Thanks Stephen. However it looks to me from what you write above like
> active-minibuffer-window does not return a window in this case on
> GNU/Linux either.
I guess I misunderstood -- I thought you were reporting you saw no
prompt and could not get it with the above recipe. As for
active-minibuffer-window not returning a window, maybe I still
misunderstand, but I get the message "active-minibuffer-window = nil"
not only with the above progn, but also with this:
(progn
(run-with-idle-timer 1 nil 'message "idle message")
(run-with-idle-timer 2 nil 'temp-active-mb)
)
and even just with this:
(run-with-idle-timer 2 nil 'temp-active-mb)
So the prompt seems to make no difference. Or do you see (or expect)
something different?
Steve Berman
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#6945: active-minibuffer-window returns nil when prompt overwritten by message
2010-08-30 13:48 ` Stephen Berman
@ 2010-08-30 13:57 ` Lennart Borgman
0 siblings, 0 replies; 8+ messages in thread
From: Lennart Borgman @ 2010-08-30 13:57 UTC (permalink / raw)
To: Stephen Berman; +Cc: 6945
On Mon, Aug 30, 2010 at 3:48 PM, Stephen Berman <stephen.berman@gmx.net> wrote:
>
> I guess I misunderstood -- I thought you were reporting you saw no
> prompt and could not get it with the above recipe. As for
> active-minibuffer-window not returning a window, maybe I still
> misunderstand, but I get the message "active-minibuffer-window = nil"
That is what I get too.
> not only with the above progn, but also with this:
>
> (progn
> (run-with-idle-timer 1 nil 'message "idle message")
> (run-with-idle-timer 2 nil 'temp-active-mb)
> )
>
> and even just with this:
>
> (run-with-idle-timer 2 nil 'temp-active-mb)
>
> So the prompt seems to make no difference. Or do you see (or expect)
> something different?
I expected active-minibuffer-window to return a window, but as Andreas
has pointed out y-or-n-p is implemented in a different way. It just
call `message' and then read a key from the user.
However I would like to detect such situations too. From the users
point of view they are very similar to other prompts. (If you replace
`y-or-n-p' with `yes-or-no-p' then active-minibuffer-window will
return a window.)
^ permalink raw reply [flat|nested] 8+ messages in thread
* bug#6945: active-minibuffer-window returns nil when prompt overwritten by message
2010-08-30 10:30 bug#6945: active-minibuffer-window returns nil when prompt overwritten by message Lennart Borgman
2010-08-30 12:44 ` Stephen Berman
2010-08-30 13:11 ` Andreas Schwab
@ 2020-08-20 18:25 ` Lars Ingebrigtsen
2 siblings, 0 replies; 8+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-20 18:25 UTC (permalink / raw)
To: Lennart Borgman; +Cc: 6945
Lennart Borgman <lennart.borgman@gmail.com> writes:
> Eval the following
>
> (defun temp-active-mb ()
> (message "active-minibuffer-window = %s" (active-minibuffer-window)))
>
> (progn
> (run-with-idle-timer 1 nil 'message "idle message")
> (run-with-idle-timer 2 nil 'temp-active-mb)
> (y-or-n-p "Prompt: ")
> )
>
> This gives me the message "active-minibuffer-window = nil".
>
> Is there any way then to discover whether Emacs is displaying a prompt
> and waiting for input?
I'm unable to reproduce this bug in Emacs 28. The way prompts work with
asynchronous messages has changed substantially over the last year,
which probably explains it. So I'm closing this bug report -- if
there's still an issue here, please respond to the debbugs address and
we'll reopen the bug report.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2020-08-20 18:25 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-30 10:30 bug#6945: active-minibuffer-window returns nil when prompt overwritten by message Lennart Borgman
2010-08-30 12:44 ` Stephen Berman
2010-08-30 13:09 ` Lennart Borgman
2010-08-30 13:48 ` Stephen Berman
2010-08-30 13:57 ` Lennart Borgman
2010-08-30 13:11 ` Andreas Schwab
2010-08-30 13:46 ` Lennart Borgman
2020-08-20 18:25 ` Lars Ingebrigtsen
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).