Emacs:打印命令的键绑定或列出所有键绑定 [英] Emacs: print key binding for a command or list all key bindings

查看:24
本文介绍了Emacs:打印命令的键绑定或列出所有键绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Emacs (GNU 23.2, *nix) 中,我该如何:

In Emacs (GNU 23.2, *nix), how can I:

  1. 列出绑定到特定命令的键序列?例如,我们如何列出所有执行 save-buffers-kill-emacs 的键序列,并将键序列的输出绑定到它?假设我们可以这样做,列出绑定到 goto-line 的键序列应该打印输出:M-g g 在默认安装上.
  2. 列出所有键绑定?C-h b 会这样做吗?它会打印我自己的绑定吗?
  1. list the key sequences bound to a particular command? For example, how can we list all the key sequences that execute save-buffers-kill-emacs, with the output of key sequences bound to it? Assuming we can do this, listing the key sequences bound to goto-line should print the output: M-g g on a default install.
  2. list all key-bindings? Does C-h b do this? Would it print my own bindings?

我知道直接执行命令可以打印一个可以用来激活它的键序列,但它并不总是这样做,并且会发生一些事情,包括:
(1) 输出不会长时间保持,(2) 命令被执行.

I am aware that executing the command directly can print a key sequence it can be activated with, but it doesn't always do so, and a few things happen, including:
(1) the output doesn't remain for long, (2) the command is executed.

我想要一个 command 为我列出(最好是所有)附加到给定命令的绑定,而不执行命令或类似的东西.

I want a command that lists for me (preferably all) the bindings attached to a given command, without executing the command, or something like that.

推荐答案

  1. C-h f(或 M-x describe-function)将显示命令的绑定.

  1. C-h f (or M-x describe-function) will show you the bindings for a command.

你是对的,C-h b(或 M-x describe-bindings)会显示所有的绑定.C-h m (M-x describe-mode) 也可以方便地按模式列出绑定.

You are correct, C-h b (or M-x describe-bindings) will show you all bindings. C-h m (M-x describe-mode) is also handy to list bindings by mode.

您也可以尝试 C-h k (M-x describe-key) 来显示哪个命令绑定到某个键.例如,在我的机器上 save-buffers-kill-emacs 没有绑定到任何东西,但是 Ch k Cx Cc 告诉我 Cx Cc 绑定到 save-buffers-kill-terminal.它将同时列出命令的所有绑定.

You might also try C-h k (M-x describe-key) to show what command is bound to a key. For instance, on my machine save-buffers-kill-emacs isn't bound to anything, but C-h k C-x C-c tells me that C-x C-c is bound to save-buffers-kill-terminal. It will list all bindings for the command at the same time.

这篇关于Emacs:打印命令的键绑定或列出所有键绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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