From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#51101: 29.0.50; read-char-from-minibuffer accepts Enter even when not a choice. Date: Sat, 09 Oct 2021 15:09:24 +0200 Message-ID: <877demny4b.fsf@gnus.org> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7974"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 51101@debbugs.gnu.org, Juri Linkov To: "David M. Koppelman" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 09 15:10:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mZC78-0001tn-Ue for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 09 Oct 2021 15:10:11 +0200 Original-Received: from localhost ([::1]:59500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mZC77-0007QM-Iy for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 09 Oct 2021 09:10:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58544) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mZC70-0007Q7-Q4 for bug-gnu-emacs@gnu.org; Sat, 09 Oct 2021 09:10:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40924) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mZC70-000393-Ge for bug-gnu-emacs@gnu.org; Sat, 09 Oct 2021 09:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mZC70-0000by-3S for bug-gnu-emacs@gnu.org; Sat, 09 Oct 2021 09:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Oct 2021 13:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51101 X-GNU-PR-Package: emacs Original-Received: via spool by 51101-submit@debbugs.gnu.org id=B51101.16337849782315 (code B ref 51101); Sat, 09 Oct 2021 13:10:02 +0000 Original-Received: (at 51101) by debbugs.gnu.org; 9 Oct 2021 13:09:38 +0000 Original-Received: from localhost ([127.0.0.1]:52470 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZC6b-0000bH-SI for submit@debbugs.gnu.org; Sat, 09 Oct 2021 09:09:38 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:33492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZC6Z-0000b2-CF for 51101@debbugs.gnu.org; Sat, 09 Oct 2021 09:09:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=6bT6+DY97RSUy6wlIkq0sfLJGUpgU17BQdyHl2JZIE4=; b=uBPSzbRo/VWT5wYwp0LvEGb/Xn /FmSEQRzu/u6tHaTMCpxpr34Y1pIsX3e+P40fGf41Hvd962dqfGVlZ9ybk7hq20xLkO6f7RBg4gG4 nAwz5bcsXFXWX4XCraxXlv/pg9/1VMA+En3vxSTq/k4qf/DzPfva/nmyr7KjzMJmFioo=; Original-Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mZC6O-0005gx-Q9; Sat, 09 Oct 2021 15:09:27 +0200 X-Now-Playing: Tom Robinson's _North by Northwest_: "Atmospherics" In-Reply-To: (David M. Koppelman's message of "Fri, 08 Oct 2021 15:19:48 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:216770 Archived-At: "David M. Koppelman" writes: > Execute: > > (read-char-from-minibuffer "Answer y or n" '(?y ?n)) > > and press Enter. The form returns Enter (13) rather than re-prompting > for a y or n. It seems undocumented what RET is supposed to do in this function -- I've added Juri to the CCs, perhaps he has some comments. > This causes a dataloss threat due to read-char-from-minibuffer being > called through ask-user-about-supersession-threat. > > Even if the read-char-from-minibuffer bug is quickly fixed, I'd > sleep better if the following patch were applied to userlock.el: > > @@ -194,7 +194,9 @@ ask-user-about-supersession-threat > (list "File reverted" filename))) > ((eq answer ?n) > (signal 'file-supersession > - (list "File changed on disk" filename))))) > + (list "File changed on disk" filename))) > + ((eq answer ?y)) > + (t (setq answer nil)))) But I think ask-user-about-supersession-threat is working correctly here already (almost by chance). RET means "yes" in functions like `y-or-n-p', which this is basically an extended version of, so it should work as "yes" here, too. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no