Subject: Re: bug#9557: 24.0.50; "y-or-n-p" does not clear the echo area

From: Juri Linkov <[email-masked]>
Date: Tue, 20 Sep 2011 19:54:11 +0300

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