* bug#64699: Invalid key definition for keymap-set-after
@ 2023-07-18 10:00 uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-18 10:29 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 7+ messages in thread
From: uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-18 10:00 UTC (permalink / raw
To: 64699
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)
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#64699: Invalid key definition for keymap-set-after
2023-07-18 10:00 bug#64699: Invalid key definition for keymap-set-after uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-07-18 10:29 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-18 12:13 ` Robert Pluim
2023-07-18 12:37 ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 2 replies; 7+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-18 10:29 UTC (permalink / raw
To: uzibalqa; +Cc: 64699-done
uzibalqa <uzibalqa@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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#64699: Invalid key definition for keymap-set-after
2023-07-18 10:29 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-07-18 12:13 ` Robert Pluim
2023-07-18 12:34 ` Christopher Dimech
2023-07-18 12:37 ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
1 sibling, 1 reply; 7+ messages in thread
From: Robert Pluim @ 2023-07-18 12:13 UTC (permalink / raw
To: 64699; +Cc: luangruo, uzibalqa
>>>>> On Tue, 18 Jul 2023 18:29:08 +0800, Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org> said:
Po Lu> The documentation does not mention or imply that `keymap-set-after'
Po Lu> accepts the same key sequence format as `define-key-after'. And indeed
Po Lu> it does not.
To be fair, we could probably do with some words about non-key events,
explaining that you need to write stuff like "<menu-bar> <mcp-topm>"
Robert
--
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#64699: Invalid key definition for keymap-set-after
2023-07-18 12:13 ` Robert Pluim
@ 2023-07-18 12:34 ` Christopher Dimech
0 siblings, 0 replies; 7+ messages in thread
From: Christopher Dimech @ 2023-07-18 12:34 UTC (permalink / raw
To: Robert Pluim; +Cc: luangruo, 64699, uzibalqa
> Sent: Wednesday, July 19, 2023 at 12:13 AM
> From: "Robert Pluim" <rpluim@gmail.com>
> To: 64699@debbugs.gnu.org
> Cc: luangruo@yahoo.com, uzibalqa@proton.me
> Subject: bug#64699: Invalid key definition for keymap-set-after
>
> >>>>> On Tue, 18 Jul 2023 18:29:08 +0800, Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org> said:
>
> Po Lu> The documentation does not mention or imply that `keymap-set-after'
> Po Lu> accepts the same key sequence format as `define-key-after'. And indeed
> Po Lu> it does not.
>
> To be fair, we could probably do with some words about non-key events,
> explaining that you need to write stuff like "<menu-bar> <mcp-topm>" - Robert
Indeed, we should. Vectors for menu items has a rather sketchy description,
requiring references that point to things all over the manual.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#64699: Invalid key definition for keymap-set-after
2023-07-18 10:29 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-18 12:13 ` Robert Pluim
@ 2023-07-18 12:37 ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-18 12:42 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
1 sibling, 1 reply; 7+ messages in thread
From: uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-18 12:37 UTC (permalink / raw
To: Po Lu; +Cc: 64699-done
------- Original Message -------
On Tuesday, July 18th, 2023 at 10:29 PM, Po Lu <luangruo@yahoo.com> wrote:
> uzibalqa uzibalqa@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.
How is it supposed to be used then. You request people to change but do net help them
move forward. What declaration would `keymap-set-after' use ?
> Closing.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#64699: Invalid key definition for keymap-set-after
2023-07-18 12:37 ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-07-18 12:42 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-18 13:03 ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 7+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-18 12:42 UTC (permalink / raw
To: uzibalqa; +Cc: 64699-done
uzibalqa <uzibalqa@proton.me> writes:
> How is it supposed to be used then. You request people to change but
> do net help them move forward. What declaration would
> `keymap-set-after' use ?
See the doc string of keymap-set-after, which mentions keymap-set...?
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#64699: Invalid key definition for keymap-set-after
2023-07-18 12:42 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-07-18 13:03 ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 0 replies; 7+ messages in thread
From: uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-18 13:03 UTC (permalink / raw
To: Po Lu; +Cc: 64699-done
------- Original Message -------
On Wednesday, July 19th, 2023 at 12:42 AM, Po Lu <luangruo@yahoo.com> wrote:
> uzibalqa uzibalqa@proton.me writes:
>
> > How is it supposed to be used then. You request people to change but
> > do net help them move forward. What declaration would
> > `keymap-set-after' use ?
>
>
> See the doc string of keymap-set-after, which mentions keymap-set...?
Be sensible now. You expect me to figure it out myself notwithstanding the
fact surrounding the difficulty composing new functions for the specific task
of making menus. There is no way to successfully decipher anything from the
docstring that is practical to the task. It does not even mention menus.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-07-18 13:03 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-18 10:00 bug#64699: Invalid key definition for keymap-set-after uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-18 10:29 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-18 12:13 ` Robert Pluim
2023-07-18 12:34 ` Christopher Dimech
2023-07-18 12:37 ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-18 12:42 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-18 13:03 ` uzibalqa via Bug reports for GNU Emacs, the Swiss army knife of text editors
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).