From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.bugs Subject: bug#22714: 25.0.91; Minibuffer quirk in C-x r SPC Date: Fri, 08 Apr 2016 15:26:00 +0000 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1135bf3885b00a052ffad016 X-Trace: ger.gmane.org 1460129232 17683 80.91.229.3 (8 Apr 2016 15:27:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Apr 2016 15:27:12 +0000 (UTC) Cc: 22714@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 08 17:27:12 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aoYJS-0000T7-FV for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Apr 2016 17:27:10 +0200 Original-Received: from localhost ([::1]:56778 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoYJR-0007MG-UI for geb-bug-gnu-emacs@m.gmane.org; Fri, 08 Apr 2016 11:27:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52321) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoYJN-0007Jc-Aj for bug-gnu-emacs@gnu.org; Fri, 08 Apr 2016 11:27:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aoYJK-0006VY-2p for bug-gnu-emacs@gnu.org; Fri, 08 Apr 2016 11:27:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42407) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoYJJ-0006VU-VV for bug-gnu-emacs@gnu.org; Fri, 08 Apr 2016 11:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1aoYJJ-0005KU-Rl for bug-gnu-emacs@gnu.org; Fri, 08 Apr 2016 11:27:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Apr 2016 15:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22714 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22714-submit@debbugs.gnu.org id=B22714.146012917720431 (code B ref 22714); Fri, 08 Apr 2016 15:27:01 +0000 Original-Received: (at 22714) by debbugs.gnu.org; 8 Apr 2016 15:26:17 +0000 Original-Received: from localhost ([127.0.0.1]:54744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aoYIb-0005JT-Gz for submit@debbugs.gnu.org; Fri, 08 Apr 2016 11:26:17 -0400 Original-Received: from mail-oi0-f45.google.com ([209.85.218.45]:33001) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aoYIZ-0005JG-PD for 22714@debbugs.gnu.org; Fri, 08 Apr 2016 11:26:16 -0400 Original-Received: by mail-oi0-f45.google.com with SMTP id w85so140228799oiw.0 for <22714@debbugs.gnu.org>; Fri, 08 Apr 2016 08:26:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FKXfBjP1DSKZ0mPWaImgj0OAep8eF9B3gFR0PPk6NCs=; b=bRZLF1asG8jt12jM4kzXBz52llgcPc6t3g2JDnGTEvTUt2jfWAjnupjByIDa2lOpAk ZpZFBcmioflCyc3YJeYxw81QT6+Abz0gqotx7ZINMTeyBO1f6DdXkna9jD8QmCuVujOO CA8Zk/4QC3dErWYN9alHatdxCfhvdhGF7Se7FHuhEE/qgfUE6sl/c+c+nsQ0OnVQHdRt MgnF9fwIPqrZ6HAB+gh2vt2gc5q9RmgQ91vlA1+lHoMQHN3oORNkmNH59VY2OJh0CMBO XwcI0SxfSfPZIABM0UWrAfxdYeTsjMx6VZ4DG5BLeprId/cwn9aivHIeqnvKI941ZsDt fJFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FKXfBjP1DSKZ0mPWaImgj0OAep8eF9B3gFR0PPk6NCs=; b=XX02aeanSZ3M11KHsllwI4/tRHqoRbJ78R+5KBAlHUzn9yU7HxXOsjEkg3cbu5Kt1r r8DOt3LxfgT6terVJCdozb2yINatw9KOYUoAu5m5st3K+JEIskZ/E5wQpvrVz15Rq662 UfPV0tQYnwXj9pDnY7JfW99BswSivGNR3FJcYcn+qon6UIPN1VeAAb8N7mFvIXCPe0su +9ldxcU7/JQQZ89GhNWIDoHlJOWgXALCx0/5reAxEHinpi/KzGoQysGs24oVgsn4RP3l 2g0+UGLyN3ArHXATBO+I3POa/+n7j1gJMLJpD9rzBWoVlMvYbNwEiVTIyTsw8xlwFvih PYOA== X-Gm-Message-State: AD7BkJLCc7Nmv0CV5WQ8LuQbUOhTJyPz6XjxfdIxNemtgQCva9916oI08WnRFZTmO4CS//pmbQonuzQxybi0GA== X-Received: by 10.157.16.43 with SMTP id h40mr4442270ote.185.1460129170294; Fri, 08 Apr 2016 08:26:10 -0700 (PDT) In-Reply-To: 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:116213 Archived-At: --001a1135bf3885b00a052ffad016 Content-Type: text/plain; charset=UTF-8 Hi Stefan, I am not a good judge for this. Can you please commit the fix that feels the most right? On Sat, Feb 20, 2016 at 3:32 PM Stefan Monnier wrote: > > Stefan should be able to comment more on why that changes the behavior of > > the prompt staying vs disappearing. > > Good question. `read-key' uses `read-key-sequence' internally, and this > function has always left the prompt on display. > > Maybe read-key should be changed to behave more like read-event (and > read-char), since it's typically used in the same kinds of situations. > > IOW, we should probably install one of the two patches below. > > > Stefan > > > diff --git a/lisp/subr.el b/lisp/subr.el > index 7478595..cd1b945 100644 > --- a/lisp/subr.el > +++ b/lisp/subr.el > @@ -2116,6 +2116,10 @@ some sort of escape sequence, the ambiguity is > resolved via `read-key-delay'." > (aref keys 1) > key))) > (cancel-timer timer) > + ;; For some reason, `read-key(-sequence)' leaves the prompt in the > echo > + ;; area, whereas `read-event' seems to empty it just before > returning > + ;; (bug#22714). So, let's mimick the behavior of `read-event'. > + (message nil) > (use-global-map old-global-map)))) > > (defun read-char (&optional prompt) ;; (inherit-input-method seconds) > > > > diff --git a/lisp/register.el b/lisp/register.el > index faed49a..5fab2b0 100644 > --- a/lisp/register.el > +++ b/lisp/register.el > @@ -164,6 +164,13 @@ display such a window regardless." > help-chars) > (unless (get-buffer-window buffer) > (register-preview buffer 'show-empty))) > + ;; FIXME: For some reason, `read-key(-sequence)' leaves the > prompt in > + ;; the echo area, contrary to `read-event' which seems to empty > it > + ;; just before returning (bug#22714). > + ;; Not sure what's the best fix: maybe read-key should be > changed to > + ;; behave like read-event. But in the mean time, the hack below > + ;; should work. > + (message nil) > (if (characterp last-input-event) last-input-event > (error "Non-character input-event"))) > (and (timerp timer) (cancel-timer timer)) > --001a1135bf3885b00a052ffad016 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Stefan,

