GNU bug report logs - #38551
27.0.50; [ELPA][PATCH] debbugs: bind to RET rather than return

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Kévin Le Gouguec <kevin.legouguec@HIDDEN>; Keywords: patch; dated Mon, 9 Dec 2019 19:29:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug Marked as fixed in versions 27.1. Request was from Michael Albinus <michael.albinus@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 38551 <at> debbugs.gnu.org:


Received: (at 38551) by debbugs.gnu.org; 9 Dec 2019 20:36:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 09 15:36:32 2019
Received: from localhost ([127.0.0.1]:54462 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iePlg-0000xN-HH
	for submit <at> debbugs.gnu.org; Mon, 09 Dec 2019 15:36:32 -0500
Received: from mout.gmx.net ([212.227.15.19]:36691)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael.albinus@HIDDEN>) id 1iePlb-0000x6-Aa
 for 38551 <at> debbugs.gnu.org; Mon, 09 Dec 2019 15:36:30 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1575923779;
 bh=f4Qo6A5n9EzugcCmXCMxZDc62hj/IA89IEF7rdO333U=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To;
 b=elH4QuTHzO1AhWydwEExZCcLn4ScQOB0d8OBdqlP3XdavJIgbF+1oSb1H5B84k1xY
 nWZyjsGa+VDx7oXG1gMz7z3HQ8bH5mVoQ+0s1mR4WS/+i7OQ8ayVdLXtg2G31cqJFL
 feDugaTBGiDbdovkgWda6C7dU7AtzI4yOeJHZn1s=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from detlef.gmx.de ([212.86.46.214]) by mail.gmx.com (mrgmx005
 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MC30Z-1iSZPK370f-00CU3C; Mon, 09
 Dec 2019 21:36:19 +0100
From: Michael Albinus <michael.albinus@HIDDEN>
To: =?utf-8?Q?K=C3=A9vin?= Le Gouguec <kevin.legouguec@HIDDEN>
Subject: Re: bug#38551: 27.0.50; [ELPA][PATCH] debbugs: bind to RET rather
 than return
References: <87wob5l2o0.fsf@HIDDEN>
Date: Mon, 09 Dec 2019 21:36:18 +0100
In-Reply-To: <87wob5l2o0.fsf@HIDDEN> (=?utf-8?Q?=22K=C3=A9vin?= Le
 Gouguec"'s message of "Mon, 09 Dec 2019 20:27:59 +0100")
Message-ID: <87ftht44ot.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Provags-ID: V03:K1:k1mUvOKw9RCGIX/mdV7BlLQhqo7Ab+vwCb55OMI6auVNlqbiDqw
 8SYS66E0eH0LXOr5SjUVOE05N1udBzgqhTcfXFGVDCyEexERW5vp4koCUV/C5bxoOd9bpIj
 +bFPEvaWbf3xmRrt6gCSqkJ3yIgPCaSg/JZB74ext1+px0Zk04F9V9CdhHvs2Ig1jhteV8z
 /tuXZX3uOJiYoddZ56jog==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:nfP4xg+ZN78=:1u0cQuncozYS0O2u+t14z2
 PSeZ+ZBuaz9Phml6GdfngkfP0YRpTB96xKRx3HvAxQbXxN3m2zeqh/q4iDkV8vvH8a0PhzU3h
 CqaaBE0xo0Jkz0vVrNlBUrXt7DQpKVMpADnbHdzoF+HrTmhHKfq6aTruLw29fuRoJYyB2vMxh
 Mj6sz9drzNEcG5TPpmLPgl0j/fVShIW4gIz73n/TFnA3oA69DNcDiJKSGUkAC1yrw6GOp5O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KMGt0emGn8C/61/hB1QRDVvBkH19LrzA=
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 38551
Cc: 38551 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

K=C3=A9vin Le Gouguec <kevin.legouguec@HIDDEN> writes:

> Hello,

Hi K=C3=A9vin,

> debbugs-gnu.el binds debbugs-gnu-select-report and
> debbugs-gnu-select-usertag to [return].  Unless I'm mistaken, this
> designates only the function key, and terminals do not tell applications
> that function keys were pressed.  In the case of [return], they only
> send RET, i.e. the C-m character.

Oops, my bad. It was bound to "\r" previous to debbugs 0.21. I wanted to
change it for better readability, and I've overlooked this trap.

> On the other hand, if one binds those functions to (kbd "RET") =E2=89=A1 =
"\C-m"
> =E2=89=A1 "\r", Emacs automatically translates [return] to RET, and every=
thing
> Just Works=E2=84=A2.

I've decided for (kbd "RET"). Committed locally (the remote ELPA git is
down just now).

I will release debbugs 0.22, including this patch, when I have finished
my work on bug#37168, adding threading to debbugs for better performance.

> Thank you for your time.

Best regards, Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#38551; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 9 Dec 2019 19:28:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 09 14:28:08 2019
Received: from localhost ([127.0.0.1]:54433 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ieOhU-0007Lx-BE
	for submit <at> debbugs.gnu.org; Mon, 09 Dec 2019 14:28:08 -0500
Received: from lists.gnu.org ([209.51.188.17]:55619)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <kevin.legouguec@HIDDEN>) id 1ieOhS-0007Lk-Ox
 for submit <at> debbugs.gnu.org; Mon, 09 Dec 2019 14:28:07 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:33033)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <kevin.legouguec@HIDDEN>) id 1ieOhR-0002f3-6C
 for bug-gnu-emacs@HIDDEN; Mon, 09 Dec 2019 14:28:06 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 URIBL_BLOCKED autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <kevin.legouguec@HIDDEN>) id 1ieOhP-0002XM-R8
 for bug-gnu-emacs@HIDDEN; Mon, 09 Dec 2019 14:28:05 -0500
Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:35979)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <kevin.legouguec@HIDDEN>)
 id 1ieOhP-0002WN-H2
 for bug-gnu-emacs@HIDDEN; Mon, 09 Dec 2019 14:28:03 -0500
