From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#67182: 29.1; read-kbd-macro always return a vector Date: Wed, 15 Nov 2023 07:45:16 -0500 Message-ID: References: <20231115020535.7dd8b316@jcubic> <83fs17rz71.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35091"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: "Jakub T. Jankiewicz" , 67182@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 15 17:23:22 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 1r3Ifh-0008ti-SJ for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 15 Nov 2023 17:23:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r3IfU-0000Nu-P9; Wed, 15 Nov 2023 11:23:08 -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 1r3IfQ-0000M5-MS for bug-gnu-emacs@gnu.org; Wed, 15 Nov 2023 11:23:06 -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 1r3IfO-00080s-Um for bug-gnu-emacs@gnu.org; Wed, 15 Nov 2023 11:23:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r3IfN-0001wa-RX for bug-gnu-emacs@gnu.org; Wed, 15 Nov 2023 11:23:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Nov 2023 16:23:01 +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.17000653467413 (code B ref 67182); Wed, 15 Nov 2023 16:23:01 +0000 Original-Received: (at 67182) by debbugs.gnu.org; 15 Nov 2023 16:22:26 +0000 Original-Received: from localhost ([127.0.0.1]:53098 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3Ien-0001vV-Qp for submit@debbugs.gnu.org; Wed, 15 Nov 2023 11:22:26 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:19222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r3Iek-0001vE-LU for 67182@debbugs.gnu.org; Wed, 15 Nov 2023 11:22:24 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 4569A100068; Wed, 15 Nov 2023 07:45:17 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1700052316; bh=sSGLdpX5ZHS9j8DQB8FLiynLKtFZozwM3kaYwHqjG0A=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=nO27AZ4FxehDWaATheIAwfLqNKey5YQ74pQuGnhGVV/QZrUsLI5apQ5+uwesfUy4F p8yxuk5UU+dmf1+YxDE+p6+tHNi+wqWFBj6H5rQk/rV5VqP32zhYc5eGmUDKv5g01Q zK2tGQT1Y6ewQdst/yiYa/W+/8LXnvyvkiwoFKjqrzGhOFKzlU3abElBIv+N8gZUHa 8liKHqdAmylhM1O1G5Y2EClNlyldbt5hJB3zhftYs5jGrQnS2NJOwfQ0nrfir0+02k kid1GR89yL9izzQa3YnYkD+ZOWPTpmwaW9j9sHzRsXnT2XlIu0axIthRVp9jMHT1v5 cNarPP/rz1Idw== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 8DD6F100033; Wed, 15 Nov 2023 07:45:16 -0500 (EST) Original-Received: from pastel (unknown [45.72.227.120]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 62C271202EA; Wed, 15 Nov 2023 07:45:16 -0500 (EST) In-Reply-To: <83fs17rz71.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 15 Nov 2023 14:14:10 +0200") 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:274369 Archived-At: >> 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") The above code already threw the same error when you call (raw "C-") or (raw "M-a") or (raw "=E9") :-( Maybe it should be something like (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))) ? >> 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. > 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? 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. Stefan