From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#59305: 29.0.50; keymap-global-set handling of string bindings different from global-set-key Date: Mon, 06 May 2024 16:34:18 +0200 Message-ID: <87jzk7ko0l.fsf@gmail.com> References: <87edu3cml8.fsf@gmail.com> <87zft3l0k9.fsf@gmail.com> 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="5922"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , 59305@debbugs.gnu.org, Eli Zaretskii , Stefan Kangas To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 06 16:34:58 2024 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 1s3zQf-0001E9-Ha for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 May 2024 16:34:57 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s3zQO-0006lu-RY; Mon, 06 May 2024 10:34:40 -0400 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 1s3zQM-0006ig-8Z for bug-gnu-emacs@gnu.org; Mon, 06 May 2024 10:34:38 -0400 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 1s3zQM-0001sW-13 for bug-gnu-emacs@gnu.org; Mon, 06 May 2024 10:34:38 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s3zQj-0005R6-Kh for bug-gnu-emacs@gnu.org; Mon, 06 May 2024 10:35:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 May 2024 14:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59305 X-GNU-PR-Package: emacs Original-Received: via spool by 59305-submit@debbugs.gnu.org id=B59305.171500609620883 (code B ref 59305); Mon, 06 May 2024 14:35:01 +0000 Original-Received: (at 59305) by debbugs.gnu.org; 6 May 2024 14:34:56 +0000 Original-Received: from localhost ([127.0.0.1]:38404 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3zQe-0005Ql-4U for submit@debbugs.gnu.org; Mon, 06 May 2024 10:34:56 -0400 Original-Received: from mail-qt1-x82d.google.com ([2607:f8b0:4864:20::82d]:42445) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3zQZ-0005Qf-8h for 59305@debbugs.gnu.org; Mon, 06 May 2024 10:34:54 -0400 Original-Received: by mail-qt1-x82d.google.com with SMTP id d75a77b69052e-43ab76cac73so19352971cf.1 for <59305@debbugs.gnu.org>; Mon, 06 May 2024 07:34:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715006061; x=1715610861; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=xECkq3PTe/BIxIANBqpdRkunWwfhVHPzX8D4r0xxdnU=; b=VtMwviMLpp3CN5W4Q5xJ+JVZGt/xO+J9gtCMqz16gp8nLW+FTKvn9g3lnFMhcS1ZsR ePtfW6abZwwO/PFUeS3MlfchOrZjsVMPFSifbWQ+6IGRw1LHB3tQg6e0QaUdzhsZvla0 41oUdTMYClBBgllz9/C8odhKqbmaEJSL63FY6gVcdiBzmI1YTe1Wnza6cUnKEVR0zoPJ 7xK5rYOyUo6BHMMfizhGZo8/gGJajWU+L2IU8M9OWkrtueyRBi5hh3qFi0pygxcv8whO SDAslTfjxBD68SHmf4RcYyDnNQV+UOO7hwJMNOEsQhPaZLF+puUSgB3ywSS3NO/CNmnf ZYuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715006061; x=1715610861; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xECkq3PTe/BIxIANBqpdRkunWwfhVHPzX8D4r0xxdnU=; b=wVn95ouGgsb9RUoXwOnAiZ1vFuRJAfexRCRrEeItn9K795EgbPpX6JMR5tNiYsXc53 EmbCg6XapjU0yMcH1yQoFb/Dww9vGXDObFJCMHjqaUH4SMuaFxlptklDz3jjbXTB5UWW DcrItVr0mgS2/8c45CSRW8XJrju+feN6fj0GBHjO+AZ68nXAWYyQjidTaQuljELBJwP4 7O2tav1Qvz7uqSjiofCUb3IRF7MaSBPRT4SNwHstJbcBJZLZWeIKAqgY3YQBBliCBvx6 f8Juug43oznf6UXeLBWpwrOg1XEuV4XQheOV+TvDh2u/fmLBUyy32TK6LIAD555kIY9P OqZg== X-Forwarded-Encrypted: i=1; AJvYcCWfFB1rUq2SwROgBKVt2/l+E/O3UMiNvn3DIcw8kfqX4jlUJvVWUc//No/nMrftDCkqkrDUbZ5tYLv0u9ryyLs27+mmI8k= X-Gm-Message-State: AOJu0Yx65IwDEVEu27ERImsc2DOk4/VhWEyNPjZRBsYrjVH356RXp7Io bs71j9s7A+P2ahqkrMQrJrfm3itM/qOUsW95kTTYHGojxiexsjMg X-Google-Smtp-Source: AGHT+IHcXF6J2F5ck4/gPGrAGGhtV0TOXMGdXhOgR4+4MMfZMnjGDp8I9D2NtE1VbeN7a5iUaxezQw== X-Received: by 2002:a05:622a:4b06:b0:43a:6055:5547 with SMTP id et6-20020a05622a4b0600b0043a60555547mr23942717qtb.23.1715006061131; Mon, 06 May 2024 07:34:21 -0700 (PDT) Original-Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id ev12-20020a05622a510c00b00437794a29aesm5185783qtb.71.2024.05.06.07.34.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 07:34:20 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Mon, 06 May 2024 09:24:56 -0400") 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:284582 Archived-At: >>>>> On Mon, 06 May 2024 09:24:56 -0400, Stefan Monnier said: Stefan> `key-parse` always returns a vector. >> You want us to recommend this? >> (keymap-global-set "C-a" (key-parse "hello")) Stefan> Sorry, I was not thinking right. The function you'd need to us= e to Stefan> convert "hello" into the proper form for `keymap-global-set` is= either: Stefan> - `key-description`: does the "reverse" of `kbd` and `key-parse= `. Stefan> - `kmacro--to-vector`: turns an old-style string of events to a= vector Stefan> of events. `key-description' does the wrong thing with multibyte strings: (key-description "ol=C3=A1") =3D> "o l M-a" `kmacro--to-vector' does the right thing: (kmacro--to-vector "hello") =3D> [104 101 108 108 111] (kmacro--to-vector "ol=C3=A1") =3D> [111 108 225] We could invent 'YetAnotherName'=E2=84=A2 or we could just use `kmacro' (kmacro "hello") =3D> #[256 "\301\242\302%1b=1C\305\300%2\306#\210\301 \240= *\207" [[104 101 108 108 111] (0) "%d" kmacro-counter-format-start kmacro-c= ounter execute-kbd-macro kmacro-loop-setup-function] 5 kmacro] (kmacro "ol=C3=A1") =3D> #[256 "\301\242\302%1b=1C\305\300%2\306#\210\301 \= 240*\207" [[111 108 225] (0) "%d" kmacro-counter-format-start kmacro-counte= r execute-kbd-macro kmacro-loop-setup-function] 5 kmacro] although that *also* has the caveat about `key-valid-p' That=CA=BCs the thing about Emacs: so many options to choose from :-) >> so I=CA=BCd still worry about future regressions caused by `key-pars= e' >> being changed to enforce `key-valid-p' Stefan> Indeed. Not only that, but it'll mis-interpret `C-a` to mean a= single Stefan> event instead of 3 events. Right. Robert --=20