Received: by mail-wr1-x42c.google.com with SMTP id z3so17517266wru.3
 for <bug-gnu-emacs@HIDDEN>; Mon, 09 Dec 2019 11:28:03 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:subject:date:message-id:mime-version;
 bh=BwZ3EZjxgUCK4/6xWGsWt+RaAyK3Tn5IEEe1sdjknSA=;
 b=IZWgchHqFBAH1BIDoRNr7L8bIP7/6RreiEaBImuU20/kg6GcNVHT6Qxv9PxjZQ0B+X
 RvBWUVXv7/+aG5oLO8WN/z5bcOL8wmgFYBcTQ874vghK2fubFwQnAKdyHPHp/yaPJwji
 ZTt9WcNCayKyvB9UXMxCjJy7CFQtw8hQGtcxZcbvFlWImy4xlGb8GdpyXfA1ymlSmceh
 tWglkhhJM6NeSHuT3vMxxbcL/R7Y3oWSwl/fnm+SN62r+d61Jce2RNi1POHekYX8Djpk
 ijd/WF14L6hYfFz2NLAT1MiiZCh/AZAmE7Am27FU0NuCGT9RV8/OBYVuD96dOFIELfzT
 oM7g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:subject:date:message-id:mime-version;
 bh=BwZ3EZjxgUCK4/6xWGsWt+RaAyK3Tn5IEEe1sdjknSA=;
 b=mNXqeBN0doXmBJCgZlK/MjfSOQXoY3vGfKfkwFXOwUZZ1wq+k32nUPZk7/nH1Yjchp
 aQatAJAHOCq1W9y4J6obY273haSpUL7/ONDsmowaYMS7JEd3nvV0yPKaWAUrBlqHmL23
 l34JAuoU+hKjqq4+e6q+49RG8r9G2S1TFiP33XkcqRIL9hVKkSntVfkfXioxcyYlL+QD
 QhL1JqU6tEFkLllOint32TqKD26yzy61EC5LqzsoAidvIAA68/HcWAreRsosVctFjY5N
 cwpMXTiVMAPGexzc+aShcSfoSSZt9LhG/F4rd7GkKJZFg+gbghNcFeywaXbDI3n4xNWS
 uwqQ==
X-Gm-Message-State: APjAAAVYxtnEclFJVuqPJaIfqVMjhk/XdhoM/YBp9s26QdvCOTKRIji6
 TJxa6NSX16C5Y+sqjxeKeB4JL6Dd
X-Google-Smtp-Source: APXvYqyL1wKdS2pkun+pQ3dbwBPFawMxfBdXuF507Ux+9H2DyWUi2Tz3Ym4tRdLgisNbxcVsKbFSqw==
X-Received: by 2002:adf:cf12:: with SMTP id o18mr3945043wrj.361.1575919681628; 
 Mon, 09 Dec 2019 11:28:01 -0800 (PST)
Received: from my-little-tumbleweed (200.143.13.109.rev.sfr.net.
 [109.13.143.200])
 by smtp.gmail.com with ESMTPSA id m7sm346471wma.39.2019.12.09.11.28.00
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 09 Dec 2019 11:28:00 -0800 (PST)
From: =?utf-8?Q?K=C3=A9vin_Le_Gouguec?= <kevin.legouguec@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 27.0.50; [ELPA][PATCH] debbugs: bind to RET rather than return
Date: Mon, 09 Dec 2019 20:27:59 +0100
Message-ID: <87wob5l2o0.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2a00:1450:4864:20::42c
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hello,

debbugs-gnu.el binds debbugs-gnu-select-report and
debbugs-gnu-select-usertag to [return].  Unless I'm mistaken, this
designates only the function key, and terminals do not tell applications
that function keys were pressed.  In the case of [return], they only
send RET, i.e. the C-m character.

