Package: emacs;
Reported by: uzibalqa <uzibalqa <at> proton.me>
Date: Tue, 18 Jul 2023 10:01:02 UTC
Severity: normal
Done: Po Lu <luangruo <at> yahoo.com>
Bug is archived. No further changes may be made.
View this message in rfc822 format
From: help-debbugs <at> gnu.org (GNU bug Tracking System) To: uzibalqa <uzibalqa <at> proton.me> Subject: bug#64699: closed (Re: bug#64699: Invalid key definition for keymap-set-after) Date: Tue, 18 Jul 2023 10:30:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report #64699: Invalid key definition for keymap-set-after which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 64699 <at> debbugs.gnu.org. -- 64699: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=64699 GNU Bug Tracking System Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Po Lu <luangruo <at> yahoo.com> To: uzibalqa <uzibalqa <at> proton.me> Cc: 64699-done <at> debbugs.gnu.org Subject: Re: bug#64699: Invalid key definition for keymap-set-after Date: Tue, 18 Jul 2023 18:29:08 +0800uzibalqa <uzibalqa <at> proton.me> writes: > It is recommended that 'keymap-set-after' is used instead of 'define-key-after'. > > But replacing > > (defvar mcp-kdf (make-sparse-keymap "MCP")) > (define-key-after global-map > [menu-bar mcp-topm] (cons "MCP" mcp-kdf) 'tools) > > with > > (defvar mcp-kdf (make-sparse-keymap "MCP")) > (keymap-set-after global-map > [menu-bar mcp-topm] (cons "MCP" mcp-kdf) 'tools) > > gives the following error > > (error "[menu-bar mcp-topm] is not a valid key definition;...") > signal(error ("[menu-bar mcp-topm] is not a valid key definition;...")) > error("%S is not a valid key definition; see `key-valid-p..." [menu-bar mcp-topm]) > keymap--check([menu-bar mcp-topm]) > keymap-set-after((keymap #^[nil nil keymap > #^^[3 0 set-mark-command move-beginning-of-line backward-char mode-specific-command-prefix delete-char move-end-of-line forward-char keyboard-quit help-command indent-for-tab-command electric-newline-and-maybe-indent kill-line recenter-top-bottom newline next-line open-line previous-line quoted-insert isearch-backward isearch-forward transpose-chars universal-argument scroll-up-command kill-region Control-X-prefix yank suspend-frame ESC-prefix toggle-input-method abort-recursive-edit nil undo self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command ...] #^^[1 0 #^^[2 0 > #^^[3 0 set-mark-command move-beginning-of-line backward-char mode-specific-command-prefix delete-char move-end-of-line forward-char keyboard-quit help-command indent-for-tab-command electric-newline-and-maybe-indent kill-line recenter-top-bottom newline next-line open-line previous-line quoted-insert isearch-backward isearch-forward transpose-chars universal-argument scroll-up-command kill-region Control-X-prefix yank suspend-frame ESC-prefix toggle-input-method abort-recursive-edit nil undo self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command ...] self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command] self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command] self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command ...] (67108908 . text-scale-decrease) (67108910 . text-scale-increase) (f5 . modus-themes-toggle) (paste . clipboard-yank) (copy . clipboard-kill-ring-save) (cut . clipboard-kill-region) (f18 . clipboard-yank) (f16 . clipboard-kill-ring-save) (f20 . clipboard-kill-region) (C-wheel-down . mouse-wheel-text-scale) (C-wheel-up . mouse-wheel-text-scale) (C-mouse-5 . mouse-wheel-text-scale) (C-mouse-4 . mouse-wheel-text-scale) (C-M-wheel-down . mouse-wheel-global-text-scale) (C-M-wheel-up . mouse-wheel-global-text-scale) (C-M-mouse-5 . mouse-wheel-global-text-scale) (C-M-mouse-4 . mouse-wheel-global-text-scale) (M-wheel-right . mwheel-scroll) (M-wheel-left . mwheel-scroll) (M-wheel-down . mwheel-scroll) (M-wheel-up . mwheel-scroll) (M-mouse-7 . mwheel-scroll) (M-mouse-6 . mwheel-scroll) (M-mouse-5 . mwheel-scroll) (M-mouse-4 . mwheel-scroll) (S-wheel-right . mwheel-scroll) (S-wheel-left . mwheel-scroll) (S-wheel-down . mwheel-scroll) (S-wheel-up . mwheel-scroll) (S-mouse-7 . mwheel-scroll) (S-mouse-6 . mwheel-scroll) (S-mouse-5 . mwheel-scroll) (S-mouse-4 . mwheel-scroll) (wheel-right . mwheel-scroll) (wheel-left . mwheel-scroll) (wheel-down . mwheel-scroll) ...) [menu-bar mcp-topm] ("MCP" keymap "MCP") tools) > mcp-menubar() > eval-buffer(#<buffer *load*-661928> nil "/home/hagbard/Opstk/bin/gungadin-1.0/typex/oktant/..." nil t) ; Reading at buffer position 10068 > load-with-code-conversion("/home/hagbard/Opstk/bin/gungadin-1.0/typex/oktant/..." "/home/hagbard/Opstk/bin/gungadin-1.0/typex/oktant/..." nil t) > require(mcp) The documentation does not mention or imply that `keymap-set-after' accepts the same key sequence format as `define-key-after'. And indeed it does not. Closing.
[Message part 3 (message/rfc822, inline)]
From: uzibalqa <uzibalqa <at> proton.me> To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org> Subject: Invalid key definition for keymap-set-after Date: Tue, 18 Jul 2023 10:00:06 +0000It is recommended that 'keymap-set-after' is used instead of 'define-key-after'. But replacing (defvar mcp-kdf (make-sparse-keymap "MCP")) (define-key-after global-map [menu-bar mcp-topm] (cons "MCP" mcp-kdf) 'tools) with (defvar mcp-kdf (make-sparse-keymap "MCP")) (keymap-set-after global-map [menu-bar mcp-topm] (cons "MCP" mcp-kdf) 'tools) gives the following error (error "[menu-bar mcp-topm] is not a valid key definition;...") signal(error ("[menu-bar mcp-topm] is not a valid key definition;...")) error("%S is not a valid key definition; see `key-valid-p..." [menu-bar mcp-topm]) keymap--check([menu-bar mcp-topm]) keymap-set-after((keymap #^[nil nil keymap #^^[3 0 set-mark-command move-beginning-of-line backward-char mode-specific-command-prefix delete-char move-end-of-line forward-char keyboard-quit help-command indent-for-tab-command electric-newline-and-maybe-indent kill-line recenter-top-bottom newline next-line open-line previous-line quoted-insert isearch-backward isearch-forward transpose-chars universal-argument scroll-up-command kill-region Control-X-prefix yank suspend-frame ESC-prefix toggle-input-method abort-recursive-edit nil undo self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command ...] #^^[1 0 #^^[2 0 #^^[3 0 set-mark-command move-beginning-of-line backward-char mode-specific-command-prefix delete-char move-end-of-line forward-char keyboard-quit help-command indent-for-tab-command electric-newline-and-maybe-indent kill-line recenter-top-bottom newline next-line open-line previous-line quoted-insert isearch-backward isearch-forward transpose-chars universal-argument scroll-up-command kill-region Control-X-prefix yank suspend-frame ESC-prefix toggle-input-method abort-recursive-edit nil undo self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command ...] self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command] self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command] self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command ...] (67108908 . text-scale-decrease) (67108910 . text-scale-increase) (f5 . modus-themes-toggle) (paste . clipboard-yank) (copy . clipboard-kill-ring-save) (cut . clipboard-kill-region) (f18 . clipboard-yank) (f16 . clipboard-kill-ring-save) (f20 . clipboard-kill-region) (C-wheel-down . mouse-wheel-text-scale) (C-wheel-up . mouse-wheel-text-scale) (C-mouse-5 . mouse-wheel-text-scale) (C-mouse-4 . mouse-wheel-text-scale) (C-M-wheel-down . mouse-wheel-global-text-scale) (C-M-wheel-up . mouse-wheel-global-text-scale) (C-M-mouse-5 . mouse-wheel-global-text-scale) (C-M-mouse-4 . mouse-wheel-global-text-scale) (M-wheel-right . mwheel-scroll) (M-wheel-left . mwheel-scroll) (M-wheel-down . mwheel-scroll) (M-wheel-up . mwheel-scroll) (M-mouse-7 . mwheel-scroll) (M-mouse-6 . mwheel-scroll) (M-mouse-5 . mwheel-scroll) (M-mouse-4 . mwheel-scroll) (S-wheel-right . mwheel-scroll) (S-wheel-left . mwheel-scroll) (S-wheel-down . mwheel-scroll) (S-wheel-up . mwheel-scroll) (S-mouse-7 . mwheel-scroll) (S-mouse-6 . mwheel-scroll) (S-mouse-5 . mwheel-scroll) (S-mouse-4 . mwheel-scroll) (wheel-right . mwheel-scroll) (wheel-left . mwheel-scroll) (wheel-down . mwheel-scroll) ...) [menu-bar mcp-topm] ("MCP" keymap "MCP") tools) mcp-menubar() eval-buffer(#<buffer *load*-661928> nil "/home/hagbard/Opstk/bin/gungadin-1.0/typex/oktant/..." nil t) ; Reading at buffer position 10068 load-with-code-conversion("/home/hagbard/Opstk/bin/gungadin-1.0/typex/oktant/..." "/home/hagbard/Opstk/bin/gungadin-1.0/typex/oktant/..." nil t) require(mcp)
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.