From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.bugs Subject: bug#32257: 26.1; read-multiple-choice inf loops on mouse clicks Date: Tue, 31 Jul 2018 12:59:37 +0100 Message-ID: References: <87muug4z52.fsf@gmail.com> <87y3dy3i05.fsf@gmail.com> <83muudrqol.fsf@gnu.org> <83effosvx2.fsf@gnu.org> <87r2jo3l0w.fsf@gmail.com> <837elgss8l.fsf@gnu.org> <87sh40189j.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1533038306 27676 195.159.176.226 (31 Jul 2018 11:58:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 31 Jul 2018 11:58:26 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt) To: 32257@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 31 13:58:22 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fkTID-00076H-Ni for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 Jul 2018 13:58:21 +0200 Original-Received: from localhost ([::1]:58363 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkTKK-0003Sh-9V for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 Jul 2018 08:00:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44277) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkTJu-0003I4-Ud for bug-gnu-emacs@gnu.org; Tue, 31 Jul 2018 08:00:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fkTJr-0001Ds-UZ for bug-gnu-emacs@gnu.org; Tue, 31 Jul 2018 08:00:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59039) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fkTJr-0001D3-QG for bug-gnu-emacs@gnu.org; Tue, 31 Jul 2018 08:00:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fkTJr-0003th-EI for bug-gnu-emacs@gnu.org; Tue, 31 Jul 2018 08:00:03 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87muug4z52.fsf@gmail.com> Resent-From: Andy Moreton Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 31 Jul 2018 12:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32257 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.153303840114944 (code B ref -1); Tue, 31 Jul 2018 12:00:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 31 Jul 2018 12:00:01 +0000 Original-Received: from localhost ([127.0.0.1]:35824 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fkTJp-0003sy-4Y for submit@debbugs.gnu.org; Tue, 31 Jul 2018 08:00:01 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53228) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fkTJn-0003sl-J9 for submit@debbugs.gnu.org; Tue, 31 Jul 2018 07:59:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fkTJh-00018d-IX for submit@debbugs.gnu.org; Tue, 31 Jul 2018 07:59:54 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:36014) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fkTJh-00018R-FL for submit@debbugs.gnu.org; Tue, 31 Jul 2018 07:59:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fkTJg-0003FZ-5d for bug-gnu-emacs@gnu.org; Tue, 31 Jul 2018 07:59:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fkTJd-00016w-4A for bug-gnu-emacs@gnu.org; Tue, 31 Jul 2018 07:59:52 -0400 Original-Received: from [195.159.176.226] (port=40085 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fkTJc-00016O-St for bug-gnu-emacs@gnu.org; Tue, 31 Jul 2018 07:59:49 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fkTHT-0006FB-4R for bug-gnu-emacs@gnu.org; Tue, 31 Jul 2018 13:57:35 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 48 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:NAHMMNoTKbxWVCiknT0p64eN5gk= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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: 208.118.235.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:149101 Archived-At: On Mon 30 Jul 2018, Noam Postavsky wrote: > Eli Zaretskii writes: > >>> >> > If we want this change on emacs-26, we should carefully audit all the >>> >> > other users of rmc.el >>> >>> What should we check for though? >> >> Anything that read-event handles differently from read-char. Maybe a >> good starting point is to compile a list of the differences in >> behavior between the two. > > Looking at the implementation, they both delegate to > read_filtered_event, but read-char passes 1 for the first three args, > where read-event passes 0. > > If NO_SWITCH_FRAME, switch-frame events are stashed > until we get a character we like, and then stuffed into > unread_switch_frame. > > If ASCII_REQUIRED, check function key events to see > if the unmodified version of the symbol has a Qascii_character > property, and use that character, if present. > > If ERROR_NONASCII, signal an error if the input we > get isn't an ASCII character with modifiers. If it's false but > ASCII_REQUIRED is true, just re-read until we get an ASCII > character. So perhaps this `read-char' to `read-event' change will result in different frame switching behaviour. I'm not sure how to test that though. > Another possibility is to use read-char-exclusive which only changes > ERROR_NON_ASCII to 0. The downside is that when there are mouse clicks > it prints the events into the minibuffer, covering the prompt (but > typing "?" still works to restore the prompt). AS you have done, I read the implementation and tried a patch using `read-char-exclusive'. The result is unusable as the printed events obscure the original question. The proper long term fix for this is to make read-multiple-choice use a dedicated buffer rather than the minibuffer, and give better visibility when more than one question is asked in succession. Perhaps also some way to stop the echo area from obscuring the minibuffer ? AndyM