What I usually do is look at the doc string first and search for "hook". This gives me html-mode-hook
and the hooks of its parents. Search for "parent" and this gives me sgml-mode
. Keep repeating. I end up with:
html-mode-hook
sgml-mode-hook
text-mode-hook
Still in the *Help*
buffer, you can click on all of those and see what's there. In my case, I see turn-on-auto-fill
on text-mode-hook
. The solution was this:
(add-hook 'html-mode-hook 'turn-off-auto-fill)
Text Mode will have auto-fill enabled and HTML Mode will have auto-fill disabled. You could argue that I probably don't want SGML Mode to have auto-fill enabled, but since I don't use it, I don't care. :)
Looking at Doc Strings: If it's a function, use C-h f
. If it's a variable, use C-h v
. If you don't know what your major mode is, examine the variable major-mode
using C-h v
. This should tell you the major mode such as html-mode
. This is a function, so you need to use C-h f
.