From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Jakub T. Jankiewicz" Newsgroups: gmane.emacs.bugs Subject: bug#67182: 29.1; read-kbd-macro always return a vector Date: Wed, 15 Nov 2023 14:20:55 +0100 Message-ID: <20231115142055.3ab964d9@jcubic> References: <20231115020535.7dd8b316@jcubic> <83fs17rz71.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19630"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 67182@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 15 16:51:29 2023 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 1r3IAq-0004nP-GM for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 Nov 2023 16:51:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3IAV-0000c3-KI; Wed, 15 Nov 2023 10:51:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r3IAS-0000ZY-1L for bug-gnu-emacs@gnu.org; Wed, 15 Nov 2023 10:51:05 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r3IAR-00046j-Ip for bug-gnu-emacs@gnu.org; Wed, 15 Nov 2023 10:51:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r3IAQ-0000yW-KL for bug-gnu-emacs@gnu.org; Wed, 15 Nov 2023 10:51:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Jakub T. Jankiewicz" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Nov 2023 15:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67182 X-GNU-PR-Package: emacs Original-Received: via spool by 67182-submit@debbugs.gnu.org id=B67182.17000634383689 (code B ref 67182); Wed, 15 Nov 2023 15:51:02 +0000 Original-Received: (at 67182) by debbugs.gnu.org; 15 Nov 2023 15:50:38 +0000 Original-Received: from localhost ([127.0.0.1]:52946 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3IA1-0000xR-VC for submit@debbugs.gnu.org; Wed, 15 Nov 2023 10:50:38 -0500 Original-Received: from u1.atthost.pl ([185.255.40.21]:53885) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3I9z-0000xG-Ih for 67182@debbugs.gnu.org; Wed, 15 Nov 2023 10:50:36 -0500 Original-Received: from localhost (unknown [127.0.0.1]) by u1.atthost.pl (Postfix) with ESMTP id 10FD3122B00; Wed, 15 Nov 2023 13:21:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at atthost.pl Original-Received: from u1.atthost.pl ([185.255.40.21]) by localhost (atthost.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dsRXlrItq41F; Wed, 15 Nov 2023 14:20:56 +0100 (CET) Original-Received: from jcubic (unknown [178.218.193.129]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jcubic@jcubic.pl) by u1.atthost.pl (Postfix) with ESMTPSA id 914EF122BC2; Wed, 15 Nov 2023 14:20:56 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 u1.atthost.pl 914EF122BC2 In-Reply-To: X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:274351 Archived-At: Then maybe the documentation for the function should be updated and in changelog there is should a note about this breaking change. On Wed, 15 Nov 2023 07:45:16 -0500 Stefan Monnier wrote: > >> This is the code I was always using in Emacs to send raw keys > >> to modes like ansi-term: > >>=20 > >> (defun raw (str) > >> (interactive "sSend Raw Key: ") > >> (term-send-raw-string (read-kbd-macro str))) > >>=20 > >> But this doesn't work anymore it throw an error [3] when calling: > >>=20 > >> (raw "C-c") =20 >=20 > The above code already threw the same error when you call >=20 > (raw "C-") > or > (raw "M-a") > or > (raw "=C3=A9") >=20 > :-( >=20 > Maybe it should be something like >=20 > (defun raw (str) > (interactive "sSend Raw Key: ") > (let ((keys (kbd str)) > (string (condition-case err > (concat "" keys) > (wrong-type-argument > (let ((elem (nth 2 err))) > (error "%s is not a character" > (if (numberp elem) > (prin1-char elem) > elem))))))) > (term-send-raw-string string))) >=20 > ? >=20 > >> According to documentation `C-h f read-kbd-macro` > >> "The result will be a string if possible" but it seems that in new > >> GNU Emacs it's always a vector. =20 > > Stefan, this is due to your change in edmacro-parse-keys as part of > > commit 87789330, whose log message says nothing about > > edmacro-parse-keys. Did you really intend to make that > > backward-incompatible change? If so, why? =20 >=20 > Yes. I want to eliminate the use of strings that stand for a sequence > of events because it does nothing more than leave latent bugs and create > confusion (between the strings used as input to `read-kbd-macro` and the > strings that used to be output by `read-kbd-macro`), while increasing > the complexity of the rest of the code which has to handle both vectors > and strings. >=20 >=20 > Stefan >=20 -- Jakub T. Jankiewicz, Senior Front-End Developer https://jcubic.pl/me https://koduj.org