GNU bug report logs - #61548
30.0.50; Command 'keymap-global-set' fails when called interactively

Previous Next

Package: emacs;

Reported by: phantom <at> syslbnth.com

Date: Thu, 16 Feb 2023 08:13:01 UTC

Severity: normal

Found in version 30.0.50

To reply to this bug, email your comments to 61548 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#61548; Package emacs. (Thu, 16 Feb 2023 08:13:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to phantom <at> syslbnth.com:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 16 Feb 2023 08:13:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: phantom <at> syslbnth.com
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; Command 'keymap-global-set' fails when called interactively
Date: Thu, 16 Feb 2023 00:37:58 -0500
Calling 'keymap-global-set' interactively fails with the message

  keymap--check: INPUT is not a valid key definition; see ‘key-valid-p’

where INPUT is the printed representation of the key sequence entered,
unless that sequence is a single unmodified key. And even among those, I
only know alphanumeric keys to be exempt; <f6>, <Scroll_Lock> and
anything you have to put in <brackets> will cause trouble.

From 'emacs -Q', simply type

  M-x keymap-global-set RET

The problem is that the output from 'read-key-sequence', which is called
by 'keymap-global-set', is not filtered through 'key-description' before
being assigned to KEY:

  (interactive
   (let* ((menu-prompting nil)
          (key (read-key-sequence "Set key globally: " nil t))) ; error
     (list key
           (read-command (format "Set key %s to command: "
                                 (key-description key))))))

This mistake is not made in 'keymap-global-lookup', 'keymap-global-unset',
or any other command I'm aware of. It's easy to fix, and I'd corrected
it in my own build of Emacs, though I've since reverted to an unmodified
build.

In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.35, cairo version 1.17.6) of 2023-02-15 built on nexus
Repository revision: fbbf3610fd5b27873e13cfd7702d5b0bbb15c2f8
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101006
System Description: Gentoo Linux

Configured using:
 'configure --with-mailutils --with-cairo --with-native-compilation=aot
 --with-modules --with-x-toolkit=gtk --with-imagemagick'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ
IMAGEMAGICK JPEG JSON LCMS2 LIBOTF LIBXML2 MODULES NATIVE_COMP NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

Important settings:
  value of $LC_COLLATE: C
  value of $LANG: en_US.utf8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  windmove-mode: t
  server-mode: t
  shell-dirtrack-mode: t
  minibuffer-depth-indicate-mode: t
  global-visible-mark-mode: t
  visible-mark-mode: t
  corfu-global-mode: t
  corfu-mode: t
  fido-vertical-mode: t
  icomplete-vertical-mode: t
  icomplete-mode: t
  fido-mode: t
  which-key-mode: t
  global-auto-revert-mode: t
  save-place-mode: t
  recentf-mode: t
  savehist-mode: t
  global-so-long-mode: t
  global-display-line-numbers-mode: t
  display-line-numbers-mode: t
  winner-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tab-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  column-number-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/phantom/.emacs.d/elpa/transient-20221202.1727/transient hides /usr/local/share/emacs/30.0.50/lisp/transient
/home/phantom/.emacs.d/elpa/use-package-20221209.2013/use-package-diminish hides /usr/local/share/emacs/30.0.50/lisp/use-package/use-package-diminish
/home/phantom/.emacs.d/elpa/use-package-20221209.2013/use-package-core hides /usr/local/share/emacs/30.0.50/lisp/use-package/use-package-core
/home/phantom/.emacs.d/elpa/use-package-20221209.2013/use-package-jump hides /usr/local/share/emacs/30.0.50/lisp/use-package/use-package-jump
/home/phantom/.emacs.d/elpa/use-package-20221209.2013/use-package-bind-key hides /usr/local/share/emacs/30.0.50/lisp/use-package/use-package-bind-key
/home/phantom/.emacs.d/elpa/use-package-20221209.2013/use-package-delight hides /usr/local/share/emacs/30.0.50/lisp/use-package/use-package-delight
/home/phantom/.emacs.d/elpa/use-package-20221209.2013/use-package-ensure hides /usr/local/share/emacs/30.0.50/lisp/use-package/use-package-ensure
/home/phantom/.emacs.d/elpa/use-package-20221209.2013/use-package-lint hides /usr/local/share/emacs/30.0.50/lisp/use-package/use-package-lint
/home/phantom/.emacs.d/elpa/use-package-20221209.2013/use-package hides /usr/local/share/emacs/30.0.50/lisp/use-package/use-package
/home/phantom/.emacs.d/elpa/eglot-20220415.1822/eglot hides /usr/local/share/emacs/30.0.50/lisp/progmodes/eglot

