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.Muihlinn– Muihlinn2020-04-26 17:09:08 +00:00Commented Apr 26, 2020 at 17:09
- try it! @MuihlinnAidan Schofield– Aidan Schofield2020-04-26 17:26:59 +00:00Commented Apr 26, 2020 at 17:26
- 1Yes. The value of variable
major-modeis the symbol bound to the function that turns a major mode on - sodescribe-functionfor that function describes the major mode. The value of variablemode-nameis the string naming the mode, which you see in the mode-line.Drew– Drew2020-04-26 18:11:06 +00:00Commented 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 mfrom a buffer.Muihlinn– Muihlinn2020-04-26 18:33:54 +00:00Commented Apr 26, 2020 at 18:33 - I get a description of what the mode is for followed by a complete list of key bindingsAidan Schofield– Aidan Schofield2020-04-26 19:09:04 +00:00Commented 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-variableinstead. Major modes always have a function, so there is no need for anything more thandescribe-function.phils– phils2020-04-27 06:36:04 +00:00Commented Apr 27, 2020 at 6:36