为什么Ctrl +。当我将它绑定到Emacs中的命令时不起作用? [英] Why does Ctrl+. not work when I bind it to a command in Emacs?
问题描述
C - 。在终端中不起作用。我在 gnome-terminal
和真正的终端tty1上尝试过这个过程。我使用 -nw
标志启动Emacs,然后按 Ch k ( describe-key的命令
),然后按 C - 。。 Emacs只收到。
,而没有 Ctrl
。我在Emacs中如何工作?
我在这个过程中绑定密钥:
(define-key c-mode-base-map(kbdC-。)'语义ia-fast-jump)
或
(define-key c-mode-base-map [(control。)]'语义ia-fast-jump)
所以,当你按 C - 。
(如果是这样的话),你的终端很可能不会产生。
情况,这基本上是你的答案,除非有一些方法来配置终端去做其他的)。
(任何时候你认为Emacs不是在一些输入上在终端中运行,您应该尝试验证Emacs是否正在接收我如果您的终端 生成以外的其他东西,则
>,那么参考以下问题和关于如何让Emacs识别序列的详细信息:
- 绑定M-< up> / M-< down>在Emacs 23.1.1
- Shift-Tab在Emacs中产生隐藏错误
- http://www.gnu.org/savannah-checkouts/gnu/emacs/manual/html_node/elisp/Translation-Keymaps.html
如果您可以运行xterm,那么您可能会运气,因为某些xterm特定的增强功能。看看以下内容:
- 发送C - (到VT100 / xterm终端中的Emacs(Mac OS X的终端)
- http:/ /www.dur.ac.uk/pjheslin/Software/Emacs/Download/xterm-extras.el
(我不知道第二个链接在这个具体的实例中是相关的,但是似乎值得包括)。
其他一些相关问答:
C-. doesn't work in the terminal when I bind it to a command in Emacs. I tried this procedure on gnome-terminal
and real terminal tty1. I start Emacs with the -nw
flag, then press C-h k (the command for describe-key
), then press C-.. Emacs only receives the .
, without the Ctrl
. How do I get this working in Emacs?
I'm binding keys with this process:
(define-key c-mode-base-map (kbd "C-.") 'semantic-ia-fast-jump)
or
(define-key c-mode-base-map [(control .)] 'semantic-ia-fast-jump)
In short, most terminal emulators are limited in the control characters they can produce (for the simple reason that the original terminals that they are emulating were likewise limited).
So your terminal is very likely not producing anything other than .
when you press C-.
(and if that's the case, that's basically your answer, unless there is some way to configure the terminal to do otherwise).
(Any time you think Emacs is not acting on some input when running in a terminal, you should attempt to verify that Emacs is actually receiving the input you think it is.)
If your terminal is producing something other than .
, then refer to the following Q&As for details on how to get Emacs to recognise the sequence:
- Binding M-<up> / M-<down> in Emacs 23.1.1
- Shift-Tab produces cryptic error in Emacs
- http://www.gnu.org/savannah-checkouts/gnu/emacs/manual/html_node/elisp/Translation-Keymaps.html
If you can run an xterm instead then you are probably in luck, due to some xterm-specific enhancements. Take a look at the following:
- Send "C-(" to Emacs in VT100/xterm terminal (Mac OS X's Terminal)?
- http://www.dur.ac.uk/p.j.heslin/Software/Emacs/Download/xterm-extras.el
(I'm not sure that second link is relevant in this specific instance, but it seems worth including).
Some other related Q&As:
这篇关于为什么Ctrl +。当我将它绑定到Emacs中的命令时不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!