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

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

问题描述

C-. 绑定到 Emacs 中的命令时,它在终端中不起作用.我在 gnome-terminal 和真实终端 tty1 上尝试了这个过程.我使用 -nw 标志启动 Emacs,然后按 Ch k(describe-key 的命令),然后按 C-..Emacs 只接收.,没有Ctrl.我如何在 Emacs 中使用它?

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)

(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).

因此,当您按下 C-. 时,您的终端很可能不会产生除 . 以外的任何内容(如果是这种情况,那基本上就是您的答案,除非有某种方式来配置终端做其他事情).

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).

(任何时候当您认为 Emacs 在终端中运行时没有对某些输入进行操作时,您应该尝试验证 Emacs 是否确实在接收您认为的输入.)

(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.)

如果您的终端正在生成.以外的内容,请参阅以下问答以了解如何让 Emacs 识别序列的详细信息:

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:

如果你可以运行一个 xterm,那么你可能很幸运,因为一些 xterm 特定的增强.请看以下内容:

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:

其他一些相关问答:

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

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