Concretely, this means that on a TTY, the return key is not bound to
those functions, as RET is bound to newline.  Pressing return thus leads
to the following error message:

> command-execute: Buffer is read-only: #<buffer *Emacs Bugs*>

(Also, weirdos like me who actually use control+m instead of the return
key are screwed on graphical sessions too.)

On the other hand, if one binds those functions to (kbd "RET") =E2=89=A1 "\=
C-m"
=E2=89=A1 "\r", Emacs automatically translates [return] to RET, and everyth=
ing
Just Works=E2=84=A2.

Suggested patch:


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline; filename=debbugs-RET.patch

diff --git a/packages/debbugs/debbugs-gnu.el b/packages/debbugs/debbugs-gnu.el
index 5789d80db..b9d9083e3 100644
--- a/packages/debbugs/debbugs-gnu.el
+++ b/packages/debbugs/debbugs-gnu.el
@@ -987,7 +987,7 @@ Used instead of `tabulated-list-print-entry'."
   (let ((map (make-sparse-keymap))
 	(menu-map (make-sparse-keymap)))
     (set-keymap-parent map tabulated-list-mode-map)
-    (define-key map [return] #'debbugs-gnu-select-report)
+    (define-key map "\C-m" #'debbugs-gnu-select-report)
     (define-key map [mouse-2] #'debbugs-gnu-select-report)
     (define-key map "A" #'debbugs-gnu-select-current-bugs)
     (define-key map "g" #'debbugs-gnu-rescan)
@@ -2163,7 +2163,7 @@ successfully sent."
 (defvar debbugs-gnu-usertags-mode-map
   (let ((map (make-sparse-keymap)))
     (set-keymap-parent map tabulated-list-mode-map)
-    (define-key map [return] #'debbugs-gnu-select-usertag)
+    (define-key map "\C-m" #'debbugs-gnu-select-usertag)
     (define-key map [mouse-2] #'debbugs-gnu-select-usertag)
     map))
 

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable


(I picked "\C-m" out of all possible spellings because AFAICT it's the
one that comes up most often in the Emacs source tree, but maybe it's
not the best possible one.)

Thank you for your time.


References:

- (emacs) Keymaps

> Most modern  keyboards have function  keys as well  as character
> keys.  Function  keys send input  events just as  character keys
> do, and keymaps can have bindings for them.
>
> =E2=80=A6
>
> On  text terminals,  typing a  function key  actually sends  the
> computer a  sequence of characters;  the precise details  of the
> sequence depends on the function key and on the terminal type.

- (emacs) Named ASCII Chars

> Emacs can distinguish  these two kinds of input  if the keyboard
> does.  It treats the special  keys as function keys named =E2=80=98tab=E2=
=80=99,
> =E2=80=98return=E2=80=99,  =E2=80=98backspace=E2=80=99,  =E2=80=98linefee=
d=E2=80=99,   =E2=80=98escape=E2=80=99,  and  =E2=80=98delete=E2=80=99.
> These   function   keys   translate   automatically   into   the
> corresponding  ASCII characters  _if_ they  have no  bindings of
> their own.
>
> If you  do not want  to distinguish between (for  example) <TAB>
> and  =E2=80=98C-i=E2=80=99,  make just  one  binding,  for the  ASCII  ch=
aracter
> <TAB> (octal code 011).  If you do want to distinguish, make one
> binding for this  ASCII character, and another  for the function
> key =E2=80=98tab=E2=80=99.
>
> With an ordinary ASCII terminal,  there is no way to distinguish
> between <TAB>  and =E2=80=98C-i=E2=80=99  (and likewise  for other  such =
pairs),
> because the terminal sends the same character in both cases.

- a *scratch* buffer:

> (kbd "RET")         ; "^M"
> (kbd "\r")          ; "^M"
> (kbd "C-m")         ; "^M"
> (kbd "<return>")    ; [return]

- on X:

> C-h c =E2=8F=8E ; RET (translated from <return>) runs the command newline

- on a TTY:

> C-h c =E2=8F=8E ; RET runs the command newline


In GNU Emacs 27.0.50 (build 4, x86_64-pc-linux-gnu, GTK+ Version 3.24.12, c=
airo version 1.16.0)
 of 2019-12-09 built on my-little-tumbleweed
Repository revision: 51176ee81e8e773d8b6ac06dd153846abee0c0f4
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12006000
System Description: openSUSE Tumbleweed

Configured using:
 'configure --with-xwidgets --with-cairo'

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY
INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF
ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS JSON
PDUMPER LCMS2 GMP

Important settings:
  value of $LC_CTYPE: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=3Dlocal
  locale-coding-system: utf-8-unix

--=-=-=--




Acknowledgement sent to Kévin Le Gouguec <kevin.legouguec@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#38551; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 9 Dec 2019 20:45:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.