Features:
(shadow emacsbug magit-base magit-section crm mule-util jka-compr
shortdoc mailalias smtpmail textsec uni-scripts idna-mapping
ucs-normalize uni-confusable textsec-check sort gnus-cite nndraft nnmh
nnfolder utf-7 network-stream nsm gnus-agent gnus-srvr gnus-score
score-mode nnvirtual nntp gnus-cache mail-extr gnus-msg gnus-art mm-uu
mml2015 mm-view mml-smime smime gnutls dig gnus-sum shr pixel-fill
kinsoku url-file svg dom gnus-group gnus-undo gnus-start gnus-dbus dbus
xml gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time iso8601
gnus-spec gnus-int gnus-range gnus-win message sendmail yank-media puny
rfc822 mml mml-sec epa derived epg rfc6068 epg-config mm-decode
mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums
mailabbrev gmm-utils mailheader gnus nnheader gnus-util
text-property-search mail-utils range mm-util mail-prsvr windmove pp
time-date exwm exwm-input xcb-keysyms xcb-xkb exwm-manage exwm-floating
xcb-cursor xcb-render exwm-layout exwm-workspace exwm-core xcb-ewmh
xcb-icccm xcb xcb-xproto xcb-types xcb-debug server dired-aux
modus-vivendi-theme modus-themes comp comp-cstr warnings focus thingatpt
midnight term disp-table shell pcomplete ehelp comint ansi-osc
ansi-color edmacro kmacro dash use-package use-package-ensure
use-package-delight use-package-diminish use-package-bind-key
use-package-core finder-inf mb-depth visible-mark corfu icomplete
which-key autorevert filenotify saveplace recentf tree-widget wid-edit
savehist so-long cl-extra icons display-line-numbers winner dired
dired-loaddefs bind-key easy-mmode pcase mastodon-autoloads
rainbow-delimiters-autoloads which-key-autoloads company-autoloads
focus-autoloads exwm-autoloads rx minimap-autoloads sicp-autoloads
debbugs-autoloads geiser-guile-autoloads geiser-impl help-fns radix-tree
help-mode geiser-custom geiser-base ring use-package-autoloads
keepass-mode-autoloads projectile-autoloads dynamic-ruler-autoloads
ivy-autoloads request-autoloads transient-autoloads
weather-metno-autoloads caps-lock-autoloads persist-autoloads
yasnippet-snippets-autoloads yasnippet-autoloads typit-autoloads
f-autoloads slime-autoloads vertico-autoloads mmt-autoloads
with-editor-autoloads compat-autoloads ts-autoloads s-autoloads info
visible-mark-autoloads vterm-autoloads package browse-url url url-proxy
url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x
map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc
iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd 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 dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 721742 75952)
 (symbols 48 36290 3)
 (strings 32 157373 10554)
 (string-bytes 1 4628365)
 (vectors 16 87620)
 (vector-slots 8 1674405 98457)
 (floats 8 432 459)
 (intervals 56 1790 2)
 (buffers 992 26))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61548; Package emacs. (Thu, 16 Feb 2023 08:43:02 GMT) Full text and rfc822 format available.

