为什么Ctrl +。当我将它绑定到Emacs中的命令时不起作用? [英] Why does Ctrl+. not work when I bind it to a command in Emacs?

查看:163
本文介绍了为什么Ctrl +。当我将它绑定到Emacs中的命令时不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将它绑定到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识别序列的详细信息:





如果您可以运行xterm,那么您可能会运气,因为某些xterm特定的增强功能。看看以下内容:





其他一些相关问答:




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:

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:

Some other related Q&As:

这篇关于为什么Ctrl +。当我将它绑定到Emacs中的命令时不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