I am not a good judge for th= is. Can you please commit the fix that feels the most right?

On Sat, Feb 20, 2016 at 3:32 PM Stef= an Monnier <monnier@iro.umon= treal.ca> wrote:
> Stefan= should be able to comment more on why that changes the behavior of
> the prompt staying vs disappearing.

Good question.=C2=A0 `read-key' uses `read-key-sequence' internally= , and this
function has always left the prompt on display.

Maybe read-key should be changed to behave more like read-event (and
read-char), since it's typically used in the same kinds of situations.<= br>
IOW, we should probably install one of the two patches below.


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan


diff --git a/lisp/subr.el b/lisp/subr.el
index 7478595..cd1b945 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2116,6 +2116,10 @@ some sort of escape sequence, the ambiguity is resol= ved via `read-key-delay'."
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(aref keys 1)=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0key)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0(cancel-timer timer)
+=C2=A0 =C2=A0 =C2=A0 ;; For some reason, `read-key(-sequence)' leaves = the prompt in the echo
+=C2=A0 =C2=A0 =C2=A0 ;; area, whereas `read-event' seems to empty it j= ust before returning
+=C2=A0 =C2=A0 =C2=A0 ;; (bug#22714).=C2=A0 So, let's mimick the behavi= or of `read-event'.
+=C2=A0 =C2=A0 =C2=A0 (message nil)
=C2=A0 =C2=A0 =C2=A0 =C2=A0(use-global-map old-global-map))))

=C2=A0(defun read-char (&optional prompt) ;; (inherit-input-method seco= nds)



diff --git a/lisp/register.el b/lisp/register.el
index faed49a..5fab2b0 100644
--- a/lisp/register.el
+++ b/lisp/register.el
@@ -164,6 +164,13 @@ display such a window regardless."
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0help-chars)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (unless (get-buffer-window buffer= )
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (register-preview buffer &= #39;show-empty)))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; FIXME: For some reason, `read-key(-s= equence)' leaves the prompt in
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; the echo area, contrary to `read-eve= nt' which seems to empty it
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; just before returning (bug#22714). +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; Not sure what's the best fix: ma= ybe read-key should be changed to
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; behave like read-event.=C2=A0 But in= the mean time, the hack below
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; should work.
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (message nil)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (characterp last-input-event) last-i= nput-event
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (error "Non-character input-= event")))
=C2=A0 =C2=A0 =C2=A0 =C2=A0(and (timerp timer) (cancel-timer timer))
--001a1135bf3885b00a052ffad016--