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: Fri, 25 Nov 2022 09:01:59 +0100 Message-ID: <874junfonc.fsf@gmail.com> References: <87edu3cml8.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="28701"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , 59305@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 25 09:03:11 2022 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 1oyTfy-0007Mw-Vs for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 25 Nov 2022 09:03:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oyTft-0001Wz-5i; Fri, 25 Nov 2022 03:03:05 -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 1oyTfq-0001SI-Oo for bug-gnu-emacs@gnu.org; Fri, 25 Nov 2022 03:03:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oyTfq-0004DS-Fn for bug-gnu-emacs@gnu.org; Fri, 25 Nov 2022 03:03:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oyTfp-0004um-Us for bug-gnu-emacs@gnu.org; Fri, 25 Nov 2022 03:03:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Nov 2022 08:03: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.166936332918834 (code B ref 59305); Fri, 25 Nov 2022 08:03:01 +0000 Original-Received: (at 59305) by debbugs.gnu.org; 25 Nov 2022 08:02:09 +0000 Original-Received: from localhost ([127.0.0.1]:33368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oyTez-0004th-GQ for submit@debbugs.gnu.org; Fri, 25 Nov 2022 03:02:09 -0500 Original-Received: from mail-wr1-f54.google.com ([209.85.221.54]:40688) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oyTex-0004tR-7N for 59305@debbugs.gnu.org; Fri, 25 Nov 2022 03:02:07 -0500 Original-Received: by mail-wr1-f54.google.com with SMTP id x5so5571953wrt.7 for <59305@debbugs.gnu.org>; Fri, 25 Nov 2022 00:02:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=VlpSCyI+kmpbjGHKN4mZbQmizEWlfZDMM+CGRnULq3I=; b=FI5F2NDusoh/j+B/IDa5LVvxAvfIM90k8bQLdedLkvXwuqWSX5gCO5VfF/+7CaTZs+ 7DFcCBYeWKpr9grC5wTw2NnpR1ntpo+nYsXb70o6aqD7RU1eHhRJj9rv1/06A4vGQgty RGNUmhY5WdgwN4IXkJ6I1VoiJ0oh5+zzuaPyG7mtjPHrtEztIghmfIHdP9UV1fqiyR7/ Y+lvf7TjDYeeCIB3w32pSaXEOJKzXa9k81JAwXOfLqG9EgW1YR6VLoyI/wCjqNdnxgBb HucBa5QTsUzbR1y5Zgj0VNwDTibfMi0f4BJWlXngYv5Vld+YMO5TNn7Pd+4zS0n6lZf3 8XNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=VlpSCyI+kmpbjGHKN4mZbQmizEWlfZDMM+CGRnULq3I=; b=ybU9wNe1Ke9b5w+0sN/q78wMOI4lC2lZRu0ED/xrF/L5MnbINaSfxlbPGNwgYlXtlh U5FUrfg38QsBHeExQKoUmZSci4ulMr0SFddUP9fyXDkf5PSugZvzpYS5Bckl3MYu42jC 1XbJxuSyHoYS9tLtkBfOBjuuPsKaP+9yJ+qoarqoU93OGl97k8Xbj/VWsT87nd/j0MVU n6WyF5aL5SlEM29Qn2Yjd3CCAZnXqE5K8k+D2k07LnblQLNahEq3WMGF2D1lDsRBBnv0 XNIx3j1UKbRUpAP7W5RF4aSxByKq8/iHDlo4/0NAX9UO+0yaUsbnl5mSnZc1tYciE6q5 XrNA== X-Gm-Message-State: ANoB5pmJ9k45cnbPLz03N1FNB3tqqpFqfPSw/Uy6tyioAiGAEVwrLY/K 2OEeCiQJaQvTDUTE6GOaJhE= X-Google-Smtp-Source: AA0mqf61AfNScu3adWPAKTbAeS5weTypYudC8TiwemkLW3Ya4cSMg4Zvxd71O0qOIrYHx6piYq/mkQ== X-Received: by 2002:a5d:5507:0:b0:236:8a6d:eaeb with SMTP id b7-20020a5d5507000000b002368a6deaebmr22162157wrv.208.1669363321277; Fri, 25 Nov 2022 00:02:01 -0800 (PST) Original-Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id n11-20020adfe78b000000b0023677fd2657sm3231942wrm.52.2022.11.25.00.02.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Nov 2022 00:02:00 -0800 (PST) In-Reply-To: (Stefan Kangas's message of "Thu, 24 Nov 2022 16:14:05 -0800") 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:248970 Archived-At: >>>>> On Thu, 24 Nov 2022 16:14:05 -0800, Stefan Kangas said: Stefan> Robert Pluim writes: >> After reading up on `key-valid-p': >>=20 >> 5. (keymap-global-set "C-c h" "h e l l o") =3D> success! >>=20 >> or alternatively >>=20 >> 6. (keymap-global-set "C-c h" [?h ?e ?l ?l ?o]) =3D> success! >>=20 >> Whilst not strictly a regression, this behaviour is confusing and >> unhelpful, and the solution is not easily found. I can think of two >> solutions: >>=20 >> 1. Change `kbd' to always return a vector even if the input is >> ascii-only, which makes [4] work >> 2. Change `keymap-set' to convert ascii-only strings to the format in >> [5] or [6]. Probably just a call to `string-to-vector' is enough. Stefan> I feel like the second alternative goes against the design of Stefan> `keymap-global-set', where the idea explicitly was to only supp= ort a KEY Stefan> argument that is `key-valid-p'. It was? If so, then it should not have been touted as the replacement for `global-set-key' everywhere without a big warning sign. Stefan> Could we perhaps introduce a new optional argument to treat the= argument Stefan> as a literal string? Or if really want it to not be `key-valid= -p', to Stefan> at least require it to be something like '(literal "foo") ? (string-to-vector "foo") will do. But that just highlights the problem even more: if it=CA=BCs that simple, why can=CA=BCt `keymap-global-set' do = that internally instead of forcing users to jump through hoops? Robert --=20