From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 28 17:57:17 2019 Received: (at submit) by debbugs.gnu.org; 28 Dec 2019 22:57:17 +0000 Received: from localhost ([127.0.0.1]:59067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ilL1J-00058X-7B for submit@debbugs.gnu.org; Sat, 28 Dec 2019 17:57:17 -0500 Received: from lists.gnu.org ([209.51.188.17]:48393) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ilL1H-00058P-Li for submit@debbugs.gnu.org; Sat, 28 Dec 2019 17:57:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53379) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ilL1G-0002E4-5p for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2019 17:57:15 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_MED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ilL1E-0000BR-O7 for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2019 17:57:13 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:47620) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ilL1E-0008Th-DM for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2019 17:57:12 -0500 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 xBSMtGIL040974 for ; Sat, 28 Dec 2019 22:57:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : content-type : content-transfer-encoding; s=corp-2019-08-05; bh=7TV1DJ/zocFHipNLVZtZATGtcZVGrafArOc+yPcUO4I=; b=DIigXrtS8V5WkV6Dr2QNnI8OihzLDxBrrcW71UTy5GzwvoEAHITNZ+mf6w7WLBgKCm08 aXJYjYHcEjUDHXk5xkZ0uDU7QchOv2uVAvbFMAp/kiUkQAMAZ/8tWf9Ej4FlyXh8vNnT yX1bRBO4kLphdcE2sbcnC4S5Etvs9RJtsXiu6Zbox0fYbxkpURGPL8NwbraiQneSL88s r5Vsq4Ftmk8dt32cWqU6BmINXCqaaFF34aTqpeGwiJQkBCqO5lG+5U5gNM2vzDgaTUxg ZwcnmsNE7HNtA3gyZh5FLm5icVzNQrgEpajcSfA6A6UbyjIe1m/xX5NVifYVXypWAIGm gg== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 2x5y0p9qk2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sat, 28 Dec 2019 22:57:10 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xBSMrSZA082053 for ; Sat, 28 Dec 2019 22:55:09 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3030.oracle.com with ESMTP id 2x5wb8h303-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sat, 28 Dec 2019 22:55:09 +0000 Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id xBSMt8bb023036 for ; Sat, 28 Dec 2019 22:55:08 GMT MIME-Version: 1.0 Message-ID: <787722a4-9679-4160-903d-d9de42801ddf@default> Date: Sat, 28 Dec 2019 14:55:08 -0800 (PST) From: Drew Adams To: bug-gnu-emacs@gnu.org Subject: 26.3; `y-or-n-p' leaves prompt and response in echo area X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4939.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9484 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 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-1912280215 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=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 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-1912280215 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 141.146.126.78 X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) `y-or-n-p' puts its prompt in the echo area. [Aside: That is not ideal for a prompt. Some other interaction might be better, such as using a pop-up for the prompt. In any case, `y-or-n-p' and similar functions should NOT use the minibuffer. `read-key' should continue to act without any use of the minibuffer. IMHO, it would make zero sense to use the minibuffer to read a key.] At the end, `y-or-n-p' puts its prompt in the echo area again, followed by the user's response (`y' or `n'): (unless noninteractive (message "%s%c" prompt (if ret ?y ?n))) This is a bother, and it can confuse users, especially when there are additional questions that follow the `y-or-n-p' prompting. For example, consider a `y-or-n-p' followed by a `map-y-or-n-p'. When the latter is finished, the prompt from the preceding `y-or-n-p' gets restored to the echo area. That makes little sense, and it can be quite confusing. `map-y-or-n-p' does not leave any of its prompts in the echo area. This is a good thing, not a bad thing. Instead, as a good citizen, it does this at the end, to ensure that it hasn't left any of its echo-area prompts behind, as litter: ;; Clear the last prompt from the minibuffer, and restore the ;; previous echo-area message, if any. (let ((message-log-max nil)) (if msg (message "%s" msg) (message ""))) Perhaps that, or similar, is what `y-or-n-p' should do. Presumably the reason that `y-or-n-p' does what it does is to provide feedback of the char (`y' or `n') that you typed. It's true that that's helpful, but it also causes problems (see above). 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. For example, have `y-or-n-p' bind `msg' to `(current-message)' at the outset, and then do this at the end: (let ((ret (eq answer 'act))) (unless noninteractive (message "%s%c" prompt (if ret ?y ?n)) ; <=3D=3D=3D=3D (1) (run-with-timer 1 nil (lambda ()=20 (let ((message-log-max nil)) ; <=3D=3D=3D=3D (2) (if msg=20 (message "%s" msg) (message "")))))) ret) (1) is what `y-or-n-p' does now, to show you your response. (2) is what `map-y-or-n-p' does, to clean up after itself. If something similar to this 1-2 punch is not done, and if the only available choice is for `y-or-n-p' to do what it does now (#1), or to just clean up after itself (#2), then my vote is for #2. In GNU Emacs 26.3 (build 1, x86_64-w64-mingw32) of 2019-08-29 Repository revision: 96dd0196c28bc36779584e47fffcca433c9309cd Windowing system distributor `Microsoft Corp.', version 10.0.17763 Configured using: `configure --without-dbus --host=3Dx86_64-w64-mingw32 --without-compress-install 'CFLAGS=3D-O2 -static -g3'' From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 28 18:32:20 2019 Received: (at 38785) by debbugs.gnu.org; 28 Dec 2019 23:32:20 +0000 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 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 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== 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 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 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 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 MIME-Version: 1.0 Message-ID: <5561aae8-fa46-4228-833a-912fc49d789e@default> Date: Sat, 28 Dec 2019 15:30:10 -0800 (PST) From: Drew Adams To: 38785@debbugs.gnu.org Subject: RE: bug#38785: 26.3; `y-or-n-p' leaves prompt and response in echo area References: <787722a4-9679-4160-903d-d9de42801ddf@default> 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)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable 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-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 38785 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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))) From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 29 03:58:31 2019 Received: (at 38785) by debbugs.gnu.org; 29 Dec 2019 08:58:31 +0000 Received: from localhost ([127.0.0.1]:59233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ilUP9-0003Rp-2C for submit@debbugs.gnu.org; Sun, 29 Dec 2019 03:58:31 -0500 Received: from mail-out.m-online.net ([212.18.0.10]:41180) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ilUP6-0003Rf-LC for 38785@debbugs.gnu.org; Sun, 29 Dec 2019 03:58:30 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 47lvc323ZSz1rVvk; Sun, 29 Dec 2019 09:58:26 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 47lvc26Mv2z1qqkb; Sun, 29 Dec 2019 09:58:26 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id jQiYrx1cWe9j; Sun, 29 Dec 2019 09:58:26 +0100 (CET) X-Auth-Info: hKGdz4tai54uR/rRS7dq8uN6c3CXFXNB6pcOmQTLBXdQlPhyolEYg1cQbs/5vUBh Received: from hase.home (ppp-46-244-161-188.dynamic.mnet-online.de [46.244.161.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Sun, 29 Dec 2019 09:58:26 +0100 (CET) Received: by hase.home (Postfix, from userid 1000) id F2BD2101BFA; Sun, 29 Dec 2019 09:58:24 +0100 (CET) From: Andreas Schwab To: Drew Adams Subject: Re: bug#38785: 26.3; `y-or-n-p' leaves prompt and response in echo area References: <787722a4-9679-4160-903d-d9de42801ddf@default> <5561aae8-fa46-4228-833a-912fc49d789e@default> X-Yow: I am having a CONCEPTION-- Date: Sun, 29 Dec 2019 09:58:24 +0100 In-Reply-To: <5561aae8-fa46-4228-833a-912fc49d789e@default> (Drew Adams's message of "Sat, 28 Dec 2019 15:30:10 -0800 (PST)") Message-ID: <87blrrwlsf.fsf@hase.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: 38785 Cc: 38785@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.4 (-) On Dez 28 2019, Drew Adams wrote: > I think `y-or-n-p' should probably just use `(sit-for 1)' > after it shows the prompt + answer, That would always delay the caller of y-or-n-p by one second. I'm pretty sure that would be highly annoying. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 29 09:06:22 2019 Received: (at 38785) by debbugs.gnu.org; 29 Dec 2019 14:06:22 +0000 Received: from localhost ([127.0.0.1]:59372 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ilZD3-0004hu-Vf for submit@debbugs.gnu.org; Sun, 29 Dec 2019 09:06:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ilZD2-0004hi-6y for 38785@debbugs.gnu.org; Sun, 29 Dec 2019 09:06:20 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47615) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ilZCw-0006eu-9C; Sun, 29 Dec 2019 09:06:14 -0500 Received: from [176.228.60.248] (port=3185 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ilZCs-0006ee-S1; Sun, 29 Dec 2019 09:06:11 -0500 Date: Sun, 29 Dec 2019 16:06:15 +0200 Message-Id: <83blrrns4o.fsf@gnu.org> From: Eli Zaretskii To: Andreas Schwab In-reply-to: <87blrrwlsf.fsf@hase.home> (message from Andreas Schwab on Sun, 29 Dec 2019 09:58:24 +0100) Subject: Re: bug#38785: 26.3; `y-or-n-p' leaves prompt and response in echo area References: <787722a4-9679-4160-903d-d9de42801ddf@default> <5561aae8-fa46-4228-833a-912fc49d789e@default> <87blrrwlsf.fsf@hase.home> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 38785 Cc: 38785@debbugs.gnu.org, drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Andreas Schwab > Date: Sun, 29 Dec 2019 09:58:24 +0100 > Cc: 38785@debbugs.gnu.org > > On Dez 28 2019, Drew Adams wrote: > > > I think `y-or-n-p' should probably just use `(sit-for 1)' > > after it shows the prompt + answer, > > That would always delay the caller of y-or-n-p by one second. I'm > pretty sure that would be highly annoying. Yes. And besides, this area underwent significant changes since Emacs 26.3, so I suggest to try the latest emacs-27 branch before continuing the discussion. From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 29 09:08:20 2019 Received: (at 38785) by debbugs.gnu.org; 29 Dec 2019 14:08:20 +0000 Received: from localhost ([127.0.0.1]:59378 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ilZEy-0004l8-Bw for submit@debbugs.gnu.org; Sun, 29 Dec 2019 09:08:20 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:59730) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ilZEx-0004ku-5X for 38785@debbugs.gnu.org; Sun, 29 Dec 2019 09:08:19 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xBTE7aHD013562; Sun, 29 Dec 2019 14:08:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2019-08-05; bh=5EKdQUnp+hj7GKfhnwqZ0P1QIwzFtZSfki12BRjOXCk=; b=Oq9URENRqbTE2cZXv5AV2+5qVq3ElsdJsSWCR6JaDJHdrN9ejg2Tcl+GoZjOM/MouiU5 eT8nP7B8vJoZN7IjbMWsNjq4BbpMqbYLZOSJxTmhhSO2Z9fzwgOxANpgu36qMAF5Pz4B e0flSGqdtBOT1lK0FCixOX0Iq6889Oeff9zILZre0YzMaZwjfQbYG1hgOrX6/nYyGmcp ruSfLoTJqmwhBA3hfjTWUDrXJ4sEim650b0DQIAafi8pYha6D+wVEBfg8ofsZUHEnMe8 vjYyVtQ+5RD1xDBUFD0yRQogZ2T5UXFkil0YSulHLySU52Oir9eogWOm6RQw56o9U75o EA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 2x5xftb649-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 29 Dec 2019 14:08:13 +0000 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 xBTE3p1l145989; Sun, 29 Dec 2019 14:08:12 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3020.oracle.com with ESMTP id 2x6h6nr2c5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 29 Dec 2019 14:08:12 +0000 Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id xBTE87F1013402; Sun, 29 Dec 2019 14:08:09 GMT MIME-Version: 1.0 Message-ID: <4bbe14bc-3802-4310-a506-dad1f0c1f7ae@default> Date: Sun, 29 Dec 2019 06:08:07 -0800 (PST) From: Drew Adams To: Andreas Schwab Subject: RE: bug#38785: 26.3; `y-or-n-p' leaves prompt and response in echo area References: <787722a4-9679-4160-903d-d9de42801ddf@default> <5561aae8-fa46-4228-833a-912fc49d789e@default> <87blrrwlsf.fsf@hase.home> In-Reply-To: <87blrrwlsf.fsf@hase.home> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4939.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9484 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 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-1912290135 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=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 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-1912290135 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 38785 Cc: 38785@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > > I think `y-or-n-p' should probably just use > > `(sit-for 1)' after it shows the prompt + answer, >=20 > That would always delay the caller of y-or-n-p by one > second. I'm pretty sure that would be highly annoying. 1. Not always delay. It's sit-for, not sleep-for, after all. Have you tried it? I haven't noticed a problem with it so far, but there are no doubt lots of possible use cases. 2. More annoying than the problem it aims to solve? 3. Alternative solutions are welcome. The basic problem stems from `read-key' prompting in the echo area. That's really not ideal, at least in some contexts. (But making it read using the minibuffer would be an even bigger mistake, IMO.) From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 29 09:14:51 2019 Received: (at 38785) by debbugs.gnu.org; 29 Dec 2019 14:14:51 +0000 Received: from localhost ([127.0.0.1]:59388 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ilZLH-0004uT-G4 for submit@debbugs.gnu.org; Sun, 29 Dec 2019 09:14:51 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:54988) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ilZLF-0004uF-AE for 38785@debbugs.gnu.org; Sun, 29 Dec 2019 09:14:49 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xBTEEhIf191744; Sun, 29 Dec 2019 14:14:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2019-08-05; bh=q9OOzmeWcv2jP2XpdBC3OnVHPmfnoc3RRZBOZ+lStJ0=; b=sb7opHn/KsaEI6nZw7lZxw5+ggUAxK+ghe2VqNwo7c8/j5qmBAuoJrc190TzT6MhMcEn a5ptXoHPzfmfqPLdw3jIZY/KcqVyV3wTcNnw3tqYWlVRw5Id2pzPIhv2s/nWMZks05mw Af+RGTT4/nyQ89j2XCoOcVZLVPlYH6cpksYudMqxj0HUyVQgoEVVibYHHA793qLof4/m 2F7gCD8+WuvkuNx+MtWcKZ2RXVFS5XDzknvqZTaJV/8TIlqqy3w6ulcjUCzaWUXieH+n EzRpLH4HD9l0/pRqLHCHq+K312WoMiDMusktoAcgCxXlCck/F86qm+g/ecy7opSAE9rZ eg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 2x5ypqayjf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 29 Dec 2019 14:14:43 +0000 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 xBTEDocr159832; Sun, 29 Dec 2019 14:14:43 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3020.oracle.com with ESMTP id 2x6h6nr613-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 29 Dec 2019 14:14:42 +0000 Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id xBTEEfbC008430; Sun, 29 Dec 2019 14:14:41 GMT MIME-Version: 1.0 Message-ID: <9f59791d-d4b5-4d41-b6e1-0a8428681c68@default> Date: Sun, 29 Dec 2019 06:14:40 -0800 (PST) From: Drew Adams To: Eli Zaretskii , Andreas Schwab Subject: RE: bug#38785: 26.3; `y-or-n-p' leaves prompt and response in echo area References: <<787722a4-9679-4160-903d-d9de42801ddf@default>> <<5561aae8-fa46-4228-833a-912fc49d789e@default>> <<87blrrwlsf.fsf@hase.home>> <<83blrrns4o.fsf@gnu.org>> In-Reply-To: <<83blrrns4o.fsf@gnu.org>> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4939.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9484 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 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-1912290136 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=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 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-1912290136 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 38785 Cc: 38785@debbugs.gnu.org, drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > > > I think `y-or-n-p' should probably just use `(sit-for 1)' > > > after it shows the prompt + answer, > > > > That would always delay the caller of y-or-n-p by one second. I'm > > pretty sure that would be highly annoying. >=20 > Yes. And besides, this area underwent significant changes since Emacs > 26.3, so I suggest to try the latest emacs-27 branch before continuing > the discussion. `read-key', and functions like `y-or-n-p' that use it or do the same thing, should not be made to read from the minibuffer. The fact that such functions have prompted using the echo area is bad enough. Making them read from the minibuffer is even worse. That's my opinion about (my understanding of) those "significant changes". Doing that just introduces a new (design) bug that should, and will hopefully someday, be fixed. From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 29 09:29:06 2019 Received: (at 38785) by debbugs.gnu.org; 29 Dec 2019 14:29:07 +0000 Received: from localhost ([127.0.0.1]:59412 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ilZZ4-0005GM-KE for submit@debbugs.gnu.org; Sun, 29 Dec 2019 09:29:06 -0500 Received: from mail-out.m-online.net ([212.18.0.9]:51727) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ilZZ1-0005GA-VT for 38785@debbugs.gnu.org; Sun, 29 Dec 2019 09:29:04 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 47m2xV4TXZz1qqkl; Sun, 29 Dec 2019 15:29:02 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 47m2xV2y6Dz1qql4; Sun, 29 Dec 2019 15:29:02 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id e__n2KCZqhQT; Sun, 29 Dec 2019 15:29:01 +0100 (CET) X-Auth-Info: lXj8shQlJDbzm0QGskIvkeohAbJK/COvMls3dquN88ltDEmNo/H8U1YNTdKvSAw6 Received: from igel.home (ppp-46-244-161-188.dynamic.mnet-online.de [46.244.161.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Sun, 29 Dec 2019 15:29:01 +0100 (CET) Received: by igel.home (Postfix, from userid 1000) id F36D02C01AE; Sun, 29 Dec 2019 15:29:00 +0100 (CET) From: Andreas Schwab To: Drew Adams Subject: Re: bug#38785: 26.3; `y-or-n-p' leaves prompt and response in echo area References: <787722a4-9679-4160-903d-d9de42801ddf@default> <5561aae8-fa46-4228-833a-912fc49d789e@default> <87blrrwlsf.fsf@hase.home> <4bbe14bc-3802-4310-a506-dad1f0c1f7ae@default> X-Yow: Concentrate on th'cute, li'l CARTOON GUYS! Remember the SERIAL NUMBERS!! Follow the WHIPPLE AVE EXIT!! Have a FREE PEPSI!! Turn LEFT at th'HOLIDAY INN!! JOIN the CREDIT WORLD!! MAKE me an OFFER!!! Date: Sun, 29 Dec 2019 15:29:00 +0100 In-Reply-To: <4bbe14bc-3802-4310-a506-dad1f0c1f7ae@default> (Drew Adams's message of "Sun, 29 Dec 2019 06:08:07 -0800 (PST)") Message-ID: <87r20n8atv.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 38785 Cc: 38785@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.5 (-) On Dez 29 2019, Drew Adams wrote: >> > I think `y-or-n-p' should probably just use >> > `(sit-for 1)' after it shows the prompt + answer, >> >> That would always delay the caller of y-or-n-p by one >> second. I'm pretty sure that would be highly annoying. > > 1. Not always delay. It's sit-for, not sleep-for, That doesn't make it any better. It introduces latency, and latency is very annoying, prone to induce errors. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."