unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Akib Azmain Turja <akib@disroot.org>
To: "T.V Raman" <raman@google.com>, emacs-devel@gnu.org
Subject: Re: Howto: Bind Windows key as a prefix?
Date: Wed, 06 Jul 2022 00:40:59 +0600	[thread overview]
Message-ID: <87ilob9zd0.fsf@disroot.org> (raw)
In-Reply-To: <87mtdn9zi6.fsf@disroot.org>

[-- 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 --]

  reply	other threads:[~2022-07-05 18:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2022-07-05 20:09 ` Stefan Monnier
2022-07-06  0:05   ` T.V Raman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ilob9zd0.fsf@disroot.org \
    --to=akib@disroot.org \
    --cc=emacs-devel@gnu.org \
    --cc=raman@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).