From unknown Mon Jun 16 23:56:21 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#78714 <78714@debbugs.gnu.org> To: bug#78714 <78714@debbugs.gnu.org> Subject: Status: 30.1; failure binding keys to certain unicode characters Reply-To: bug#78714 <78714@debbugs.gnu.org> Date: Tue, 17 Jun 2025 06:56:21 +0000 retitle 78714 30.1; failure binding keys to certain unicode characters reassign 78714 emacs submitter 78714 John Holman severity 78714 normal tag 78714 fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 07 07:47:30 2025 Received: (at submit) by debbugs.gnu.org; 7 Jun 2025 11:47:30 +0000 Received: from localhost ([127.0.0.1]:47166 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uNs1J-00049G-Id for submit@debbugs.gnu.org; Sat, 07 Jun 2025 07:47:30 -0400 Received: from lists.gnu.org ([2001:470:142::17]:54402) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uNs1G-00048y-2B for submit@debbugs.gnu.org; Sat, 07 Jun 2025 07:47:27 -0400 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 1uNs15-0003ON-Be for bug-gnu-emacs@gnu.org; Sat, 07 Jun 2025 07:47:15 -0400 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uNs12-00076g-HD for bug-gnu-emacs@gnu.org; Sat, 07 Jun 2025 07:47:14 -0400 Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-32a72e61a3fso41227701fa.0 for ; Sat, 07 Jun 2025 04:47:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749296829; x=1749901629; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=qhsFWc5G8hKGIhYdpCK6OzKMQncL6cyqe5j8NM+clxg=; b=gda/hfgA7bjqcRwPp8UTPtI9M/VohO4K/8Wve6kXmVPmM7o9veUiBaXb6dIsUFvvQE pUol7ZW6jfNku8C3ZNUwgjMWB+8hFKziYtbYhuC8Y+4I1zxVuv1824CpdMJKYWyPFxsK y1uFr8I5Dtf2IA6uqHjQ93SHcEFZi+N3PEdW+jJpTb07OZ3B2sz6PoWMLIeflCmaGb51 BqnFfBwqj5pnBPTtesLS7Vnk3+tw9x8JfbQ+Frp9TwlO+ekBlTmKUjnFG51md9b1UCNS jhMKYXyQUmyrEbBbYKgOoqkBcaPB0kbQgwSvTZQsnqJEDTn1IBFvgLrfq6qjmPi0vxQ9 h3ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749296829; x=1749901629; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=qhsFWc5G8hKGIhYdpCK6OzKMQncL6cyqe5j8NM+clxg=; b=GkzKrPogzsoZKCT3/sPZ7878oD6Xdg1NlNTrJGOz6oMlEiwdHip3Q66BHXJ9QZZJrv RFJ0XeouGN9tznr+dz7kgwhZ7Qkm4jDwA1yTkOjQbBNPG6d7UzYIpLCclCSnm8AMhVLf 5OvbxLpSbhCuqn8g1L01AyPFWLjQYHAqbz3vbAi/nzUlScvzlZtOvsDDveIPpH/EjnSJ UR68LM0txlQWPLCWzL2ezsIPMMHg+pGF61Oq6wlBzy7D/TDX8YOC2/4prF0nxlWa0WXt GyEob3g7Dd2xWbvCq7aB/r7jfTRMrQl0kqTkApktamlomPm0ZzjV+NlunehYqPvziKgD Udzw== X-Gm-Message-State: AOJu0YzRmZlIOTvP1Rc9EyB7aY+aiDXZADt8e/43emRAJ+pOLy3U+04/ Ls9wCr2lsYkO1Bcpw0nYm41wfET+Fn+TorFOASb49SibokcEgO9s3RthdB3JG34Z/pTXcEu1dxn z+nZRqSU9hGoyDFWsrjeU22gUAMrCg2pfoSUo X-Gm-Gg: ASbGncspXPcLYdnVErQXBrriL7oteDvZUi8i9ibtOOdVVkPMv3Ev9AGDmurPBqVlLCa AIwntEFN2jdPOXNaq4uC0bKRdJ8areRllWP3VESPSG6I2gxfOeFaSVnKb/aBYmSxne7HlHrnrr+ 3wbVz4/iCIEXlHD1wpMGstMHhYH2pM5lp9tw7TnyL+z1zy X-Google-Smtp-Source: AGHT+IHEqt0xEswFzrqRCGKvqz9aB52MKGYLEEBM39XgR56ei9C2gmnmTrvVGbNXIUKTTROlgCYno5sBNr16tZgM4Do= X-Received: by 2002:a05:651c:1543:b0:329:1712:c38d with SMTP id 38308e7fff4ca-32ad11a9b45mr33261891fa.5.1749296828823; Sat, 07 Jun 2025 04:47:08 -0700 (PDT) MIME-Version: 1.0 From: John Holman Date: Sat, 7 Jun 2025 12:46:56 +0100 X-Gm-Features: AX0GCFtOO2vxd_zoSixkVpkQlIEHcJfOw2TOwhw_fcvA-IUO4rdAShos2dDFqOQ Message-ID: Subject: 30.1; failure binding keys to certain unicode characters To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="00000000000016be420636f9e892" Received-SPF: pass client-ip=2a00:1450:4864:20::22a; envelope-from=john.g.holman@gmail.com; helo=mail-lj1-x22a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --00000000000016be420636f9e892 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable --text follows this line-- Attempting to bind unicode characters (e.g. \u111E) to keys in a minor mode with syntax like (define-key my-test-mode-map (kbd "c") "\u221E") usually works. In this case, C-h k c shows c runs the command # (found in my-test-mode-map), which is a keyboard macro. It is bound to c. Macro: M-\20636 Keyboard macro. However the same syntax fails for some characters (so far I've noticed this for \u00B0 to \u00B6 but there will be more) e.g after (define-key my-test-mode-map (kbd "a") "\u00B2") C-h k shows a runs the command # (found in my-test-mode-map), which is a keyboard macro. It is bound to a. Macro: M-2 Keyboard macro. and the effect of pressing "a" is to invoke command-digit-argument rather than insert the required character A workaround is to use a lambda expression to bypass whatever emacs is doing when processing the unicode character, e.g. (define-key my-test-mode-map (kbd "b") (lambda () (interactive) (insert "\u00B2"))) and then this does insert the character (superscript 2) when "b" is pressed= . To replicate: 1. run emacs -Q 2. paste the following into the scratch buffer: ;; This buffer is for text that is not saved, and for Lisp evaluation. ;; To create a file, visit it with =E2=80=98C-x C-f=E2=80=99 and enter text= in its buffer. (progn ;; 1. Explicitly create the keymap variable and initialize it. (defvar my-test-mode-map (make-sparse-keymap) "Keymap for `my-test-mode'.") ;; 2. Define the minor mode, telling it to use our explicitly created map= . (define-minor-mode my-test-mode "A test minor mode." :global t :lighter " my-test" :keymap my-test-mode-map ) ;; 3. Define keys on the explicitly created and linked map. ;; normal bind fails at least for characters in range \u00B0 to \u00B6, but probably more, e.g. \u00B2 (define-key my-test-mode-map (kbd "a") "\u00B2") ;; workaround is to use a lambda (define-key my-test-mode-map (kbd "b") (lambda () (interactive) (insert "\u00B2"))) ; normal bind does succeeds with other characters I've tried so far, e.g. \u221E (define-key my-test-mode-map (kbd "c") "\u221E") ;; 4. Enable the minor mode. (my-test-mode 1) ) =3D=3D=3D This creates a new mode "my-test-mode" with the key maps and puts it into effect. Then try pressing a, b and c. (acknowledgements to assistance from gemini 2.5 on all this!) In GNU Emacs 30.1 (build 2, x86_64-w64-mingw32) of 2025-02-23 built on AVALON Windowing system distributor 'Microsoft Corp.', version 10.0.26100 System Description: Microsoft Windows 10 Pro (v10.0.2009.26100.4061) Configured using: 'configure --with-modules --without-dbus --with-native-compilation=3Daot --without-compress-install --with-tree-sitter CFLAGS=3D-O2 prefix=3D/g/rel/install/emacs-30.1' Configured features: ACL GIF GMP GNUTLS HARFBUZZ JPEG LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XPM ZLIB (NATIVE_COMP present but libgccjit not available) Important settings: value of $LANG: ENG locale-coding-system: cp1252 Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t minibuffer-regexp-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils time-date subr-x cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel touch-screen dos-w32 ls-lisp disp-table term/w32-win w32-win w32-vars term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads w32notify w32 lcms2 multi-tty move-toolbar make-network-process native-compile emacs) Memory information: ((conses 16 51324 17148) (symbols 48 5411 0) (strings 32 15047 1817) (string-bytes 1 418055) (vectors 16 8994) (vector-slots 8 128954 11248) (floats 8 24 21) (intervals 56 313 5) (buffers 992 10)) --00000000000016be420636f9e892 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
--text follows this line--

Attempting to bind unico= de characters (e.g. \u111E) to keys in a minor mode with syntax like
=C2= =A0 (define-key my-test-mode-map (kbd "c") "\u221E")usually works. In this case, C-h k c shows

