如何找到一个Emacs Lisp函数绑定到一个键的位置? [英] How to find the location, where an an Emacs Lisp function is bound to a key?

查看:106
本文介绍了如何找到一个Emacs Lisp函数绑定到一个键的位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道哪些 M-m 绑定到 back-to-indentation 函数。当我发布 Ch k Mm describe-key )时,我得到以下输出

I'm trying to figure out where M-m is bound to back-to-indentation function. When I issue C-h k M-m (describe-key), I get the following output

Mm运行命令back-to-indentation,它是一个交互式
在`simple.el'中编译的Lisp函数。

M-m runs the command back-to-indentation, which is an interactive compiled Lisp function in `simple.el'.

绑定到Mm。

(back-to-indentation)

(back-to-indentation)

移动到第一个

当我看到 simple.el ,我只看到函数定义 back-to-indentation 。我在整个文件中搜索,我没有看到使用 define-key 的该功能完成任何键盘绑定。我假设它发生在其他地方。

When I look at simple.el, I'm seeing only the definition of function back-to-indentation. I searched throughout the file and I didn't see any keybinding done for that function using define-key. I'm assuming that it happens elsewhere.

如何识别函数绑定到 Mm 键的位置?

How can I identify the location where the function is bound to M-m key?


Emacs版本:GNU Emacs 24.2.1(x86_64-apple-darwin12.2.0,NS apple-appkit-1187.34)

Emacs version: GNU Emacs 24.2.1 (x86_64-apple-darwin12.2.0, NS apple-appkit-1187.34)


推荐答案

我不知道这是否可能,但我的猜测是,Emacs不记得代码是定义了一个给定的键。

I don't know if that's possible in general, but my guess would be that Emacs doesn't remember where the code was that defined a given key.

Ch b 将显示当前的绑定,从中可以建立你感兴趣的键盘映射,并从那里工作。对于大多数主要或次要模式的地图,找到代码并不难。

C-hb will show the current bindings, from which you can establish which keymap you're interested in, and work from there. For most major or minor mode maps, it won't be too difficult to find the code.

您的具体示例是Emacs在<$ c $中配置的全局绑定c> bindings.el 。

Your specific example is a global binding which Emacs configures in bindings.el.

这篇关于如何找到一个Emacs Lisp函数绑定到一个键的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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