gpt4 book ai didi

emacs - 如何让 Emacs 按键绑定(bind)识别大写字母?

转载 作者:行者123 更新时间:2023-12-03 03:25:07 24 4
gpt4 key购买 nike

如何让 Emacs 识别 M-C (meta-shift-c),而不是将其翻译为 m-c?

目前,当我执行 C-h k M-C 时,我得到:M-c(从 M-C 翻译而来)运行命令大写单词。

如何让它不将 M-C 翻译为 M-c?

最佳答案

只需使用修饰符 S (Shift) 在你的键绑定(bind)中。例如:

(global-set-key "\M-\S-c" 'foobar)

如果没有任何内容明确绑定(bind)到已移动的键,则 Emacs 会自动将其转换为未移动的键。

来自 Elisp 手册,节点 Key Sequence Input :

If an input character is upper-case (or has the shift modifier) and has no key binding, but its lower-case equivalent has one, then read-key-sequence' converts the character to lower case. Note thatlookup-key' does not perform case conversion in this way.

关于emacs - 如何让 Emacs 按键绑定(bind)识别大写字母?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22154688/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com