I know that describe-mode
will describe the current major mode. Is it possible to describe a mode, and I will input the mode name?
2 Answers
Use describe-function
by typing C-h f
and, when asked for the function, type the name of the mode which is itself a function.
-
That will describe the function which will load the mode, not the mode.– MuihlinnCommented Apr 26, 2020 at 17:09
-
-
1Yes. The value of variable
major-mode
is the symbol bound to the function that turns a major mode on - sodescribe-function
for that function describes the major mode. The value of variablemode-name
is the string naming the mode, which you see in the mode-line.– DrewCommented Apr 26, 2020 at 18:11 -
It doesn't describe nothing more than the function itself in my setup, at least with the modes I tried before posting first comment, as they came to mind. Those could be extremely quiet in their ouptut, but definately not what I get when I ask
C-h m
from a buffer.– MuihlinnCommented Apr 26, 2020 at 18:33 -
I get a description of what the mode is for followed by a complete list of key bindings Commented Apr 26, 2020 at 19:09
You can call describe-minor-mode
to get help on any minor mode. It prompts you to enter either a symbol or an indicator from your mode line, and gives you the help for that mode. I don't think that there's anying similar for major modes.
-
This generally calls
describe-function
. In cases where the minor mode is just a variable (being acted on without a mode function being involved), then it will calldescribe-variable
instead. Major modes always have a function, so there is no need for anything more thandescribe-function
.– philsCommented Apr 27, 2020 at 6:36