Message #8 received at 61548 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: phantom <at> syslbnth.com
Cc: 61548 <at> debbugs.gnu.org
Subject: Re: bug#61548: 30.0.50;
 Command 'keymap-global-set' fails when called interactively
Date: Thu, 16 Feb 2023 10:42:21 +0200
> From: phantom <at> syslbnth.com
> Date: Thu, 16 Feb 2023 00:37:58 -0500
> 
> Calling 'keymap-global-set' interactively fails with the message
> 
>   keymap--check: INPUT is not a valid key definition; see ‘key-valid-p’
> 
> where INPUT is the printed representation of the key sequence entered,
> unless that sequence is a single unmodified key. And even among those, I
> only know alphanumeric keys to be exempt; <f6>, <Scroll_Lock> and
> anything you have to put in <brackets> will cause trouble.
> 
> >From 'emacs -Q', simply type
> 
>   M-x keymap-global-set RET

You mean, you get the error after typing "M-x keymap-global-set RET"?
If so, I cannot reproduce this with today's master.  I did:

  emacs -Q
  M-x keymap-global-set RET
  C-x g
  goto-char RET

(where "C-x g" is a key sequence, i.e. press Ctrl and x, then press g)
and didn't see any errors.

> The problem is that the output from 'read-key-sequence', which is called
> by 'keymap-global-set', is not filtered through 'key-description' before
> being assigned to KEY:
> 
>   (interactive
>    (let* ((menu-prompting nil)
>           (key (read-key-sequence "Set key globally: " nil t))) ; error
>      (list key
>            (read-command (format "Set key %s to command: "
>                                  (key-description key))))))

This code is not in the current function on the master branch.  Are
you sure your sources are up to date?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61548; Package emacs. (Thu, 16 Feb 2023 11:38:02 GMT) Full text and rfc822 format available.

Message #11 received at 61548 <at> debbugs.gnu.org (full text, mbox):

From: Ruijie Yu <ruijie <at> netyu.xyz>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: phantom <at> syslbnth.com, 61548 <at> debbugs.gnu.org
Subject: Re: bug#61548: 30.0.50; Command 'keymap-global-set' fails when
 called interactively
Date: Thu, 16 Feb 2023 19:33:15 +0800
>> Repository revision: fbbf3610fd5b27873e13cfd7702d5b0bbb15c2f8

Eli Zaretskii <eliz <at> gnu.org> writes:

> [...]
> This code is not in the current function on the master branch.  Are
> you sure your sources are up to date?

Looking at the git history, it seems that this commit was made on
2022-12-09 -- quite an old commit.  This issue has probably been fixed
between then and now, and possibly by bug#61184 (searching for "keymap"
on subjects).

--
Best,


RY




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61548; Package emacs. (Thu, 16 Feb 2023 11:44:02 GMT) Full text and rfc822 format available.

Message #14 received at 61548 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Ruijie Yu <ruijie <at> netyu.xyz>, phantom <at> syslbnth.com, 61548 <at> debbugs.gnu.org
Subject: Re: bug#61548: 30.0.50; Command 'keymap-global-set' fails when
 called interactively
Date: Thu, 16 Feb 2023 12:43:48 +0100
>>>>> On Thu, 16 Feb 2023 19:33:15 +0800, Ruijie Yu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org> said:

    >>> Repository revision: fbbf3610fd5b27873e13cfd7702d5b0bbb15c2f8

    RY> Eli Zaretskii <eliz <at> gnu.org> writes:

    >> [...]
    >> This code is not in the current function on the master branch.  Are
    >> you sure your sources are up to date?

    RY> Looking at the git history, it seems that this commit was made on
    RY> 2022-12-09 -- quite an old commit.  This issue has probably been fixed
    RY> between then and now, and possibly by bug#61184 (searching for "keymap"
    RY> on subjects).

Bug#61149 (Bug#61184 was Eli fixing another bug found during fixing it)

Robert
-- 




This bug report was last modified 1 year and 64 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.