* Howto: Bind Windows key as a prefix?
@ 2022-07-05 18:17 T.V Raman
2022-07-05 18:35 ` T.V Raman
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: T.V Raman @ 2022-07-05 18:17 UTC (permalink / raw)
To: emacs-devel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 13271 bytes --]
On my laptop,
pressing windows-key+<c> says
s-<c> is undefined for any <c>.
M-x global-set-key RET
windows+<c> RET
command RET
binds windows-<c>
and asking where is <command> shows it as being on s-<c>.
However calling global-set-key with "s-<c>" bombs with key-sequence
"s-<c>" starts with non-prefix s"
Debugger entered--Lisp error: (error "Key sequence s - a starts with non-prefix key s")
(define-key (keymap #^[nil nil keymap
#^^[3 0 set-mark-command move-beginning-of-line backward-char mode-specific-command-prefix delete-char emacspeak-prefix-command forward-char keyboard-quit help-command indent-for-tab-command electric-newline-and-maybe-indent kill-line recenter-top-bottom newline next-line (keymap (32 . emacspeak-outline-speak-this-heading) (102 . emacspeak-outline-speak-forward-heading) (98 . emacspeak-outline-speak-backward-heading) (110 . emacspeak-outline-speak-next-heading) (112 . emacspeak-outline-speak-previous-heading) (111 . open-line) (13 . outline-insert-heading) (67108926 . outline-demote) (67108924 . outline-promote) (22 . outline-move-subtree-down) (30 . outline-move-subtree-up) (15 . outline-hide-other) (17 . outline-hide-sublevels) (11 . outline-show-branches) (12 . outline-hide-leaves) (5 . outline-show-entry) (3 . outline-hide-entry) (1 . outline-show-all) (20 . outline-hide-body) (2 . outline-backward-same-level) (6 . outline-forward-same-level) (21 . outline-up-heading) (4 . outline-hide-subtree) (19 . outline-show-subtree) (9 . outline-show-children) (16 . outline-previous-visible-heading) (14 . outline-next-visible-heading) (64 . outline-mark-subtree)) previous-line quoted-insert isearch-backward isearch-forward transpose-chars universal-argument scroll-up-command kill-region Control-X-prefix emacspeak-muggles-yank-pop/yank emacspeak-ctl-z-keymap ESC-prefix toggle-input-method abort-recursive-edit nil ...] #^^[1 0 #^^[2 0
#^^[3 0 set-mark-command move-beginning-of-line backward-char mode-specific-command-prefix delete-char emacspeak-prefix-command forward-char keyboard-quit help-command indent-for-tab-command electric-newline-and-maybe-indent kill-line recenter-top-bottom newline next-line (keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) previous-line quoted-insert isearch-backward isearch-forward transpose-chars universal-argument scroll-up-command kill-region Control-X-prefix emacspeak-muggles-yank-pop/yank emacspeak-ctl-z-keymap ESC-prefix toggle-input-method abort-recursive-edit nil ...] self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command ...] self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command] self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command ...] (8388716 . ansi-term) (8388640 . emacspeak-muggles-maths-navigator/body) (8388718 . emacspeak-muggles-navigate/body) (print . emacspeak-muggles-brightness/body) (f14 . kmacro-end-or-call-macro) (f13 . kmacro-start-macro-or-insert-counter) (S-mouse-3 . kmacro-end-call-mouse) (C-S-iso-lefttab . tab-previous) (C-S-tab . tab-previous) (C-tab . tab-next) (f5 . find-file) (remap keymap (dabbrev-expand . hippie-expand)) (silence . emacspeak-silence) (67108903 . emacspeak-multi-keymap) (67108923 . emacspeak-hyper-keymap) (67108910 . emacspeak-super-keymap) (67108908 . emacspeak-alt-keymap) (S-down . emacspeak-skip-blank-lines-forward) (S-up . emacspeak-skip-blank-lines-backward) (S-right . next-buffer) (S-left . previous-buffer) (XF86AudioRaiseVolume . amixer-volume-up) (XF86AudioLowerVolume . amixer-volume-down) (C-f2 . amixer-volume-down) (C-f1 . amixer-volume-up) (XF86AudioPlay . emacspeak-silence) (paste . clipboard-yank) (copy . clipboard-kill-ring-save) (cut . clipboard-kill-region) (f18 . clipboard-yank) ...) "s-a" ansi-term)
(#f(compiled-function (key command) "Give KEY a global binding as COMMAND.\nThis is a legacy function; see `keymap-global-set' for the\nrecommended function to use instead.\n\nCOMMAND is the command definition to use; usually it is\na symbol naming an interactively-callable function.\nKEY is a key sequence; noninteractively, it is a string or vector\nof characters or event types, and non-ASCII characters with codes\nabove 127 (such as ISO Latin-1) can be included if you use a vector.\n\nNote that if KEY has a local binding in the current buffer,\nthat local binding will continue to shadow any global binding\nthat you make with this function." (interactive #f(compiled-function () #<bytecode 0x1c12d585360c8f11>)) #<bytecode 0xb0d11433d0335b6>) "s-a" ansi-term)
(ad-Advice-global-set-key #f(compiled-function (key command) "Give KEY a global binding as COMMAND.\nThis is a legacy function; see `keymap-global-set' for the\nrecommended function to use instead.\n\nCOMMAND is the command definition to use; usually it is\na symbol naming an interactively-callable function.\nKEY is a key sequence; noninteractively, it is a string or vector\nof characters or event types, and non-ASCII characters with codes\nabove 127 (such as ISO Latin-1) can be included if you use a vector.\n\nNote that if KEY has a local binding in the current buffer,\nthat local binding will continue to shadow any global binding\nthat you make with this function." (interactive #f(compiled-function () #<bytecode 0x1c12d585360c8f11>)) #<bytecode 0xb0d11433d0335b6>) "s-a" ansi-term)
(apply ad-Advice-global-set-key #f(compiled-function (key command) "Give KEY a global binding as COMMAND.\nThis is a legacy function; see `keymap-global-set' for the\nrecommended function to use instead.\n\nCOMMAND is the command definition to use; usually it is\na symbol naming an interactively-callable function.\nKEY is a key sequence; noninteractively, it is a string or vector\nof characters or event types, and non-ASCII characters with codes\nabove 127 (such as ISO Latin-1) can be included if you use a vector.\n\nNote that if KEY has a local binding in the current buffer,\nthat local binding will continue to shadow any global binding\nthat you make with this function." (interactive #f(compiled-function () #<bytecode 0x1c12d585360c8f11>)) #<bytecode 0xb0d11433d0335b6>) ("s-a" ansi-term))
(global-set-key "s-a" ansi-term)
(eval (global-set-key "s-a" 'ansi-term) t)
(#f(compiled-function (exp &optional insert-value no-truncate char-print-limit) "Evaluate EXP and print value in the echo area.\nWhen called interactively, read an Emacs Lisp expression and\nevaluate it. Value is also consed on to front of the variable\n`values'. Optional argument INSERT-VALUE non-nil (interactively,\nwith a non `-' prefix argument) means insert the result into the\ncurrent buffer instead of printing it in the echo area.\n\nNormally, this function truncates long output according to the\nvalue of the variables `eval-expression-print-length' and\n`eval-expression-print-level'. When NO-TRUNCATE is\nnon-nil (interactively, with a prefix argument of zero), however,\nthere is no such truncation.\n\nIf the resulting value is an integer, and CHAR-PRINT-LIMIT is\nnon-nil (interactively, unless given a non-zero prefix argument)\nit will be printed in several additional formats (octal,\nhexadecimal, and character). The character format is used only\nif the value is below CHAR-PRINT-LIMIT (interactively, if the\nprefix argument is -1 or the value doesn't exceed\n`eval-expression-print-maximum-character').\n\nRuns the hook `eval-expression-minibuffer-setup-hook' on entering the\nminibuffer.\n\nIf `eval-expression-debug-on-error' is non-nil, which is the default,\nthis command arranges for all errors to enter the debugger." (interactive #f(compiled-function () #<bytecode -0x459e253eac81345>)) #<bytecode -0xc624bdd988e525e>) (global-set-key "s-a" 'ansi-term) nil nil 127)
(ad-Advice-eval-expression #f(compiled-function (exp &optional insert-value no-truncate char-print-limit) "Evaluate EXP and print value in the echo area.\nWhen called interactively, read an Emacs Lisp expression and\nevaluate it. Value is also consed on to front of the variable\n`values'. Optional argument INSERT-VALUE non-nil (interactively,\nwith a non `-' prefix argument) means insert the result into the\ncurrent buffer instead of printing it in the echo area.\n\nNormally, this function truncates long output according to the\nvalue of the variables `eval-expression-print-length' and\n`eval-expression-print-level'. When NO-TRUNCATE is\nnon-nil (interactively, with a prefix argument of zero), however,\nthere is no such truncation.\n\nIf the resulting value is an integer, and CHAR-PRINT-LIMIT is\nnon-nil (interactively, unless given a non-zero prefix argument)\nit will be printed in several additional formats (octal,\nhexadecimal, and character). The character format is used only\nif the value is below CHAR-PRINT-LIMIT (interactively, if the\nprefix argument is -1 or the value doesn't exceed\n`eval-expression-print-maximum-character').\n\nRuns the hook `eval-expression-minibuffer-setup-hook' on entering the\nminibuffer.\n\nIf `eval-expression-debug-on-error' is non-nil, which is the default,\nthis command arranges for all errors to enter the debugger." (interactive #f(compiled-function () #<bytecode -0x459e253eac81345>)) #<bytecode -0xc624bdd988e525e>) (global-set-key "s-a" 'ansi-term) nil nil 127)
(apply ad-Advice-eval-expression #f(compiled-function (exp &optional insert-value no-truncate char-print-limit) "Evaluate EXP and print value in the echo area.\nWhen called interactively, read an Emacs Lisp expression and\nevaluate it. Value is also consed on to front of the variable\n`values'. Optional argument INSERT-VALUE non-nil (interactively,\nwith a non `-' prefix argument) means insert the result into the\ncurrent buffer instead of printing it in the echo area.\n\nNormally, this function truncates long output according to the\nvalue of the variables `eval-expression-print-length' and\n`eval-expression-print-level'. When NO-TRUNCATE is\nnon-nil (interactively, with a prefix argument of zero), however,\nthere is no such truncation.\n\nIf the resulting value is an integer, and CHAR-PRINT-LIMIT is\nnon-nil (interactively, unless given a non-zero prefix argument)\nit will be printed in several additional formats (octal,\nhexadecimal, and character). The character format is used only\nif the value is below CHAR-PRINT-LIMIT (interactively, if the\nprefix argument is -1 or the value doesn't exceed\n`eval-expression-print-maximum-character').\n\nRuns the hook `eval-expression-minibuffer-setup-hook' on entering the\nminibuffer.\n\nIf `eval-expression-debug-on-error' is non-nil, which is the default,\nthis command arranges for all errors to enter the debugger." (interactive #f(compiled-function () #<bytecode -0x459e253eac81345>)) #<bytecode -0xc624bdd988e525e>) ((global-set-key "s-a" 'ansi-term) nil nil 127))
(eval-expression (global-set-key "s-a" 'ansi-term) nil nil 127)
(#<subr funcall-interactively> eval-expression (global-set-key "s-a" 'ansi-term) nil nil 127)
(apply #<subr funcall-interactively> eval-expression ((global-set-key "s-a" 'ansi-term) nil nil 127))
(ad-Advice-funcall-interactively #<subr funcall-interactively> eval-expression (global-set-key "s-a" 'ansi-term) nil nil 127)
(apply ad-Advice-funcall-interactively #<subr funcall-interactively> (eval-expression (global-set-key "s-a" 'ansi-term) nil nil 127))
(funcall-interactively eval-expression (global-set-key "s-a" 'ansi-term) nil nil 127)
(#<subr call-interactively> eval-expression nil nil)
(apply #<subr call-interactively> eval-expression (nil nil))
(call-interactively@ido-cr+-record-current-command #<subr call-interactively> eval-expression nil nil)
(apply call-interactively@ido-cr+-record-current-command #<subr call-interactively> (eval-expression nil nil))
(call-interactively eval-expression nil nil)
(command-execute eval-expression)
--
Thanks,
--Raman(I Search, I Find, I Misplace, I Research)
â Id: kg:/m/0285kf1 ð¦®N\x16§ÄZ©ÈIæ«r\x12\x05wH2+)§\x1e!\x17¬yªÜdù¿Óo9ý
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Howto: Bind Windows key as a prefix?
2022-07-05 18:17 Howto: Bind Windows key as a prefix? T.V Raman
@ 2022-07-05 18:35 ` T.V Raman
2022-07-05 18:37 ` Akib Azmain Turja
2022-07-05 20:09 ` Stefan Monnier
2 siblings, 0 replies; 6+ messages in thread
From: T.V Raman @ 2022-07-05 18:35 UTC (permalink / raw)
To: emacs-devel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=gb18030, Size: 264 bytes --]
And following-up to myself:
The section in the elisp info manual that talks about super etc, did not
help -- it suggested \s as in \H, but \ turns into SPC
--
Thanks,
--Raman(I Search, I Find, I Misplace, I Research)
7©4 Id: kg:/m/0285kf1 0Ü8
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Howto: Bind Windows key as a prefix?
2022-07-05 18:17 Howto: Bind Windows key as a prefix? T.V Raman
2022-07-05 18:35 ` T.V Raman
@ 2022-07-05 18:37 ` Akib Azmain Turja
2022-07-05 18:40 ` Akib Azmain Turja
2022-07-05 20:09 ` Stefan Monnier
2 siblings, 1 reply; 6+ messages in thread
From: Akib Azmain Turja @ 2022-07-05 18:37 UTC (permalink / raw)
To: T.V Raman, emacs-devel
[-- Attachment #1: Type: text/plain, Size: 13652 bytes --]
"T.V Raman" <raman@google.com> writes:
> On my laptop,
> pressing windows-key+<c> says
> s-<c> is undefined for any <c>.
>
> M-x global-set-key RET
> windows+<c> RET
> command RET
> binds windows-<c>
> and asking where is <command> shows it as being on s-<c>.
>
> However calling global-set-key with "s-<c>" bombs with key-sequence
> "s-<c>" starts with non-prefix s"
>
> Debugger entered--Lisp error: (error "Key sequence s - a starts with non-prefix key s")
> (define-key (keymap #^[nil nil keymap
> #^^[3 0 set-mark-command move-beginning-of-line backward-char mode-specific-command-prefix delete-char emacspeak-prefix-command forward-char keyboard-quit help-command indent-for-tab-command electric-newline-and-maybe-indent kill-line recenter-top-bottom newline next-line (keymap (32 . emacspeak-outline-speak-this-heading) (102 . emacspeak-outline-speak-forward-heading) (98 . emacspeak-outline-speak-backward-heading) (110 . emacspeak-outline-speak-next-heading) (112 . emacspeak-outline-speak-previous-heading) (111 . open-line) (13 . outline-insert-heading) (67108926 . outline-demote) (67108924 . outline-promote) (22 . outline-move-subtree-down) (30 . outline-move-subtree-up) (15 . outline-hide-other) (17 . outline-hide-sublevels) (11 . outline-show-branches) (12 . outline-hide-leaves) (5 . outline-show-entry) (3 . outline-hide-entry) (1 . outline-show-all) (20 . outline-hide-body) (2 . outline-backward-same-level) (6 . outline-forward-same-level) (21 . outline-up-heading) (4 . outline-hide-subtree) (19 . outline-show-subtree) (9 . outline-show-children) (16 . outline-previous-visible-heading) (14 . outline-next-visible-heading) (64 . outline-mark-subtree)) previous-line quoted-insert isearch-backward isearch-forward transpose-chars universal-argument scroll-up-command kill-region Control-X-prefix emacspeak-muggles-yank-pop/yank emacspeak-ctl-z-keymap ESC-prefix toggle-input-method abort-recursive-edit nil ...] #^^[1 0 #^^[2 0
> #^^[3 0 set-mark-command move-beginning-of-line backward-char mode-specific-command-prefix delete-char emacspeak-prefix-command forward-char keyboard-quit help-command indent-for-tab-command electric-newline-and-maybe-indent kill-line recenter-top-bottom newline next-line (keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) previous-line quoted-insert isearch-backward isearch-forward transpose-chars universal-argument scroll-up-command kill-region Control-X-prefix emacspeak-muggles-yank-pop/yank emacspeak-ctl-z-keymap ESC-prefix toggle-input-method abort-recursive-edit nil ...] self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command ...] self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command] self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command ...] (8388716 . ansi-term) (8388640 . emacspeak-muggles-maths-navigator/body) (8388718 . emacspeak-muggles-navigate/body) (print . emacspeak-muggles-brightness/body) (f14 . kmacro-end-or-call-macro) (f13 . kmacro-start-macro-or-insert-counter) (S-mouse-3 . kmacro-end-call-mouse) (C-S-iso-lefttab . tab-previous) (C-S-tab . tab-previous) (C-tab . tab-next) (f5 . find-file) (remap keymap (dabbrev-expand . hippie-expand)) (silence . emacspeak-silence) (67108903 . emacspeak-multi-keymap) (67108923 . emacspeak-hyper-keymap) (67108910 . emacspeak-super-keymap) (67108908 . emacspeak-alt-keymap) (S-down . emacspeak-skip-blank-lines-forward) (S-up . emacspeak-skip-blank-lines-backward) (S-right . next-buffer) (S-left . previous-buffer) (XF86AudioRaiseVolume . amixer-volume-up) (XF86AudioLowerVolume . amixer-volume-down) (C-f2 . amixer-volume-down) (C-f1 . amixer-volume-up) (XF86AudioPlay . emacspeak-silence) (paste . clipboard-yank) (copy . clipboard-kill-ring-save) (cut . clipboard-kill-region) (f18 . clipboard-yank) ...) "s-a" ansi-term)
> (#f(compiled-function (key command) "Give KEY a global binding as COMMAND.\nThis is a legacy function; see `keymap-global-set' for the\nrecommended function to use instead.\n\nCOMMAND is the command definition to use; usually it is\na symbol naming an interactively-callable function.\nKEY is a key sequence; noninteractively, it is a string or vector\nof characters or event types, and non-ASCII characters with codes\nabove 127 (such as ISO Latin-1) can be included if you use a vector.\n\nNote that if KEY has a local binding in the current buffer,\nthat local binding will continue to shadow any global binding\nthat you make with this function." (interactive #f(compiled-function () #<bytecode 0x1c12d585360c8f11>)) #<bytecode 0xb0d11433d0335b6>) "s-a" ansi-term)
> (ad-Advice-global-set-key #f(compiled-function (key command) "Give KEY a global binding as COMMAND.\nThis is a legacy function; see `keymap-global-set' for the\nrecommended function to use instead.\n\nCOMMAND is the command definition to use; usually it is\na symbol naming an interactively-callable function.\nKEY is a key sequence; noninteractively, it is a string or vector\nof characters or event types, and non-ASCII characters with codes\nabove 127 (such as ISO Latin-1) can be included if you use a vector.\n\nNote that if KEY has a local binding in the current buffer,\nthat local binding will continue to shadow any global binding\nthat you make with this function." (interactive #f(compiled-function () #<bytecode 0x1c12d585360c8f11>)) #<bytecode 0xb0d11433d0335b6>) "s-a" ansi-term)
> (apply ad-Advice-global-set-key #f(compiled-function (key command) "Give KEY a global binding as COMMAND.\nThis is a legacy function; see `keymap-global-set' for the\nrecommended function to use instead.\n\nCOMMAND is the command definition to use; usually it is\na symbol naming an interactively-callable function.\nKEY is a key sequence; noninteractively, it is a string or vector\nof characters or event types, and non-ASCII characters with codes\nabove 127 (such as ISO Latin-1) can be included if you use a vector.\n\nNote that if KEY has a local binding in the current buffer,\nthat local binding will continue to shadow any global binding\nthat you make with this function." (interactive #f(compiled-function () #<bytecode 0x1c12d585360c8f11>)) #<bytecode 0xb0d11433d0335b6>) ("s-a" ansi-term))
> (global-set-key "s-a" ansi-term)
> (eval (global-set-key "s-a" 'ansi-term) t)
> (#f(compiled-function (exp &optional insert-value no-truncate char-print-limit) "Evaluate EXP and print value in the echo area.\nWhen called interactively, read an Emacs Lisp expression and\nevaluate it. Value is also consed on to front of the variable\n`values'. Optional argument INSERT-VALUE non-nil (interactively,\nwith a non `-' prefix argument) means insert the result into the\ncurrent buffer instead of printing it in the echo area.\n\nNormally, this function truncates long output according to the\nvalue of the variables `eval-expression-print-length' and\n`eval-expression-print-level'. When NO-TRUNCATE is\nnon-nil (interactively, with a prefix argument of zero), however,\nthere is no such truncation.\n\nIf the resulting value is an integer, and CHAR-PRINT-LIMIT is\nnon-nil (interactively, unless given a non-zero prefix argument)\nit will be printed in several additional formats (octal,\nhexadecimal, and character). The character format is used only\nif the value is below CHAR-PRINT-LIMIT (interactively, if the\nprefix argument is -1 or the value doesn't exceed\n`eval-expression-print-maximum-character').\n\nRuns the hook `eval-expression-minibuffer-setup-hook' on entering the\nminibuffer.\n\nIf `eval-expression-debug-on-error' is non-nil, which is the default,\nthis command arranges for all errors to enter the debugger." (interactive #f(compiled-function () #<bytecode -0x459e253eac81345>)) #<bytecode -0xc624bdd988e525e>) (global-set-key "s-a" 'ansi-term) nil nil 127)
> (ad-Advice-eval-expression #f(compiled-function (exp &optional insert-value no-truncate char-print-limit) "Evaluate EXP and print value in the echo area.\nWhen called interactively, read an Emacs Lisp expression and\nevaluate it. Value is also consed on to front of the variable\n`values'. Optional argument INSERT-VALUE non-nil (interactively,\nwith a non `-' prefix argument) means insert the result into the\ncurrent buffer instead of printing it in the echo area.\n\nNormally, this function truncates long output according to the\nvalue of the variables `eval-expression-print-length' and\n`eval-expression-print-level'. When NO-TRUNCATE is\nnon-nil (interactively, with a prefix argument of zero), however,\nthere is no such truncation.\n\nIf the resulting value is an integer, and CHAR-PRINT-LIMIT is\nnon-nil (interactively, unless given a non-zero prefix argument)\nit will be printed in several additional formats (octal,\nhexadecimal, and character). The character format is used only\nif the value is below CHAR-PRINT-LIMIT (interactively, if the\nprefix argument is -1 or the value doesn't exceed\n`eval-expression-print-maximum-character').\n\nRuns the hook `eval-expression-minibuffer-setup-hook' on entering the\nminibuffer.\n\nIf `eval-expression-debug-on-error' is non-nil, which is the default,\nthis command arranges for all errors to enter the debugger." (interactive #f(compiled-function () #<bytecode -0x459e253eac81345>)) #<bytecode -0xc624bdd988e525e>) (global-set-key "s-a" 'ansi-term) nil nil 127)
> (apply ad-Advice-eval-expression #f(compiled-function (exp &optional insert-value no-truncate char-print-limit) "Evaluate EXP and print value in the echo area.\nWhen called interactively, read an Emacs Lisp expression and\nevaluate it. Value is also consed on to front of the variable\n`values'. Optional argument INSERT-VALUE non-nil (interactively,\nwith a non `-' prefix argument) means insert the result into the\ncurrent buffer instead of printing it in the echo area.\n\nNormally, this function truncates long output according to the\nvalue of the variables `eval-expression-print-length' and\n`eval-expression-print-level'. When NO-TRUNCATE is\nnon-nil (interactively, with a prefix argument of zero), however,\nthere is no such truncation.\n\nIf the resulting value is an integer, and CHAR-PRINT-LIMIT is\nnon-nil (interactively, unless given a non-zero prefix argument)\nit will be printed in several additional formats (octal,\nhexadecimal, and character). The character format is used only\nif the value is below CHAR-PRINT-LIMIT (interactively, if the\nprefix argument is -1 or the value doesn't exceed\n`eval-expression-print-maximum-character').\n\nRuns the hook `eval-expression-minibuffer-setup-hook' on entering the\nminibuffer.\n\nIf `eval-expression-debug-on-error' is non-nil, which is the default,\nthis command arranges for all errors to enter the debugger." (interactive #f(compiled-function () #<bytecode -0x459e253eac81345>)) #<bytecode -0xc624bdd988e525e>) ((global-set-key "s-a" 'ansi-term) nil nil 127))
> (eval-expression (global-set-key "s-a" 'ansi-term) nil nil 127)
> (#<subr funcall-interactively> eval-expression (global-set-key "s-a" 'ansi-term) nil nil 127)
> (apply #<subr funcall-interactively> eval-expression ((global-set-key "s-a" 'ansi-term) nil nil 127))
> (ad-Advice-funcall-interactively #<subr funcall-interactively> eval-expression (global-set-key "s-a" 'ansi-term) nil nil 127)
> (apply ad-Advice-funcall-interactively #<subr funcall-interactively> (eval-expression (global-set-key "s-a" 'ansi-term) nil nil 127))
> (funcall-interactively eval-expression (global-set-key "s-a" 'ansi-term) nil nil 127)
> (#<subr call-interactively> eval-expression nil nil)
> (apply #<subr call-interactively> eval-expression (nil nil))
> (call-interactively@ido-cr+-record-current-command #<subr call-interactively> eval-expression nil nil)
> (apply call-interactively@ido-cr+-record-current-command #<subr call-interactively> (eval-expression nil nil))
> (call-interactively eval-expression nil nil)
> (command-execute eval-expression)
>
> --
>
> Thanks,
>
> --Raman(I Search, I Find, I Misplace, I Research)
> ♉ Id: kg:/m/0285kf1 🦮NZIr\x05wH2+)!y܄do9
Evaluating "(global-set-key "s-a" 'ansi-term)" won't work. Try
evaluating "(global-set-key (kbd "s-a") 'ansi-term)".
--
Akib Azmain Turja
This message is signed by me with my GnuPG key. It's fingerprint is:
7001 8CE5 819F 17A3 BBA6 66AF E74F 0EFA 922A E7F5
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Howto: Bind Windows key as a prefix?
2022-07-05 18:37 ` Akib Azmain Turja
@ 2022-07-05 18:40 ` Akib Azmain Turja
0 siblings, 0 replies; 6+ messages in thread
From: Akib Azmain Turja @ 2022-07-05 18:40 UTC (permalink / raw)
To: T.V Raman, emacs-devel
[-- Attachment #1: Type: text/plain, Size: 14060 bytes --]
Akib Azmain Turja <akib@disroot.org> writes:
> "T.V Raman" <raman@google.com> writes:
>
>> On my laptop,
>> pressing windows-key+<c> says
>> s-<c> is undefined for any <c>.
>>
>> M-x global-set-key RET
>> windows+<c> RET
>> command RET
>> binds windows-<c>
>> and asking where is <command> shows it as being on s-<c>.
>>
>> However calling global-set-key with "s-<c>" bombs with key-sequence
>> "s-<c>" starts with non-prefix s"
>>
>> Debugger entered--Lisp error: (error "Key sequence s - a starts with non-prefix key s")
>> (define-key (keymap #^[nil nil keymap
>> #^^[3 0 set-mark-command move-beginning-of-line backward-char mode-specific-command-prefix delete-char emacspeak-prefix-command forward-char keyboard-quit help-command indent-for-tab-command electric-newline-and-maybe-indent kill-line recenter-top-bottom newline next-line (keymap (32 . emacspeak-outline-speak-this-heading) (102 . emacspeak-outline-speak-forward-heading) (98 . emacspeak-outline-speak-backward-heading) (110 . emacspeak-outline-speak-next-heading) (112 . emacspeak-outline-speak-previous-heading) (111 . open-line) (13 . outline-insert-heading) (67108926 . outline-demote) (67108924 . outline-promote) (22 . outline-move-subtree-down) (30 . outline-move-subtree-up) (15 . outline-hide-other) (17 . outline-hide-sublevels) (11 . outline-show-branches) (12 . outline-hide-leaves) (5 . outline-show-entry) (3 . outline-hide-entry) (1 . outline-show-all) (20 . outline-hide-body) (2 . outline-backward-same-level) (6 . outline-forward-same-level) (21 . outline-up-heading) (4 . outline-hide-subtree) (19 . outline-show-subtree) (9 . outline-show-children) (16 . outline-previous-visible-heading) (14 . outline-next-visible-heading) (64 . outline-mark-subtree)) previous-line quoted-insert isearch-backward isearch-forward transpose-chars universal-argument scroll-up-command kill-region Control-X-prefix emacspeak-muggles-yank-pop/yank emacspeak-ctl-z-keymap ESC-prefix toggle-input-method abort-recursive-edit nil ...] #^^[1 0 #^^[2 0
>> #^^[3 0 set-mark-command move-beginning-of-line backward-char mode-specific-command-prefix delete-char emacspeak-prefix-command forward-char keyboard-quit help-command indent-for-tab-command electric-newline-and-maybe-indent kill-line recenter-top-bottom newline next-line (keymap ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) previous-line quoted-insert isearch-backward isearch-forward transpose-chars universal-argument scroll-up-command kill-region Control-X-prefix emacspeak-muggles-yank-pop/yank emacspeak-ctl-z-keymap ESC-prefix toggle-input-method abort-recursive-edit nil ...] self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command ...] self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command] self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command ...] (8388716 . ansi-term) (8388640 . emacspeak-muggles-maths-navigator/body) (8388718 . emacspeak-muggles-navigate/body) (print . emacspeak-muggles-brightness/body) (f14 . kmacro-end-or-call-macro) (f13 . kmacro-start-macro-or-insert-counter) (S-mouse-3 . kmacro-end-call-mouse) (C-S-iso-lefttab . tab-previous) (C-S-tab . tab-previous) (C-tab . tab-next) (f5 . find-file) (remap keymap (dabbrev-expand . hippie-expand)) (silence . emacspeak-silence) (67108903 . emacspeak-multi-keymap) (67108923 . emacspeak-hyper-keymap) (67108910 . emacspeak-super-keymap) (67108908 . emacspeak-alt-keymap) (S-down . emacspeak-skip-blank-lines-forward) (S-up . emacspeak-skip-blank-lines-backward) (S-right . next-buffer) (S-left . previous-buffer) (XF86AudioRaiseVolume . amixer-volume-up) (XF86AudioLowerVolume . amixer-volume-down) (C-f2 . amixer-volume-down) (C-f1 . amixer-volume-up) (XF86AudioPlay . emacspeak-silence) (paste . clipboard-yank) (copy . clipboard-kill-ring-save) (cut . clipboard-kill-region) (f18 . clipboard-yank) ...) "s-a" ansi-term)
>> (#f(compiled-function (key command) "Give KEY a global binding as COMMAND.\nThis is a legacy function; see `keymap-global-set' for the\nrecommended function to use instead.\n\nCOMMAND is the command definition to use; usually it is\na symbol naming an interactively-callable function.\nKEY is a key sequence; noninteractively, it is a string or vector\nof characters or event types, and non-ASCII characters with codes\nabove 127 (such as ISO Latin-1) can be included if you use a vector.\n\nNote that if KEY has a local binding in the current buffer,\nthat local binding will continue to shadow any global binding\nthat you make with this function." (interactive #f(compiled-function () #<bytecode 0x1c12d585360c8f11>)) #<bytecode 0xb0d11433d0335b6>) "s-a" ansi-term)
>> (ad-Advice-global-set-key #f(compiled-function (key command) "Give KEY a global binding as COMMAND.\nThis is a legacy function; see `keymap-global-set' for the\nrecommended function to use instead.\n\nCOMMAND is the command definition to use; usually it is\na symbol naming an interactively-callable function.\nKEY is a key sequence; noninteractively, it is a string or vector\nof characters or event types, and non-ASCII characters with codes\nabove 127 (such as ISO Latin-1) can be included if you use a vector.\n\nNote that if KEY has a local binding in the current buffer,\nthat local binding will continue to shadow any global binding\nthat you make with this function." (interactive #f(compiled-function () #<bytecode 0x1c12d585360c8f11>)) #<bytecode 0xb0d11433d0335b6>) "s-a" ansi-term)
>> (apply ad-Advice-global-set-key #f(compiled-function (key command) "Give KEY a global binding as COMMAND.\nThis is a legacy function; see `keymap-global-set' for the\nrecommended function to use instead.\n\nCOMMAND is the command definition to use; usually it is\na symbol naming an interactively-callable function.\nKEY is a key sequence; noninteractively, it is a string or vector\nof characters or event types, and non-ASCII characters with codes\nabove 127 (such as ISO Latin-1) can be included if you use a vector.\n\nNote that if KEY has a local binding in the current buffer,\nthat local binding will continue to shadow any global binding\nthat you make with this function." (interactive #f(compiled-function () #<bytecode 0x1c12d585360c8f11>)) #<bytecode 0xb0d11433d0335b6>) ("s-a" ansi-term))
>> (global-set-key "s-a" ansi-term)
>> (eval (global-set-key "s-a" 'ansi-term) t)
>> (#f(compiled-function (exp &optional insert-value no-truncate char-print-limit) "Evaluate EXP and print value in the echo area.\nWhen called interactively, read an Emacs Lisp expression and\nevaluate it. Value is also consed on to front of the variable\n`values'. Optional argument INSERT-VALUE non-nil (interactively,\nwith a non `-' prefix argument) means insert the result into the\ncurrent buffer instead of printing it in the echo area.\n\nNormally, this function truncates long output according to the\nvalue of the variables `eval-expression-print-length' and\n`eval-expression-print-level'. When NO-TRUNCATE is\nnon-nil (interactively, with a prefix argument of zero), however,\nthere is no such truncation.\n\nIf the resulting value is an integer, and CHAR-PRINT-LIMIT is\nnon-nil (interactively, unless given a non-zero prefix argument)\nit will be printed in several additional formats (octal,\nhexadecimal, and character). The character format is used only\nif the value is below CHAR-PRINT-LIMIT (interactively, if the\nprefix argument is -1 or the value doesn't exceed\n`eval-expression-print-maximum-character').\n\nRuns the hook `eval-expression-minibuffer-setup-hook' on entering the\nminibuffer.\n\nIf `eval-expression-debug-on-error' is non-nil, which is the default,\nthis command arranges for all errors to enter the debugger." (interactive #f(compiled-function () #<bytecode -0x459e253eac81345>)) #<bytecode -0xc624bdd988e525e>) (global-set-key "s-a" 'ansi-term) nil nil 127)
>> (ad-Advice-eval-expression #f(compiled-function (exp &optional insert-value no-truncate char-print-limit) "Evaluate EXP and print value in the echo area.\nWhen called interactively, read an Emacs Lisp expression and\nevaluate it. Value is also consed on to front of the variable\n`values'. Optional argument INSERT-VALUE non-nil (interactively,\nwith a non `-' prefix argument) means insert the result into the\ncurrent buffer instead of printing it in the echo area.\n\nNormally, this function truncates long output according to the\nvalue of the variables `eval-expression-print-length' and\n`eval-expression-print-level'. When NO-TRUNCATE is\nnon-nil (interactively, with a prefix argument of zero), however,\nthere is no such truncation.\n\nIf the resulting value is an integer, and CHAR-PRINT-LIMIT is\nnon-nil (interactively, unless given a non-zero prefix argument)\nit will be printed in several additional formats (octal,\nhexadecimal, and character). The character format is used only\nif the value is below CHAR-PRINT-LIMIT (interactively, if the\nprefix argument is -1 or the value doesn't exceed\n`eval-expression-print-maximum-character').\n\nRuns the hook `eval-expression-minibuffer-setup-hook' on entering the\nminibuffer.\n\nIf `eval-expression-debug-on-error' is non-nil, which is the default,\nthis command arranges for all errors to enter the debugger." (interactive #f(compiled-function () #<bytecode -0x459e253eac81345>)) #<bytecode -0xc624bdd988e525e>) (global-set-key "s-a" 'ansi-term) nil nil 127)
>> (apply ad-Advice-eval-expression #f(compiled-function (exp &optional insert-value no-truncate char-print-limit) "Evaluate EXP and print value in the echo area.\nWhen called interactively, read an Emacs Lisp expression and\nevaluate it. Value is also consed on to front of the variable\n`values'. Optional argument INSERT-VALUE non-nil (interactively,\nwith a non `-' prefix argument) means insert the result into the\ncurrent buffer instead of printing it in the echo area.\n\nNormally, this function truncates long output according to the\nvalue of the variables `eval-expression-print-length' and\n`eval-expression-print-level'. When NO-TRUNCATE is\nnon-nil (interactively, with a prefix argument of zero), however,\nthere is no such truncation.\n\nIf the resulting value is an integer, and CHAR-PRINT-LIMIT is\nnon-nil (interactively, unless given a non-zero prefix argument)\nit will be printed in several additional formats (octal,\nhexadecimal, and character). The character format is used only\nif the value is below CHAR-PRINT-LIMIT (interactively, if the\nprefix argument is -1 or the value doesn't exceed\n`eval-expression-print-maximum-character').\n\nRuns the hook `eval-expression-minibuffer-setup-hook' on entering the\nminibuffer.\n\nIf `eval-expression-debug-on-error' is non-nil, which is the default,\nthis command arranges for all errors to enter the debugger." (interactive #f(compiled-function () #<bytecode -0x459e253eac81345>)) #<bytecode -0xc624bdd988e525e>) ((global-set-key "s-a" 'ansi-term) nil nil 127))
>> (eval-expression (global-set-key "s-a" 'ansi-term) nil nil 127)
>> (#<subr funcall-interactively> eval-expression (global-set-key "s-a" 'ansi-term) nil nil 127)
>> (apply #<subr funcall-interactively> eval-expression ((global-set-key "s-a" 'ansi-term) nil nil 127))
>> (ad-Advice-funcall-interactively #<subr funcall-interactively> eval-expression (global-set-key "s-a" 'ansi-term) nil nil 127)
>> (apply ad-Advice-funcall-interactively #<subr funcall-interactively> (eval-expression (global-set-key "s-a" 'ansi-term) nil nil 127))
>> (funcall-interactively eval-expression (global-set-key "s-a" 'ansi-term) nil nil 127)
>> (#<subr call-interactively> eval-expression nil nil)
>> (apply #<subr call-interactively> eval-expression (nil nil))
>> (call-interactively@ido-cr+-record-current-command #<subr call-interactively> eval-expression nil nil)
>> (apply call-interactively@ido-cr+-record-current-command #<subr call-interactively> (eval-expression nil nil))
>> (call-interactively eval-expression nil nil)
>> (command-execute eval-expression)
>>
>> --
>>
>> Thanks,
>>
>> --Raman(I Search, I Find, I Misplace, I Research)
>> ♉ Id: kg:/m/0285kf1 🦮NZIrwH2+)!y܄do9
>
> Evaluating "(global-set-key "s-a" 'ansi-term)" won't work. Try
> evaluating "(global-set-key (kbd "s-a") 'ansi-term)".
>
> --
> Akib Azmain Turja
>
> This message is signed by me with my GnuPG key. It's fingerprint is:
>
> 7001 8CE5 819F 17A3 BBA6 66AF E74F 0EFA 922A E7F5
And please, add the expression you tried to evaluate in the message. I
had a hard time to find that expression string in the backtrace.
--
Akib Azmain Turja
This message is signed by me with my GnuPG key. It's fingerprint is:
7001 8CE5 819F 17A3 BBA6 66AF E74F 0EFA 922A E7F5
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Howto: Bind Windows key as a prefix?
2022-07-05 18:17 Howto: Bind Windows key as a prefix? T.V Raman
2022-07-05 18:35 ` T.V Raman
2022-07-05 18:37 ` Akib Azmain Turja
@ 2022-07-05 20:09 ` Stefan Monnier
2022-07-06 0:05 ` T.V Raman
2 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2022-07-05 20:09 UTC (permalink / raw)
To: T.V Raman; +Cc: emacs-devel
> s-<c> is undefined for any <c>.
>
> M-x global-set-key RET
> windows+<c> RET
> command RET
> binds windows-<c>
> and asking where is <command> shows it as being on s-<c>.
>
> However calling global-set-key with "s-<c>" bombs with key-sequence
> "s-<c>" starts with non-prefix s"
`s-<c>` is the syntax generated by `key-description` and understood by
`kbd` (and the new set of functions like` key-valid-p` and
`define-keymap`) but it is not understood by `define-key`,
`global-set-key`, and friends, for which you need to use the lower-level
vector syntax:
(global-set-key [?\s-c] 'my-command)
(global-set-key [s-tab] 'my-other-command)
...
-- Stefan
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-07-06 0:05 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-05 18:17 Howto: Bind Windows key as a prefix? T.V Raman
2022-07-05 18:35 ` T.V Raman
2022-07-05 18:37 ` Akib Azmain Turja
2022-07-05 18:40 ` Akib Azmain Turja
2022-07-05 20:09 ` Stefan Monnier
2022-07-06 0:05 ` T.V Raman
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).