From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#38785: 26.3; `y-or-n-p' leaves prompt and response in echo area Date: Sat, 28 Dec 2019 15:30:10 -0800 (PST) Message-ID: <5561aae8-fa46-4228-833a-912fc49d789e@default> References: <787722a4-9679-4160-903d-d9de42801ddf@default> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="6302"; mail-complaints-to="usenet@blaine.gmane.org" To: 38785@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 29 00:33:20 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ilLaC-0001Sc-NB for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Dec 2019 00:33:20 +0100 Original-Received: from localhost ([::1]:47610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ilLaB-0006es-Hi for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 Dec 2019 18:33:19 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42017) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ilLa0-0006dB-IN for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2019 18:33:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ilLZy-0003ET-Ff for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2019 18:33:08 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53111) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ilLZu-00033j-M7 for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2019 18:33:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ilLZu-00061L-Fv for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2019 18:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Dec 2019 23:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38785 X-GNU-PR-Package: emacs Original-Received: via spool by 38785-submit@debbugs.gnu.org id=B38785.157757594023090 (code B ref 38785); Sat, 28 Dec 2019 23:33:02 +0000 Original-Received: (at 38785) by debbugs.gnu.org; 28 Dec 2019 23:32:20 +0000 Original-Received: from localhost ([127.0.0.1]:59084 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ilLZE-00060M-Lf for submit@debbugs.gnu.org; Sat, 28 Dec 2019 18:32:20 -0500 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:42190) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ilLZC-000607-Ox for 38785@debbugs.gnu.org; Sat, 28 Dec 2019 18:32:19 -0500 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xBSNVYI5062082 for <38785@debbugs.gnu.org>; Sat, 28 Dec 2019 23:32:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2019-08-05; bh=yzEWA6wYwCfdMig07BozvrQwiN5r4JGRiIfFRqPxV4E=; b=iiBjXdzEfHtMBpiiR+Xjmf8yiGRpfUXIouygqC7x7SV+t2cKOoJ9HOmpoIeDUfIze47A yTSGKiatT4p6ucJjb/4DTlYQOJbrDw39OJY/naWWfRggRQGA4xkiGgGZ2ANnr8zCNweb Go0yA6muXyM8SSmpV9SkMZtAevTOmaI+2oRs6WVxl5iidvzF72HsUD1J4MoMAhARCumy d1vhd7r6RsmbKaan3Boy8ojmh+ezE+ztVv06wuNk3gCN+0QhgTXnFSFUbZzZh3ElrYsE ij7xG2t5Vi3WN2KQRS2yhjWttdn6UZUD4EKNDxhr/9K1EJh4iWsxJ/VnTlDnuPdVkhfq OA== Original-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 2x5y0p9rux-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <38785@debbugs.gnu.org>; Sat, 28 Dec 2019 23:32:12 +0000 Original-Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xBSNTATX017944 for <38785@debbugs.gnu.org>; Sat, 28 Dec 2019 23:30:11 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3020.oracle.com with ESMTP id 2x5xd361vm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <38785@debbugs.gnu.org>; Sat, 28 Dec 2019 23:30:11 +0000 Original-Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id xBSNUARw001770 for <38785@debbugs.gnu.org>; Sat, 28 Dec 2019 23:30:11 GMT In-Reply-To: <787722a4-9679-4160-903d-d9de42801ddf@default> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4939.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9484 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=13 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-1912280220 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9484 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=13 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-1912280220 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:173870 Archived-At: > Perhaps `y-or-n-p' should do what it does now, but then reset the echo > area after a brief delay (e.g. 1 sec), where "reset" means to do what > `map-y-or-n-p' does: restore any previous echo-area content. IOW, it's > not bad to echo your response to the `y-or-n-p' question. But it is > bad not to clean up afterward, leaving the echo area littered with the > prompt. Actually, that's no good either. (Damn timers!) A function such as `y-or-n-p' or `map-y-or-n-p' can't clean up after a delay, because that will likely wipe out a subsequent such prompt, by restoring what was in the echo area before the first one. E.g. `y-or-n-p' followed by `y-or-n-p' or `map-y-or-n-p'. The second prompting function would have its prompt wiped out by the first one restoring what was in the echo area before the first one started. I think `y-or-n-p' should probably just use `(sit-for 1)' after it shows the prompt + answer, and then do what `map-y-or-n-p' does: clean up after itself: (let ((ret (eq answer 'act))) (unless noninteractive (message "%s%c" prompt (if ret ?y ?n)) (sit-for 1) (let ((message-log-max nil)) (if msg (message "%s" msg) (message "")))) ret)))