GNU bug report logs -
#9557
24.0.50; "y-or-n-p" does not clear the echo area
Previous Next
Reported by: Dani Moncayo <dmoncayo <at> gmail.com>
Date: Tue, 20 Sep 2011 09:26:02 UTC
Severity: normal
Tags: notabug, wontfix
Found in version 24.0.50
Done: Juri Linkov <juri <at> jurta.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9557 in the body.
You can then email your comments to 9557 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#9557
; Package
emacs
.
(Tue, 20 Sep 2011 09:26:03 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Dani Moncayo <dmoncayo <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Tue, 20 Sep 2011 09:26:03 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hi,
In my init file, I have `(fset 'yes-or-no-p 'y-or-n-p)' in order to
speed up the "yes/no" answers. But I've just seen a minor problem
associated to it.
From "emacs -Q":
1. Eval: (fset 'yes-or-no-p 'y-or-n-p)
2. Visit some file.
3. M-x revert-buffer <RET> y
--> (Expected) The echo area ends up empty (as happens if you omit step #1).
--> (Observed) The echo area remains with a residual text "Revert
buffer from file <your-file>? (y or n) y".
In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
of 2011-09-12 on 3249CTO
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.5) --no-opt'
--
Dani Moncayo
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#9557
; Package
emacs
.
(Tue, 20 Sep 2011 09:44:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 9557 <at> debbugs.gnu.org (full text, mbox):
Dani Moncayo <dmoncayo <at> gmail.com> writes:
> 1. Eval: (fset 'yes-or-no-p 'y-or-n-p)
> 2. Visit some file.
> 3. M-x revert-buffer <RET> y
> --> (Expected) The echo area ends up empty (as happens if you omit step #1).
Since yes-or-no-p doesn't use the echo area (it uses the minibuffer) you
cannot compare it with y-or-n-p.
Andreas.
--
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#9557
; Package
emacs
.
(Tue, 20 Sep 2011 09:49:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 9557 <at> debbugs.gnu.org (full text, mbox):
> Since yes-or-no-p doesn't use the echo area (it uses the minibuffer) you
> cannot compare it with y-or-n-p.
The question is: from an user POV, is there a way to achieve the
behavior I want (short answers), without the "residual text" problem?
--
Dani Moncayo
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#9557
; Package
emacs
.
(Tue, 20 Sep 2011 10:07:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 9557 <at> debbugs.gnu.org (full text, mbox):
> Date: Tue, 20 Sep 2011 11:19:54 +0200
> From: Dani Moncayo <dmoncayo <at> gmail.com>
>
> 1. Eval: (fset 'yes-or-no-p 'y-or-n-p)
> 2. Visit some file.
> 3. M-x revert-buffer <RET> y
> --> (Expected) The echo area ends up empty (as happens if you omit step #1).
> --> (Observed) The echo area remains with a residual text "Revert
> buffer from file <your-file>? (y or n) y".
y-or-n-p deliberately displays the prompt with your response before it
returns to the caller, see the source. It does that because
otherwise you would not have a chance of observing your response.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#9557
; Package
emacs
.
(Tue, 20 Sep 2011 10:08:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 9557 <at> debbugs.gnu.org (full text, mbox):
> Date: Tue, 20 Sep 2011 11:43:41 +0200
> From: Dani Moncayo <dmoncayo <at> gmail.com>
> Cc: 9557 <at> debbugs.gnu.org
>
> The question is: from an user POV, is there a way to achieve the
> behavior I want (short answers), without the "residual text" problem?
If you really don't want to see your response, write your own function
that calls y-or-n-p, clears the echo area (by displaying an empty
message), then returns the value returned by y-or-n-p.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#9557
; Package
emacs
.
(Tue, 20 Sep 2011 10:33:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 9557 <at> debbugs.gnu.org (full text, mbox):
> y-or-n-p deliberately displays the prompt with your response before it
> returns to the caller, see the source. It does that because
> otherwise you would not have a chance of observing your response.
Ah, ok.
In my case, I find that echo a bit unnecessary/disconcerting (hence
this bug report).
What about adding a variable to control that echo (with default value
"on", to keep the current behavior untouched)?
--
Dani Moncayo
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#9557
; Package
emacs
.
(Tue, 20 Sep 2011 17:01:01 GMT)
Full text and
rfc822 format available.
Message #23 received at 9557 <at> debbugs.gnu.org (full text, mbox):
>> y-or-n-p deliberately displays the prompt with your response before it
>> returns to the caller, see the source. It does that because
>> otherwise you would not have a chance of observing your response.
>
> Ah, ok.
>
> In my case, I find that echo a bit unnecessary/disconcerting (hence
> this bug report).
>
> What about adding a variable to control that echo (with default value
> "on", to keep the current behavior untouched)?
You can put in your .emacs:
(defadvice y-or-n-p (around y-or-n-p act)
(let ((answer ad-do-it))
(message "")
answer))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#9557
; Package
emacs
.
(Tue, 20 Sep 2011 17:54:02 GMT)
Full text and
rfc822 format available.
Message #26 received at 9557 <at> debbugs.gnu.org (full text, mbox):
>> In my case, I find that echo a bit unnecessary/disconcerting (hence
>> this bug report).
>>
>> What about adding a variable to control that echo (with default value
>> "on", to keep the current behavior untouched)?
>
> You can put in your .emacs:
>
> (defadvice y-or-n-p (around y-or-n-p act)
> (let ((answer ad-do-it))
> (message "")
> answer))
>
Thanks, Juri. It works fine. I'll use it.
I was going to propose another (more flexible) alternative: Instead of
storing a boolean value in a variable (to switch echoing on/off),
store a time delay, after which the echoed text would be removed (if
was not already removed by another event). A value of 0 would mean
"don't echo", and a value greater that some limit would mean "never
remove" (as now).
But if no one else thinks that this change is worthwhile, you can
close this bug report.
Thanks again.
--
Dani Moncayo
Added tag(s) notabug and wontfix.
Request was from
Juri Linkov <juri <at> jurta.org>
to
control <at> debbugs.gnu.org
.
(Tue, 20 Sep 2011 18:25:02 GMT)
Full text and
rfc822 format available.
Reply sent
to
Juri Linkov <juri <at> jurta.org>
:
You have taken responsibility.
(Tue, 20 Sep 2011 18:25:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Dani Moncayo <dmoncayo <at> gmail.com>
:
bug acknowledged by developer.
(Tue, 20 Sep 2011 18:25:03 GMT)
Full text and
rfc822 format available.
Message #33 received at 9557-done <at> debbugs.gnu.org (full text, mbox):
tags 9557 notabug wontfix
thanks
> But if no one else thinks that this change is worthwhile, you can
> close this bug report.
I doubt that anyone might want to miss information about the incorrect answer.
IOW, more information is better than less information.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 19 Oct 2011 11:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 13 years and 326 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.