c runs the command #<= string CB7> (found in my-test-mode-map), which is
a keyboard macro.It is bound to c.
Macro: M-\20636
Keyboard macro.

However th= e same syntax fails for some characters (so far I've noticed this for \= u00B0 to \u00B6 but there will be more) e.g
after (define-key my-test-mo= de-map (kbd "a") "\u00B2") C-h k shows

a runs th= e command #<string B6B> (found in my-test-mode-map), which is
a ke= yboard macro.
It is bound to a.
Macro: M-2
Keyboard macro.

= and the effect of pressing "a" is to invoke command-digit-argumen= t rather than insert the required character

A workaround is to use a= lambda expression to bypass whatever emacs is doing when processing the un= icode character, e.g.
=C2=A0 (define-key my-test-mode-map (kbd "b&q= uot;) (lambda () (interactive) (insert "\u00B2")))

and the= n this does insert the character (superscript 2) when "b" is pres= sed.

To replicate:

1. run emacs -Q

2. paste the follow= ing into the scratch buffer:

;; This buffer is for text that is not = saved, and for Lisp evaluation.
;; To create a file, visit it with =E2= =80=98C-x C-f=E2=80=99 and enter text in its buffer.

(progn
=C2= =A0 ;; 1. Explicitly create the keymap variable and initialize it.
=C2= =A0 (defvar my-test-mode-map (make-sparse-keymap)
=C2=A0 =C2=A0 "Ke= ymap for `my-test-mode'.")

=C2=A0 ;; 2. Define the minor mo= de, telling it to use our explicitly created map.
=C2=A0 (define-minor-m= ode my-test-mode
=C2=A0 =C2=A0 "A test minor mode."
=C2=A0 = =C2=A0 :global t
=C2=A0 =C2=A0 :lighter " my-test"
=C2=A0 = =C2=A0 :keymap my-test-mode-map
=C2=A0 =C2=A0 )

=C2=A0 ;; 3. Defi= ne keys on the explicitly created and linked map.

;; normal bind fai= ls at least for characters in range \u00B0 to \u00B6, but probably more, e.= g. \u00B2
=C2=A0 (define-key my-test-mode-map (kbd "a") "= \u00B2")

=C2=A0 ;; workaround is to use a lambda
=C2=A0 (def= ine-key my-test-mode-map (kbd "b") (lambda () (interactive) (inse= rt "\u00B2")))

; normal bind does succeeds with other char= acters I've tried so far, e.g. \u221E
=C2=A0 (define-key my-test-mod= e-map (kbd "c") "\u221E")

=C2=A0 ;; 4. Enable th= e minor mode.
=C2=A0 (my-test-mode 1)
=C2=A0 )
=C2=A0
=3D=3D=3D=

This creates a new mode "my-test-mode" with the key maps = and puts it into effect. Then try pressing a, b and c.

(acknowl= edgements to assistance from gemini 2.5 on all this!)


In GNU Ema= cs 30.1 (build 2, x86_64-w64-mingw32) of 2025-02-23 built on
=C2=A0AVALO= N
Windowing system distributor 'Microsoft Corp.', version 10.0.2= 6100
System Description: Microsoft Windows 10 Pro (v10.0.2009.26100.4061= )

Configured using:
=C2=A0'configure --with-modules --without= -dbus --with-native-compilation=3Daot
=C2=A0--without-compress-install -= -with-tree-sitter CFLAGS=3D-O2
=C2=A0prefix=3D/g/rel/install/emacs-30.1&= #39;

Configured features:
ACL GIF GMP GNUTLS HARFBUZZ JPEG LCMS2 = LIBXML2 MODULES NATIVE_COMP
NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND SQLI= TE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XPM ZLIB

(N= ATIVE_COMP present but libgccjit not available)

Important settings:<= br>=C2=A0 value of $LANG: ENG
=C2=A0 locale-coding-system: cp1252
Major mode: Lisp Interaction

Minor modes in effect:
=C2=A0 toolt= ip-mode: t
=C2=A0 global-eldoc-mode: t
=C2=A0 eldoc-mode: t
=C2=A0= show-paren-mode: t
=C2=A0 electric-indent-mode: t
=C2=A0 mouse-wheel= -mode: t
=C2=A0 tool-bar-mode: t
=C2=A0 menu-bar-mode: t
=C2=A0 fi= le-name-shadow-mode: t
=C2=A0 global-font-lock-mode: t
=C2=A0 font-lo= ck-mode: t
=C2=A0 blink-cursor-mode: t
=C2=A0 minibuffer-regexp-mode:= t
=C2=A0 line-number-mode: t
=C2=A0 indent-tabs-mode: t
=C2=A0 tr= ansient-mark-mode: t
=C2=A0 auto-composition-mode: t
=C2=A0 auto-encr= yption-mode: t
=C2=A0 auto-compression-mode: t

Load-path shadows:=
None found.

Features:
(shadow sort mail-extr emacsbug message= mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec passwor= d-cache epa derived epg rfc6068
epg-config gnus-util text-property-searc= h mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils = mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-u= tils time-date subr-x
cl-loaddefs cl-lib rmc iso-transl tooltip cconv el= doc paren electric
uniquify ediff-hook vc-hooks lisp-float-type elisp-mo= de mwheel
touch-screen dos-w32 ls-lisp disp-table term/w32-win w32-win w= 32-vars
term/common-win tool-bar dnd fontset image regexp-opt fringe
= tabulated-list replace newcomment text-mode lisp-mode prog-mode registerpage tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-= bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame mini= buffer nadvice seq simple cl-generic indonesian philippine
cham georgian= utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japane= se eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic= indian cyrillic chinese composite emoji-zwj charscript
charprop case-ta= ble epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded but= ton loaddefs theme-loaddefs faces cus-face macroexp
files window text-pr= operties overlay sha1 md5 base64 format env
code-pages mule custom widge= t keymap hashtable-print-readable backquote
threads w32notify w32 lcms2 = multi-tty move-toolbar make-network-process
native-compile emacs)
Memory information:
((conses 16 51324 17148) (symbols 48 5411 0) (strin= gs 32 15047 1817)
=C2=A0(string-bytes 1 418055) (vectors 16 8994)
=C2= =A0(vector-slots 8 128954 11248) (floats 8 24 21) (intervals 56 313 5)
= =C2=A0(buffers 992 10))
--00000000000016be420636f9e892-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 07 08:06:08 2025 Received: (at 78714) by debbugs.gnu.org; 7 Jun 2025 12:06:08 +0000 Received: from localhost ([127.0.0.1]:47200 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uNsJL-00052F-3n for submit@debbugs.gnu.org; Sat, 07 Jun 2025 08:06:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47748) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uNsJG-00051i-Hp for 78714@debbugs.gnu.org; Sat, 07 Jun 2025 08:06:05 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uNsJB-0000gJ-0j; Sat, 07 Jun 2025 08:05:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=NLr5jcTu5DMvEwP4FptLsrKGJ2/UVN95uWb9xCx7wWs=; b=HpuNdee3DSMo 1DBYu/eQGXVf7M4qQvY5bedyeOuDzL83WvK0TyBDBpkqkcWKxxr2Vg0SuZj3in0xLhLQkd9WV0D7q VsWdZCHRPqDkmYTD7ljFhvwsCUG1T5th7YebN1wV7YU79MQ9svkh/W05JfaPvjh+0LEZUDX1bqzZq PD4CAK+hY4EYH52PESZIAPT2HkXmUwYcnjaM4882z1kRrIaNm0V40x0i3sG0s1kNO1eZBBxtO4x5l T/osBPmAZFlfwLlwAVZxG0hl/mq8kIrdR1AT8BZEYs8RRLuuOmkj2qnmFJDmgZdfmhlD5u7XVEDTj cS7H1H7MiueaxbKGmTs10g==; Date: Sat, 07 Jun 2025 15:05:55 +0300 Message-Id: <86y0u3hi3g.fsf@gnu.org> From: Eli Zaretskii To: John Holman In-Reply-To: (message from John Holman on Sat, 7 Jun 2025 12:46:56 +0100) Subject: Re: bug#78714: 30.1; failure binding keys to certain unicode characters References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78714 Cc: 78714@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: John Holman > Date: Sat, 7 Jun 2025 12:46:56 +0100 > > Attempting to bind unicode characters (e.g. \u111E) to keys in a minor mode with syntax like > (define-key my-test-mode-map (kbd "c") "\u221E") > usually works. In this case, C-h k c shows > > c runs the command # (found in my-test-mode-map), which is > a keyboard macro. > It is bound to c. > Macro: M-\20636 > Keyboard macro. > > However the same syntax fails for some characters (so far I've noticed this for \u00B0 to \u00B6 but there > will be more) e.g > after (define-key my-test-mode-map (kbd "a") "\u00B2") C-h k shows > > a runs the command # (found in my-test-mode-map), which is > a keyboard macro. > It is bound to a. > Macro: M-2 > Keyboard macro. > > and the effect of pressing "a" is to invoke command-digit-argument rather than insert the required character It's a feature: #xB2 is #x32 with the high bit set, and the Meta bit sets that bit. See current-input-mode. From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 07 08:43:02 2025 Received: (at 78714) by debbugs.gnu.org; 7 Jun 2025 12:43:02 +0000 Received: from localhost ([127.0.0.1]:47257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uNst3-0006pJ-R8 for submit@debbugs.gnu.org; Sat, 07 Jun 2025 08:43:02 -0400 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]:43396) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uNst2-0006oi-0R for 78714@debbugs.gnu.org; Sat, 07 Jun 2025 08:43:00 -0400 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-32a64f8480eso38554641fa.1 for <78714@debbugs.gnu.org>; Sat, 07 Jun 2025 05:42:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749300173; x=1749904973; darn=debbugs.gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=IV+EEqD8Rusv8Qm++TKO1t1/8BxzZzPVJgtRaGMtCRs=; b=UuqyvyzqxlrLl4IedlOs82bsMWHdV2bY/Kw8eekCwJMMBqORU8SLFFUq0zNm7P335K wrzgfLfE+8+yq6NOiuM8kS0nm5bD1go+USnD4/I+6AtyVLSWTqfpj2eaL/bHZGqqMvhK HQxQVvUd18SdltKBplQ3ugWQvm73LItaJn4pc4QL+nkii6WU2Hy/svCyn7ZbXJNXL9M0 Q+3DxaPTQaRvhlKDC63vr/GxVuw1NXUriKR8xxPAfApdrK4G9I6d/JJXfFCNk8JQh3Wr MvJJGDjLAIUnK60CkCxkO2x1oxgVAC3TWMHcZB5xhpF6l7vTuXlQ45/mm3oOAqcRhS2+ AzpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749300173; x=1749904973; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=IV+EEqD8Rusv8Qm++TKO1t1/8BxzZzPVJgtRaGMtCRs=; b=Af9S0ftIkK60czuaWUxZ5EvPEroNJsrUe/fs8R+wsbkxOCX/pX4b5lT/v1zgU0UEjK bav0+CsAyygtetrXiqyH2Kix2T8npdkVZYmQIMc84UQH0ElYyZUHOvGjHa0q7MpeV09A mHhQHJGZHY7QLtGmRXbSXBkwqejwNntQzpLw1nqgEtVvsxwrLiXXKp3jlYq01yEjWHsO xwLyuw3vcK/sbruivcv7t6uWHWireUHhQykFVCcaGaeqtAE4+dJ1NfYBZ4zuj6NWtMkc NFjKOAF4VYhZgPv17fMEpHeBgT7DN9k8+ER65qtioQfD6ImgnfPKU7OpXHi7bHKnkJee wO1w== X-Gm-Message-State: AOJu0YyQUGBSxvlOhKF3cwasNc7Y8P6wjU5Po/pLQszbimiImmpnqlZo foiyJ0LNFO1TC1lnVDQKsnk2Y7YTVs4WDsHzu/XSqF2+abN88g0TVf2QQMc2PpSaFWaE/TEhNmM 88ppxVnXEzSzX8CktmQzs/mRhhTywM2u7LVmn X-Gm-Gg: ASbGnct7QAG5kh72o2xvuVTDaoh1Hd4gj8b7QfA/GU1oO1EEKt6u+D0wzxeArLn3dcp +5XqXguutBDq2g942zmW0QUUZkETalT9B4XCmaKgy4fdMHSXaMq+0Xdkiy3dX0k77uKtO7/VzMv hlMGU8O+uc7iLWlB7UePgnRNj4S+5T4bJ4LQ== X-Google-Smtp-Source: AGHT+IFX9aw/Vmclqbn0cfCyb0xByKicDoeYN/QuvykgFeFxmzdkxp+hVakIbbQNlVNlCTA/x4ZYpdQE5st+g0X2PdA= X-Received: by 2002:a05:651c:199f:b0:309:20da:6188 with SMTP id 38308e7fff4ca-32ae00472c4mr20221201fa.6.1749300172268; Sat, 07 Jun 2025 05:42:52 -0700 (PDT) MIME-Version: 1.0 From: John Holman Date: Sat, 7 Jun 2025 13:42:39 +0100 X-Gm-Features: AX0GCFs4SOA7po0c01517u60F15g6LRvE_lkzTZkVfNPn-Bxlq2-6oK3W8eCtn4 Message-ID: Subject: To: 78714@debbugs.gnu.org Content-Type: multipart/alternative; boundary="0000000000005fabbc0636faafdb" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Many thanks for the fast response. I do think that's a surprising feature and that most users would expect "\u00B2" to be interpreted as a unicode character especially given the \u representation, whi [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (john.g.holman[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 HTML_MESSAGE BODY: HTML included in message -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:236 listed in] [list.dnswl.org] 2.0 BLANK_SUBJECT Subject is present but empty X-Debbugs-Envelope-To: 78714 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) --0000000000005fabbc0636faafdb Content-Type: text/plain; charset="UTF-8" Many thanks for the fast response. I do think that's a surprising feature and that most users would expect "\u00B2" to be interpreted as a unicode character especially given the \u representation, which I think is specific to Unicode even if treated as just a variant numerical representation in emacs. Would it perhaps make sense for emacs to take the \u format into account when interpreting this? --0000000000005fabbc0636faafdb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Many thanks for the=C2=A0fast response. I do think that= 9;s a surprising feature and that most users would expect "\u00B2"= ; to be interpreted as a unicode character especially given the \u represen= tation, which I think is specific to Unicode even if treated as just a vari= ant numerical representation in emacs. Would it perhaps make sense for emac= s to take the \u format into account when interpreting this?=C2=A0=C2=A0 --0000000000005fabbc0636faafdb-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 07 08:45:15 2025 Received: (at 78714) by debbugs.gnu.org; 7 Jun 2025 12:45:15 +0000 Received: from localhost ([127.0.0.1]:47265 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uNsvC-000709-OJ for submit@debbugs.gnu.org; Sat, 07 Jun 2025 08:45:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48266) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uNsvA-0006vB-74 for 78714@debbugs.gnu.org; Sat, 07 Jun 2025 08:45:12 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uNsv4-0006IT-G9; Sat, 07 Jun 2025 08:45:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=IZnUQvcnB3x90guYf4xzzHL66wJaMa4z6/Zul7tCvew=; b=OywltuCOeN40 AYqzkCN60iru5m1USa2fRerNevTd3EkfY3GqdbtLsv0/lsHaM1Ue1uc7G7/uOTpKJ/MtUbXhHevzp ksV7ATmya0yh1utD3PLuk5ustvYAhbcXxPNPQvIs3Nl4cEv1pfWPRc0GnXIHoPYjg9F54jzVA8y+L kN3zeuLovNDqbHGa7Af09noyepbsDCslGl2+tb0vXX+JD9Kl683K8e51Vcnfwn0Y2BzGwXNY0V+th Jy31nTYwhc1Tn+S7TkVdQ5++V1ReoNPngun7ZvsdgpbtWnuAIF7MToZJtbPCpSzc4L08E1PTIa41c dn8ZaSVReT9WwRe6bn0gUA==; Date: Sat, 07 Jun 2025 15:45:04 +0300 Message-Id: <86v7p7hga7.fsf@gnu.org> From: Eli Zaretskii To: John Holman , Stefan Monnier In-Reply-To: (message from John Holman on Sat, 7 Jun 2025 13:38:49 +0100) Subject: Re: bug#78714: 30.1; failure binding keys to certain unicode characters References: <86y0u3hi3g.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78714 Cc: 78714@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) [Please use Reply All" to reply, so as to keep the bug tracker CC'ed.] > From: John Holman > Date: Sat, 7 Jun 2025 13:38:49 +0100 > > Many thanks for the fast response. I do think that's a surprising feature and that most users would expect > "\u00B2" to be interpreted as a unicode character especially given the \u representation, which I think is > specific to Unicode even if treated as just a variant numerical representation in emacs. Would it make sense > for emacs to take the \u format into account when interpreting that string? I don't think this is feasible, since by the time the character is interpreted the information that it came from a "\uNNN" format is long gone. But maybe Stefan (CC'ed) will have some ideas. From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 07 08:46:44 2025 Received: (at 78714) by debbugs.gnu.org; 7 Jun 2025 12:46:44 +0000 Received: from localhost ([127.0.0.1]:47269 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uNswe-00073G-Ax for submit@debbugs.gnu.org; Sat, 07 Jun 2025 08:46:44 -0400 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]:45407) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uNswc-00072z-Ld for 78714@debbugs.gnu.org; Sat, 07 Jun 2025 08:46:43 -0400 Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-32addf54a01so19025011fa.3 for <78714@debbugs.gnu.org>; Sat, 07 Jun 2025 05:46:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749300396; x=1749905196; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=LvBJOz1uZxeUXLHaQkci+mErZ036dtwfH9gwp0RUv20=; b=G/vrw6O8bI2TJmOV4wL0mAkTEQaPzPzq4xx6rAk+B0OMDMELww4OwrrmV62+SHbyPy ous7oUEs9NHy/wgiL4jEA2aGgg1Mgp2gpHYAR8LeJ/5BL0ZXreUj1VqbwJW7EhLWpmRv hDovzsf6bHqAQmyzYHNP+oJPmFppTN6RGIj7jKhq310qESLVyR8mUwRHX4Vlvk+WzS31 VYSWaSeeGRymLpsxbtkqy+DkFXHPKAvHYe/zc6Apt64Sb7i8D6f1qoWrqrNwGBCLQ5ca PbFBgnb03BardTJIb2HnzjQTdkY8/U913LxipQCBF08G1KhRHyTw63StzZZODgu9Ssc0 dKCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749300396; x=1749905196; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LvBJOz1uZxeUXLHaQkci+mErZ036dtwfH9gwp0RUv20=; b=JhiCIKJ1TWT1ULNxik2Jubqg/l8PuL2SZY+5HU0EhV2AAXSllcinR7QX67DODWLq5B 9vtrShuPdigFVMxnLn/tZ8xcUVW/UPzOdGs2PFPdRUM0JT5yx3BVbKiOk62mvYJ/zFyh Bn+bU5Uge68ZhjrMjd1dRDkirZiZ0vYpA929/PxgJ1Z76THFnuVdx7uhHenp96v8rNmr JNMNUjKjymNfKlnIVsuvk0WFrXagPflL1OXdFXd58BsKZ3Mbb9qfiTT3sZPpBJpHmM0y pAvureTpBqZkIocheTg8aibv/RmzqCpy/uWnSVKJuuEfN6tZ0+rCG+SaEFVHxWkIbOiZ joZA== X-Forwarded-Encrypted: i=1; AJvYcCVWYyi8VvKx+rVxLEPDL25GFYfGCDOYe2u9zvefqbZbuFW9mRHWbdydatxRgkTIHN0FulRiiQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yyh5WT8gyw2PedXJkHXHPhungrd4TtrLJJwDqoBei9I4WUsnHX5 JwGTJEzLBHstgfxYFvXRlamotfqRpTLsYohYW3Ud/AU979aVUHeLKILy6sEDxCYuj57Bjzk05KP 0pey/3JFGEDQaHb/bLFT0ycyHx1xNo1M= X-Gm-Gg: ASbGncsqIfhGSa4KFeByAEHg/CPB+KOX3lkn9wUGWv4rkNIhgdMA0Rvj0Zebi3Ivh7C 66XtGWgysCu0Pvnjln5OjGBnbiO65++2GjVR9sB2gy2GYkdmqtr3ImgGLWMQ7RsKx5Zgl126vPf xZpNi51tz3dwDC9GnX06V2/OYxXrZ7Zgeosw== X-Google-Smtp-Source: AGHT+IGGF1i+LER5c5xVdRfpzV2YYgapxRh3IDsfyr/hS+IPegkHJOndXTKD1Z9fm5Sr+kzQiPBmYKGoVhsYOE5Z39w= X-Received: by 2002:a2e:bc16:0:b0:31e:9d54:62ec with SMTP id 38308e7fff4ca-32adfdb024emr16593811fa.31.1749300395814; Sat, 07 Jun 2025 05:46:35 -0700 (PDT) MIME-Version: 1.0 References: <86y0u3hi3g.fsf@gnu.org> <86v7p7hga7.fsf@gnu.org> In-Reply-To: <86v7p7hga7.fsf@gnu.org> From: John Holman Date: Sat, 7 Jun 2025 13:46:22 +0100 X-Gm-Features: AX0GCFvVs68OmXn2XoAlpQvarZ5_Ov0DN13QbrFQUYpMCt-218aVMLimARi8BFY Message-ID: Subject: Re: bug#78714: 30.1; failure binding keys to certain unicode characters To: Eli Zaretskii Content-Type: multipart/alternative; boundary="000000000000b2bc1a0636fabcad" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 78714 Cc: 78714@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000b2bc1a0636fabcad Content-Type: text/plain; charset="UTF-8" Thank you. On Sat, 7 Jun 2025 at 13:45, Eli Zaretskii wrote: > [Please use Reply All" to reply, so as to keep the bug tracker CC'ed.] > > > From: John Holman > > Date: Sat, 7 Jun 2025 13:38:49 +0100 > > > > Many thanks for the fast response. I do think that's a surprising > feature and that most users would expect > > "\u00B2" to be interpreted as a unicode character especially given the > \u representation, which I think is > > specific to Unicode even if treated as just a variant numerical > representation in emacs. Would it make sense > > for emacs to take the \u format into account when interpreting that > string? > > I don't think this is feasible, since by the time the character is > interpreted the information that it came from a "\uNNN" format is long > gone. But maybe Stefan (CC'ed) will have some ideas. > --000000000000b2bc1a0636fabcad Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thank you.

On Sat, 7 Jun 2025 at 13:4= 5, Eli Zaretskii <eliz@gnu.org> w= rote:
[Please us= e Reply All" to reply, so as to keep the bug tracker CC'ed.]

> From: John Holman <john.g.holman@gmail.com>
> Date: Sat, 7 Jun 2025 13:38:49 +0100
>
> Many thanks for the fast response. I do think that's a surprising = feature and that most users would expect
> "\u00B2" to be interpreted as a unicode character especially= given the \u representation, which I think is
> specific to Unicode even if treated as just a variant numerical repres= entation in emacs. Would it make sense
> for emacs to take the \u format into account when interpreting that st= ring?

I don't think this is feasible, since by the time the character is
interpreted the information that it came from a "\uNNN" format is= long
gone.=C2=A0 But maybe Stefan (CC'ed) will have some ideas.
--000000000000b2bc1a0636fabcad-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 07 10:29:47 2025 Received: (at 78714) by debbugs.gnu.org; 7 Jun 2025 14:29:48 +0000 Received: from localhost ([127.0.0.1]:49205 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uNuYN-0007Ke-JQ for submit@debbugs.gnu.org; Sat, 07 Jun 2025 10:29:47 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:38545) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uNuYH-0007KL-EV for 78714@debbugs.gnu.org; Sat, 07 Jun 2025 10:29:45 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4bF0v72n9Bz1r56s; Sat, 7 Jun 2025 16:29:39 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 4bF0v7115Hz1qqlS; Sat, 7 Jun 2025 16:29:39 +0200 (CEST) X-Virus-Scanned: amavis at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavis, port 10024) with ESMTP id rWhFLXal8JP6; Sat, 7 Jun 2025 16:29:28 +0200 (CEST) X-Auth-Info: kK/kECIMKzhiTBOpd0vo4AJrVhycV+hCIoyeHEfbOq+IGKegCGQo08gfqXkfbVf2 Received: from igel.home (aftr-82-135-83-135.dynamic.mnet-online.de [82.135.83.135]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Sat, 7 Jun 2025 16:29:28 +0200 (CEST) Received: by igel.home (Postfix, from userid 1000) id CEC7E2C192A; Sat, 7 Jun 2025 16:29:27 +0200 (CEST) From: Andreas Schwab To: John Holman Subject: Re: bug#78714: 30.1; failure binding keys to certain unicode characters In-Reply-To: (John Holman's message of "Sat, 7 Jun 2025 12:46:56 +0100") References: Date: Sat, 07 Jun 2025 16:29:27 +0200 Message-ID: <87h60raam0.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 78714 Cc: 78714@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On Jun 07 2025, John Holman wrote: > However the same syntax fails for some characters (so far I've noticed this > for \u00B0 to \u00B6 but there will be more) e.g > after (define-key my-test-mode-map (kbd "a") "\u00B2") C-h k shows Use vector notation instead: [?\u0082]. Generally, use of strings to represent key sequences should be avoided. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 09 06:06:02 2025 Received: (at 78714) by debbugs.gnu.org; 9 Jun 2025 10:06:02 +0000 Received: from localhost ([127.0.0.1]:53985 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uOZOD-0007U8-Lo for submit@debbugs.gnu.org; Mon, 09 Jun 2025 06:06:02 -0400 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]:52465) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uOZOA-0007To-OR for 78714@debbugs.gnu.org; Mon, 09 Jun 2025 06:05:59 -0400 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-55351af2fc6so4959928e87.0 for <78714@debbugs.gnu.org>; Mon, 09 Jun 2025 03:05:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749463552; x=1750068352; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=XEpUSlRgp29NvQ6fmw5YbuG8LFqnBTBDshI22kiGxYs=; b=WRr60gOrvbkNm7vsz+yiNjdRnqg+L5FhgPBO362PMxWDTMMrIkONqboAwHpydJHw/f JQhRMyLj9Roj9jVPch/rHVOlmcot/D5Jy1dL7+K7Xi9khSVzvCtwxD4hnsiXiTnZ0zEE o5BXtQCMRQpOnoHW7MHHsNgMbPj4ejTrqh/Ecuwj71Rlsm331DSH7FICOTDpTKQP2+51 9HO/TtXMun42x7xmJ7GiEQk7oKtFBXsGj7AFm7ue6nPf3k5Gv1X5G+fq3V7wNv6OeyVQ sEtfnQgZ/7BknuMTwS/K5f1hNhLT5fW1+P+CgfBlG9tJJMH5W0LUbYOZKTAu9RgOR8DK lSVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749463552; x=1750068352; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XEpUSlRgp29NvQ6fmw5YbuG8LFqnBTBDshI22kiGxYs=; b=F6WUGLHURbwwDBVV1MzU3FQE1W7dHwzfRJa+jephE3SA8FCCAwMIi7+WugsMFhYvV/ bga7MRkleJOADWiowO2s9ImZ8RnhE2+/fMcT0KDYoBnq9Bhb1kUNsrmX2BaD9WgLJa+9 mkxzk3VZHAsHi383iq+oEhX+MbLOPjPyF1Ek8zdFBKiOLBZ5S5cF/saYFnRG7LolKai/ kw1D/kStIPkeFkuZBQQV2DMiAYeBZbS8bWdd0eMBI7rbVcGg4uOnXUJTHRQrreQDTrfL OoavNmQamSfDY3gszgZix1k1DxO09iRKnY1tsZT1WAMYWi+2AUmiyxFqVladO6FT8NQ6 l69Q== X-Gm-Message-State: AOJu0YxT7cCblS46L40yzFyXtCB68f34nLaBMmNRitD7P7xYz1r6Dkdn bxuEKnrtvn+qd2GgbxAWGvBB7m0jZdOsg3I+1De3kekX/Lkd5yvi9WCIUvVRwfkUloCWd7c1tGj Arktv7A2mqohTnFip3yb7l9UZAYA9sbs= X-Gm-Gg: ASbGncta9R1pQEw98f3HjrPQibJvM8WW92FAIflUYZbU0GH/XxGdmgvfMWzqE5/NEaj HPh1vxoEFtgvK0Bv2DcHPeGmwBNtls3mh++xITkl5WB85I7Blq0TSSCGZtINbhgz8CI15qUjfP+ bYvcZa1y8xrO9fApBowtA3ChxO5vlIVm6FzA== X-Google-Smtp-Source: AGHT+IEEcuq1uhv+QAa74hORdMAU+QtZiDUxg1YMt92br4yfPBsxdqiejiVSXLLzUPqQ4UQH8CaGGzE8SRQdC1XR6hU= X-Received: by 2002:a2e:9e84:0:b0:30d:e104:a942 with SMTP id 38308e7fff4ca-32adfe1b0c6mr23431301fa.38.1749463551835; Mon, 09 Jun 2025 03:05:51 -0700 (PDT) MIME-Version: 1.0 References: <87h60raam0.fsf@igel.home> In-Reply-To: <87h60raam0.fsf@igel.home> From: John Holman Date: Mon, 9 Jun 2025 11:05:40 +0100 X-Gm-Features: AX0GCFtlU-tv17vH-fjxgNWCf1Jo7XjGKEMQdv5t09t2BO9j1LtokvNSjozKbpc Message-ID: Subject: Re: bug#78714: 30.1; failure binding keys to certain unicode characters To: Andreas Schwab Content-Type: multipart/alternative; boundary="0000000000008e0580063720b963" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 78714 Cc: 78714@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --0000000000008e0580063720b963 Content-Type: text/plain; charset="UTF-8" Many thanks Andreas - that's certainly more concise than using a lambda. I do think this is a trap for users who may expect that a key definition that a single character string simply specifies the character to be inserted when that key is pressed rather than a macro. Treating a string with a single character as a character to insert rather than a one-character macro might avoid that, or if that is awkward to implement or otherwise undesirable an explicit warning in the documentation might help. The documentation for define-key does say that a string is treated as a keyboard macro, but the significance of that is easy to miss. On Sat, 7 Jun 2025 at 15:29, Andreas Schwab wrote: > On Jun 07 2025, John Holman wrote: > > > However the same syntax fails for some characters (so far I've noticed > this > > for \u00B0 to \u00B6 but there will be more) e.g > > after (define-key my-test-mode-map (kbd "a") "\u00B2") C-h k shows > > Use vector notation instead: [?\u0082]. Generally, use of strings to > represent key sequences should be avoided. > > -- > Andreas Schwab, schwab@linux-m68k.org > GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 > "And now for something completely different." > --0000000000008e0580063720b963 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Many thanks Andreas - that's certainly more concise th= an using a lambda.=C2=A0

I do think this is a trap for u= sers who may expect that a key definition that a single character string si= mply specifies the character to be inserted when that key is pressed rather= than a macro. Treating a string with a single character=C2=A0as a characte= r to insert rather than a one-character macro might avoid that, or if that = is awkward to implement or otherwise undesirable an explicit warning in the= documentation might help. The documentation for define-key does say that a= string is treated as a keyboard macro, but the significance of that is eas= y to miss.


On Sat, 7 Jun 2025 at = 15:29, Andreas Schwab <schwab@l= inux-m68k.org> wrote:
On Jun 07 2025, John Holman wrote:

> However the same syntax fails for some characters (so far I've not= iced this
> for \u00B0 to \u00B6 but there will be more) e.g
> after (define-key my-test-mode-map (kbd "a") "\u00B2&qu= ot;) C-h k shows

Use vector notation instead: [?\u0082].=C2=A0 Generally, use of strings to<= br> represent key sequences should be avoided.

--
Andreas Schwab, = schwab@linux-m68k.org
GPG Key fingerprint =3D 7578 EB47 D4E5 4D69 2510=C2=A0 2552 DF73 E780 A9DA = AEC1
"And now for something completely different."
--0000000000008e0580063720b963-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 09 07:48:43 2025 Received: (at 78714) by debbugs.gnu.org; 9 Jun 2025 11:48:43 +0000 Received: from localhost ([127.0.0.1]:54136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uOaza-0006Ty-MB for submit@debbugs.gnu.org; Mon, 09 Jun 2025 07:48:42 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:47234) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uOazX-0006Tg-8V for 78714@debbugs.gnu.org; Mon, 09 Jun 2025 07:48:39 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-45024721cbdso36519875e9.2 for <78714@debbugs.gnu.org>; Mon, 09 Jun 2025 04:48:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749469712; x=1750074512; darn=debbugs.gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=x5luTqKy1fE+BnlWJw4BoVYxcsbS2hwkGZSjYLNkyWU=; b=fo/3KJqiSnwZHmwoP1+HkuPX88QShqR2gxz/7nj29gyE31k1EWQU/7FB+pPnX8kUqE w3PgcExXHnfeeBgH7kIstGNBKufeB69G3uG0iVkNLYoM9qemvl6IDSE6ztRjXy2nqlHl XontLh9L9NAHfkQn9KQskQXRMyMKp4Hz3ePthzzxodl+BNlJBbDmluyN9y5JivZJSp2A yzi8RkBVSvwQ39g1bRHaJuCiHCKxHgr3c6foN4nevwyXpTeP+2xNwkudxsFMOQV0Ao3y IXLJwtwZdMw9MwcolLmnGS9wLLIkRGTDPb3y9pBsyl98wJC2ssPzUWWSzeN+wOr+fauq Hasw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749469712; x=1750074512; h=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=x5luTqKy1fE+BnlWJw4BoVYxcsbS2hwkGZSjYLNkyWU=; b=sS9DzNkVQ4+8HJpK50bbLz/NMKxviQD6KxE+UDWt30nxcnHgmyjCYlUF3b3HrvoWu9 1VYlPN/uD2GScsFiVBzMo0NHZtmM0cePFJR+n3DrE0McXh3hqJCIk050euYZagsgqyIb +ebE5S07p8DSTIcGBS93p5M1iDupEZNMzGu6BsRw3wRcfTF10+MCquht3r7TqXeaeWNz XXAcIQhPb5frt2WnOLa5+7tb1wQAHYbThJa+KLFmTGnC7KfWLr4azgMrwmXj/a6YQeUx QJA4TtTPPUIFMTYJc/0QJc3jRnvBYziAMj6RYbR8pWDOkSCc6C4+UY25isUhpnSR5LCu Z5oQ== X-Forwarded-Encrypted: i=1; AJvYcCXuRHs6bvqRLbbo89oT9L9Sl9yc/y+aG3EUNSWzZ9gSFu4nzbQPNmsZRlzzDlT2326i4ABpuA==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yz2vDXfuqlQ42qAhW4xoLaEeCxBafgmBU/5B8CAkNRDgUBYTqTT pXnygoE5Zkb2HpP3IA5bXFKLI0xYOyrOgv8qPQn8n2QtH2cgpfegjKiMNNvCZGVi X-Gm-Gg: ASbGncvfiSGIRESZAv7NfbuzgVVoYArgvwLVlimdj58Hq0CJn1Yp1YwCq9m6JquRaQU PrcOQyhXwTwr3fPiSoJbUz5BzaWLn91U7mm1ei4g2Rq+pjO/3jR6YcHQvN33ps9Pc7vnpin79bg nHVNEe78xU6dUFiSKswbpVUDFyepWdFsrFVnS3hqkEp/I2iQO+QyazCtRPhNL0KQAPGfRXNnMEa dzPMK4Lf+um0y8hiWXsD3h/TwMNk9opvQWTenGiTGOViNmC0ijrdWKQ3hGWFt1qfMHdlbfJY5gi gWTUGm+JrV7LAmnFyMq07lFYYBzhllhWvj59Kg== X-Google-Smtp-Source: AGHT+IEMz258bFHbjx6tX1wCfREfSsPDYHMPx1QhgdawpHPXBcpZWVcumRvaLdWBrrqpwjamTxRNEQ== X-Received: by 2002:a05:600c:5296:b0:43c:ec0a:ddfd with SMTP id 5b1f17b1804b1-452013695f4mr110775075e9.6.1749469711943; Mon, 09 Jun 2025 04:48:31 -0700 (PDT) Received: from rltb ([2a01:e0a:3f3:fb51:5c8d:25ac:a59:60fb]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45213709686sm109463265e9.23.2025.06.09.04.48.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Jun 2025 04:48:31 -0700 (PDT) From: Robert Pluim To: John Holman Subject: Re: bug#78714: 30.1; failure binding keys to certain unicode characters In-Reply-To: References: <87h60raam0.fsf@igel.home> Date: Mon, 09 Jun 2025 13:48:31 +0200 Message-ID: <87frg987ao.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 78714 Cc: 78714@debbugs.gnu.org, Andreas Schwab X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Mon, 9 Jun 2025 11:05:40 +0100, John Holman said: John> Many thanks Andreas - that's certainly more concise than using a lambda. John> I do think this is a trap for users who may expect that a key definition John> that a single character string simply specifies the character to be John> inserted when that key is pressed rather than a macro. Treating a string John> with a single character as a character to insert rather than a John> one-character macro might avoid that, or if that is awkward to implement or John> otherwise undesirable an explicit warning in the documentation might help. John> The documentation for define-key does say that a string is treated as a John> keyboard macro, but the significance of that is easy to miss. (info "(emacs) Init Rebinding") describes how to do this. The docstring for `keymap-global-set' also mentions `key-description', which avoids the need to manually write in vector notation, which I guess we could add to `keymap-set' as well. Robert -- From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 09 10:40:57 2025 Received: (at 78714) by debbugs.gnu.org; 9 Jun 2025 14:40:57 +0000 Received: from localhost ([127.0.0.1]:56270 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uOdgG-0007Vj-AD for submit@debbugs.gnu.org; Mon, 09 Jun 2025 10:40:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47230) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uOdgD-0007UG-Mk for 78714@debbugs.gnu.org; Mon, 09 Jun 2025 10:40:54 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uOdg7-0006mi-5a; Mon, 09 Jun 2025 10:40:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=9+khUYh0I1P4TFsnsWAK64CCSpRgvanDK3rfhvEwjOI=; b=ipfWSDQMDazb oRkVlMZNkFvMDoCofm3m+gpVv476ECH8SL5/S8CWJmxSrqnnO0DAFCiNMPhLFEZzxyKczhLsRwrXJ xQe36xsF0xXEVODRpH+5nWr11hDbJrFUrFbkaCQ30ALPO8evA4sz/cvOanWXpRoAFLZv7DOa4rJir 18Vajjm8MxyWTviFiG9hnk7yuGM462j6/ibRrQmkz3M8pahbXFewa7R3klYSFU2hGWxOBmjVoYXKU YKj1lMh1LJiio1F1ZMeQVPMKHPcP8qpmFZYZ8M0cZcNlo3hjXH9Q20uLr4zduZ+dWHunpkHMJhts6 0Eb5ToZJI/a+sPCnvy/FMQ==; Date: Mon, 09 Jun 2025 17:40:44 +0300 Message-Id: <86o6uxf05v.fsf@gnu.org> From: Eli Zaretskii To: Robert Pluim In-Reply-To: <87frg987ao.fsf@gmail.com> (message from Robert Pluim on Mon, 09 Jun 2025 13:48:31 +0200) Subject: Re: bug#78714: 30.1; failure binding keys to certain unicode characters References: <87h60raam0.fsf@igel.home> <87frg987ao.fsf@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78714 Cc: 78714@debbugs.gnu.org, john.g.holman@gmail.com, schwab@linux-m68k.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 78714@debbugs.gnu.org, Andreas Schwab > From: Robert Pluim > Date: Mon, 09 Jun 2025 13:48:31 +0200 > > >>>>> On Mon, 9 Jun 2025 11:05:40 +0100, John Holman said: > > John> Many thanks Andreas - that's certainly more concise than using a lambda. > John> I do think this is a trap for users who may expect that a key definition > John> that a single character string simply specifies the character to be > John> inserted when that key is pressed rather than a macro. Treating a string > John> with a single character as a character to insert rather than a > John> one-character macro might avoid that, or if that is awkward to implement or > John> otherwise undesirable an explicit warning in the documentation might help. > John> The documentation for define-key does say that a string is treated as a > John> keyboard macro, but the significance of that is easy to miss. > > (info "(emacs) Init Rebinding") describes how to do this. The > docstring for `keymap-global-set' also mentions `key-description', > which avoids the need to manually write in vector notation, which I > guess we could add to `keymap-set' as well. Feel free to add that. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 09 17:13:13 2025 Received: (at 78714) by debbugs.gnu.org; 9 Jun 2025 21:13:14 +0000 Received: from localhost ([127.0.0.1]:58132 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uOjnn-0004gn-Uj for submit@debbugs.gnu.org; Mon, 09 Jun 2025 17:13:13 -0400 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]:52511) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uOjnf-0004ee-Kz for 78714@debbugs.gnu.org; Mon, 09 Jun 2025 17:13:04 -0400 Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-32ae3e94e57so27909131fa.1 for <78714@debbugs.gnu.org>; Mon, 09 Jun 2025 14:12:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749503573; x=1750108373; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=xTbD1+5U+0OuVY8ZPpARn6hps4CB8LqLmkQKDebKPek=; b=D4+hdvf/Ut0DNoGMMQ7jPBl/o+YsviHMdwx15A3AoSmlv+Dco1WSdmXRH1BAAtRLVD z0hApON1dbKKFH4mmeS/y3IJBj2d9UNiiDvr4HEzBGStYdLr+kbImsHi9vj/eBfBkXSr aQw6zHjvc4nfsXRgfNzsiNJPlnSu/58IB73GnY6oUF0uHIMgcxFPj+pBmOHkrIgo4Sur qtpYkBiMNHiIJFUpTB7TH2PZI0X3Avejz4mWBe1xlUHE6qTj56Ru1lsu0cSLGqgWjjRT rbSdN9/aiixdVvwJOF/yNQ8KNof/kFTuxLA2PBKkwKQYDScOx6GPP71Ia/OMzLHgpcqu s5MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749503573; x=1750108373; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xTbD1+5U+0OuVY8ZPpARn6hps4CB8LqLmkQKDebKPek=; b=Tq3HqWAueEvs3B9O5fcen9zn+K5y+QKHKvgCimVf+oMm1F+ercXsQ2xAiX9aZROvUq clE6iZoWNQSeRJtEH4kNX3UzIJIjRlI8i21aPU+wwihYh70+68H1M6pKdTXsjsJCZIRH iXZJQMGz/h+cupFl+0OrzGzaxaIVAlg18EjPYm1HgTOdBMGgo1enyFpedVFhro4u3yhg wQia6dvRkvj8vHGdHILCYgM18vKYQw4sSc0LOhXvVdssl/McJCVPFmbrsQHjUqp1jEdn q+IGHrzFFja8Z4Bz4yBzkkAVMw2v6THk7YAJ9PEGDT25hBbiA6aaznPTKlnv74SQeWIS PuKg== X-Forwarded-Encrypted: i=1; AJvYcCWrHzT2Qxic06wOHp2z3F7co9aeXdZxJXJDCe/YT/NCc9HQXzYeHd6iQd5owUwyCp4EgLSxIw==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yw+iplwDH1Pjqlf2PyAMlX4OcZEs88I0kbhg/0jTfGcvTUWjaUR vOk9/+07iQZyW3tilzFEpamq+UDJBIjdyaT5ySWKKuL7fvs+Fino837mth3S1DOfNdUNkLNdyQt knXgNwlRZRYeKOa7/2UeRd6wATPlWQyA= X-Gm-Gg: ASbGncv++FFJfw8VEx5b3P3M4KR2XhctKV6r2fpJ2xeWO0k9omdcioacIgnCLRqa1Vm BgcK27UsxE5m0WAuZzM1aB0IgzHI8H5GYZQ5luPvIhmq27J99yMHb6dF8rHMgQEuWBOSnIh9xwS wTpcue5yDRSDg3sGTS9R29tD5AauQd5exvEBbfoOju6AEP X-Google-Smtp-Source: AGHT+IFmCABY1Wc4Q5MB1m8pctkUCHoovoNz8W53yDVLiUq4WtIOdkrqUETR1VyQ1zSKDeQ6XdA3oZSP01g9OXnvQiQ= X-Received: by 2002:a05:651c:1992:b0:32a:66e6:9ff9 with SMTP id 38308e7fff4ca-32adfdd8838mr44500901fa.26.1749503572427; Mon, 09 Jun 2025 14:12:52 -0700 (PDT) MIME-Version: 1.0 References: <87h60raam0.fsf@igel.home> <87frg987ao.fsf@gmail.com> <86o6uxf05v.fsf@gnu.org> In-Reply-To: <86o6uxf05v.fsf@gnu.org> From: John Holman Date: Mon, 9 Jun 2025 22:12:40 +0100 X-Gm-Features: AX0GCFumHsosEa9NsSCf4i42IMGwhHafDOGutPpTAgLgctxr94jp0olSEn8eGo0 Message-ID: Subject: Re: bug#78714: 30.1; failure binding keys to certain unicode characters To: Eli Zaretskii Content-Type: multipart/alternative; boundary="000000000000f7ca7006372a0a61" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 78714 Cc: 78714@debbugs.gnu.org, Robert Pluim , schwab@linux-m68k.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000f7ca7006372a0a61 Content-Type: text/plain; charset="UTF-8" Hi Robert I just tried using key-description, for example (define-minor-mode math-typing-mode "A minor mode for typing maths characters" :init-value nil :lighter " Math" (let ((map (make-sparse-keymap))) (if math-typing-mode (progn (define-key map (kbd "C-3") (key-description "\u00B3")) (use-local-map map)) (use-local-map nil)))) but this produces the same result as (define-key map (kbd "C-3") "\u00B3") while (define-key map (kbd "C-3") [?\u00B3]) or my original lambda works (inserts the unicode character when you press C-3) Probably I misunderstand what you are suggesting though? On Mon, 9 Jun 2025 at 15:40, Eli Zaretskii wrote: > > Cc: 78714@debbugs.gnu.org, Andreas Schwab > > From: Robert Pluim > > Date: Mon, 09 Jun 2025 13:48:31 +0200 > > > > >>>>> On Mon, 9 Jun 2025 11:05:40 +0100, John Holman < > john.g.holman@gmail.com> said: > > > > John> Many thanks Andreas - that's certainly more concise than using > a lambda. > > John> I do think this is a trap for users who may expect that a key > definition > > John> that a single character string simply specifies the character > to be > > John> inserted when that key is pressed rather than a macro. > Treating a string > > John> with a single character as a character to insert rather than a > > John> one-character macro might avoid that, or if that is awkward to > implement or > > John> otherwise undesirable an explicit warning in the documentation > might help. > > John> The documentation for define-key does say that a string is > treated as a > > John> keyboard macro, but the significance of that is easy to miss. > > > > (info "(emacs) Init Rebinding") describes how to do this. The > > docstring for `keymap-global-set' also mentions `key-description', > > which avoids the need to manually write in vector notation, which I > > guess we could add to `keymap-set' as well. > > Feel free to add that. > --000000000000f7ca7006372a0a61 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Robert

I just tried using key-descri= ption, for example

(define-minor-mode math-typing-= mode
=C2=A0 "A minor mode for typing maths characters"
=C2= =A0 :init-value nil
=C2=A0 :lighter " Math"
=C2=A0 (let ((m= ap (make-sparse-keymap)))
=C2=A0 =C2=A0 (if math-typing-mode
=C2=A0 = =C2=A0 =C2=A0(progn

=C2=A0 =C2=A0 =C2=A0 =C2= =A0 (define-key map (kbd "C-3") (key-description "\u00B3&quo= t;))

=C2=A0 =C2=A0 =C2=A0 =C2=A0 (use-local-map ma= p))
=C2=A0 =C2=A0 =C2=A0 (use-local-map nil))))

but this produces the same result as=C2=A0

(= define-key map (kbd "C-3") "\u00B3")

while

(define-key map (kbd "C-3")= [?\u00B3]) or my original lambda works (inserts the unicode character when= you press C-3)

Probably I misunderstand what you = are suggesting though?



<= div class=3D"gmail_quote gmail_quote_container">
On Mon, 9 Jun 2025 at 15:40, Eli Zaretskii <eliz@gnu.org> wrote:
> Cc: 78714@debbugs.gnu.org, Andreas Schwab <schwab@linux-m68k.org>
> From: Robert Pluim <
rpluim@gmail.com>
> Date: Mon, 09 Jun 2025 13:48:31 +0200
>
> >>>>> On Mon, 9 Jun 2025 11:05:40 +0100, John Holman &l= t;john.g.holma= n@gmail.com> said:
>
>=C2=A0 =C2=A0 =C2=A0John> Many thanks Andreas - that's certainly= more concise than using a lambda.
>=C2=A0 =C2=A0 =C2=A0John> I do think this is a trap for users who ma= y expect that a key definition
>=C2=A0 =C2=A0 =C2=A0John> that a single character string simply spec= ifies the character to be
>=C2=A0 =C2=A0 =C2=A0John> inserted when that key is pressed rather t= han a macro. Treating a string
>=C2=A0 =C2=A0 =C2=A0John> with a single character as a character to = insert rather than a
>=C2=A0 =C2=A0 =C2=A0John> one-character macro might avoid that, or i= f that is awkward to implement or
>=C2=A0 =C2=A0 =C2=A0John> otherwise undesirable an explicit warning = in the documentation might help.
>=C2=A0 =C2=A0 =C2=A0John> The documentation for define-key does say = that a string is treated as a
>=C2=A0 =C2=A0 =C2=A0John> keyboard macro, but the significance of th= at is easy to miss.
>
> (info "(emacs) Init Rebinding") describes how to do this. Th= e
> docstring for `keymap-global-set' also mentions `key-description&#= 39;,
> which avoids the need to manually write in vector notation, which I > guess we could add to `keymap-set' as well.

Feel free to add that.
--000000000000f7ca7006372a0a61-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 10 03:46:16 2025 Received: (at 78714) by debbugs.gnu.org; 10 Jun 2025 07:46:17 +0000 Received: from localhost ([127.0.0.1]:60767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uOtgW-0007a2-MS for submit@debbugs.gnu.org; Tue, 10 Jun 2025 03:46:16 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:44171) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uOtgU-0007Z9-Ec for 78714@debbugs.gnu.org; Tue, 10 Jun 2025 03:46:14 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3a375e72473so2553450f8f.0 for <78714@debbugs.gnu.org>; Tue, 10 Jun 2025 00:46:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749541568; x=1750146368; 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=OFes+MDlbwGIORbtjNKHXIElknH47b3mU2Ue/vcrdjc=; b=fjTtI3uSgoS0Ip66CquymqqrDgoz4LJlcYKQXfuzH6o0qn5mJEDzMFAG4e+p21kPMm 3izWWannBdkzYxBRXD9m344SdykxZ6hjbFQBhAfOHln6RGyd/G40F3C14FeES2HNYhW/ MAE9zWZk1UkkEIglxvOoV7JwAbQO1SA/mwL6zUalG0NeOnPejlWBHP0pAoRFymQdT0Sl 4PSmx+lr3dA/Iqx60WBZc8OYZppkxCz3LDJ93zTAJG3EY0Q6a+//538vbit+qe2zY6jy yD0t2i5Z7Wx5XDiNnuopINJ+tvsyv0T7pBgD/I3hI9RBF9T/XfRtfQS/I5Di0F3ONqet 34eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749541568; x=1750146368; 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=OFes+MDlbwGIORbtjNKHXIElknH47b3mU2Ue/vcrdjc=; b=IDc2QOdROhIOZHbVo7CLN1re2+Qy+Qf/H2oEVvI9C+ZUpEyIRsUpKIlk66eQfY9AB3 RH37JanmS23Xgfz1XGB9I4fHYDqPYS2FkSQ0MJx4i+mVi9wHGf/+NcHw2VjIT6wAD3jH z2GS9Z4l3RKG1yY8oIuITBm0fC+eG7edmKh3XMpL/+IP3Bf3g5e2qHBr3c1QHSkUbYSe IFa78Ul+1Vq47kRLJSyaF4bbBAn3kg4TLnWIA2DxLzkpxX02SLhKSFmHh2lwPIjiBex4 VxBKqD/opFhgcuBpTSVEDOMGJotl1jZjYBF2cQRtfQrsGS7+WGZXSl7TvI4zUq0L7tBU wfAw== X-Forwarded-Encrypted: i=1; AJvYcCWL+6sUy9uRNwVpP+cNMDHAaWO4vZO5aFUL9uO3Jqc4ma42cC/iUcdiWLan3Dg0F8zz90m8/w==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzGeMsWdAkr7SKryZkVTKTxnGhehl1AhuDQcmGwSU06eHKYQh3+ Pcot4svu6hohF0ggBVRRoR345FrYWhAWcXOMb/Wh57hbxk+ZIP0NkfZ7 X-Gm-Gg: ASbGncs2Ac/iYy4u8rwSTDAv9MucVEgVOgtbPEECiyUeoMZzkJ9AL2CALY1dwMZC3Jv 3lyfUNQsEn+USpDiOA6CbpUPJJflE2RKyaLKqVVJTrlFuRTUQ27vvEhIxD80u3T50F4gIGG2SE3 E+er7XXAbCQBhISz5zGkN/E1KxG1oU90X4+EfoMgTNZ45IZ6G9//doav6gMMv2Rzx+zyp3CVK78 QsrjJuW0LSVhfDdHi7kwWYAHdI9zLOMzXNYh7xiZNed8lv6gDTBtbVVxbh2HEl80Ds8jOplStOx wsEOiH5KTmzroRCqHtC0bZ66mtu0phUZ+jdeq+wAESVNv5OxOA== X-Google-Smtp-Source: AGHT+IHY7AZMCwDr8d8ih/ikNNznqrpaUjvUlo6jwMfdS5xMxVD1iQX/rXfD+63ALLoge1M0dvhYEQ== X-Received: by 2002:a05:6000:2004:b0:3a5:2923:7ffa with SMTP id ffacd0b85a97d-3a53188a55emr13221383f8f.7.1749541567986; Tue, 10 Jun 2025 00:46:07 -0700 (PDT) Received: from rltb ([2a01:e0a:3f3:fb51:b977:7262:22e2:9ab8]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a53229d96fsm11457509f8f.7.2025.06.10.00.46.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jun 2025 00:46:07 -0700 (PDT) From: Robert Pluim To: John Holman Subject: Re: bug#78714: 30.1; failure binding keys to certain unicode characters In-Reply-To: References: <87h60raam0.fsf@igel.home> <87frg987ao.fsf@gmail.com> <86o6uxf05v.fsf@gnu.org> Date: Tue, 10 Jun 2025 09:46:06 +0200 Message-ID: <8734c882f5.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 78714 Cc: 78714@debbugs.gnu.org, Eli Zaretskii , schwab@linux-m68k.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> On Mon, 9 Jun 2025 22:12:40 +0100, John Holman said: John> Hi Robert John> I just tried using key-description, for example John> (define-minor-mode math-typing-mode John> "A minor mode for typing maths characters" John> :init-value nil John> :lighter " Math" John> (let ((map (make-sparse-keymap))) John> (if math-typing-mode John> (progn John> (define-key map (kbd "C-3") (key-description "\u00B3")) John> (use-local-map map)) John> (use-local-map nil)))) John> but this produces the same result as John> (define-key map (kbd "C-3") "\u00B3") John> while John> (define-key map (kbd "C-3") [?\u00B3]) or my original lambda work= s (inserts John> the unicode character when you press C-3) John> Probably I misunderstand what you are suggesting though? No, I=CA=BCd forgotten about one of the corner cases of `key-description'. `key-parse' would work here, but that probably has other issues, so specifying the vector is your best bet. Robert --=20 From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 11 09:40:32 2025 Received: (at 78714) by debbugs.gnu.org; 11 Jun 2025 13:40:32 +0000 Received: from localhost ([127.0.0.1]:48526 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uPLgu-0001Df-13 for submit@debbugs.gnu.org; Wed, 11 Jun 2025 09:40:32 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:52648) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uPLgj-00017C-4o; Wed, 11 Jun 2025 09:40:22 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-450cf214200so62244215e9.1; Wed, 11 Jun 2025 06:40:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749649214; x=1750254014; darn=debbugs.gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=5Mp7uloKO1i9qvBu5qQbwO1ItqG0p1CpJmSfYCZI5vY=; b=a4fvZ67rVl0mfnXEPyb/XPlWxVADDuOxz1rvBuglNzeezU9VesDXi6GBbM4j28fIs2 30b2EeI0LUYoTSrMygV5YVFdk4JltvSuUA7yV/aZtFwBsHf+Y/7mzlqUQkAezUiAy3iS XjqlY3ENgr4dXtkcb0I+ab3j7FHhC9ibkHuyia5G7/6kSK36d9t+Busiih/ThusoWfX+ Q2Lwn7KJKq0b8grUhXb+fT8+zSx4krbXZHNDNVs0Nl4Lr1LfBrjnxfyeCtcesods7uVu ly4krqkPYslHvolW6K65WTArnP4OeOwjC7FHg8OWMhB6wVlkEnhEiCiSKA3OIxtC7mMR vU5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749649214; x=1750254014; h=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=5Mp7uloKO1i9qvBu5qQbwO1ItqG0p1CpJmSfYCZI5vY=; b=dsPXR3K0FEmBB7Zdy6I8uvqRfsiSDqNp9S88xOBXbWltI5zcOR5270sZ2MoyeAYi7G dyB/Jtz6HaWWGA/4qc0hq1ot840+YpUILOoQUps3Y8/gOqwD4oLDLJGzGtadrj6pWxeJ eYHB6ZUamxZ0d4kIcv7ZpADCtgIZB0z7e1No3sWZ50v1ZQo54z7pX6hnEz3oigTimeBN VH0EAG25QpwAtqX4ho5aYiHcQjL4iNwWSOFyeGCeEn0s0Szd77D0+ln9+jpJI7dP5Xta xOKiqOLWLE6rhGqhKY7kOpM21ATIJKW3oCI2X9T6RzbcBYVTe07h74A1BpvtbEYOPIXH oDfQ== X-Forwarded-Encrypted: i=1; AJvYcCWz4bVCRrJCY0XHXq/Xi97tKVZo8U0ZYncmicG/kQU52v8fOG09sj5WR6mAVaD80jU3qbFPIiOB@debbugs.gnu.org X-Gm-Message-State: AOJu0YznpIKGn+Z78IxzwAZynZHTAXjQdt9c+gAV7lk+hSw9PpQRHB9I 0f8gzJNAtojXjc8QX6grPOmr99AUOoX6LiFSbkPZFcSXlF8Jui28mQh7Py8MyCKR X-Gm-Gg: ASbGncsUaqHboVHU3OC80d5dSkxOnp1AV8fu+8xRsrd3k6ePAr1zvNDpk+/OGY8MtnQ wRNzYiMiOrId6Q9RdN3GsOick2OZpNarM8Lk/oaoexoX4pT9S2RHoSXWrSWVcQ847atJHt1ay/Y om7joctMKKZRrtfa1maN5KqmalBetLPl7QhtlHBPl6WyxF3okiyZuwN1MWMYdtuIA8udsBJByAh RU+8NIHP8uytnb38nmymbra3dEEP6cpWqC0rYFUL/NFYTFX9ZJh3oHwu9a2Qx/io5XF4fv8qWxI NSvGRIim2XGy+bKoC0DS+cHnCRumTTp+nQXEzWdRrS5pH1f94CDW2kTSncmm X-Google-Smtp-Source: AGHT+IHH6838PlV8fLybCuQKTmtlr4wuX4Iicxu/alz76qxSCT/1D6LROcPF28ZZHXUn2zdsUVd3Ag== X-Received: by 2002:a05:600c:3496:b0:453:8a6:d8de with SMTP id 5b1f17b1804b1-4532907de44mr9268435e9.1.1749649214272; Wed, 11 Jun 2025 06:40:14 -0700 (PDT) Received: from rltb ([2a01:e0a:3f3:fb51:949a:873a:3ff3:56b6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a53244f02asm15205687f8f.83.2025.06.11.06.40.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jun 2025 06:40:13 -0700 (PDT) From: Robert Pluim To: Eli Zaretskii Subject: Re: bug#78714: 30.1; failure binding keys to certain unicode characters In-Reply-To: <86o6uxf05v.fsf@gnu.org> References: <87h60raam0.fsf@igel.home> <87frg987ao.fsf@gmail.com> <86o6uxf05v.fsf@gnu.org> Date: Wed, 11 Jun 2025 15:40:13 +0200 Message-ID: <87qzzq9z2a.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 78714 Cc: 78714@debbugs.gnu.org, john.g.holman@gmail.com, schwab@linux-m68k.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 78714 fixed close 78714 30.2 quit >>>>> On Mon, 09 Jun 2025 17:40:44 +0300, Eli Zaretskii said: >> Cc: 78714@debbugs.gnu.org, Andreas Schwab >> From: Robert Pluim >> Date: Mon, 09 Jun 2025 13:48:31 +0200 >> >> >>>>> On Mon, 9 Jun 2025 11:05:40 +0100, John Holman said: >> John> Many thanks Andreas - that's certainly more concise than using a lambda. John> I do think this is a trap for users who may expect that a key definition John> that a single character string simply specifies the character to be John> inserted when that key is pressed rather than a macro. Treating a string John> with a single character as a character to insert rather than a John> one-character macro might avoid that, or if that is awkward to implement or John> otherwise undesirable an explicit warning in the documentation might help. John> The documentation for define-key does say that a string is treated as a John> keyboard macro, but the significance of that is easy to miss. >> >> (info "(emacs) Init Rebinding") describes how to do this. The >> docstring for `keymap-global-set' also mentions `key-description', >> which avoids the need to manually write in vector notation, which I >> guess we could add to `keymap-set' as well. Eli> Feel free to add that. Done Robert -- Pushed to emacs-30. 1bed2949583 2025-06-11T15:34:10+02:00 "* lisp/keymap.el (keymap-set): Refer to 'key-description'. (Bug#78714)" https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=1bed29495836dab96fe642dbd6f4c1625c50b12a