问题
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
M-m runs the command back-to-indentation, which is an interactive compiled Lisp function in `simple.el'.
It is bound to M-m.
(back-to-indentation)
Move point to the first non-whitespace character on this line.
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.
How can I identify the location where the function is bound to M-m key?
Emacs version: GNU Emacs 24.2.1 (x86_64-apple-darwin12.2.0, NS apple-appkit-1187.34)
回答1:
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.
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.
Your specific example is a global binding which Emacs configures in bindings.el
.
来源:https://stackoverflow.com/questions/15354894/how-to-find-the-location-where-an-an-emacs-lisp-function-is-bound-to-a-key