Hacker News new | ask | show | jobs
by tikhonj 6 days ago
The neat thing with Emacs is that the core concepts of the system are all first-class programming entities with their own documentation. So if you want to know what your current mode does, you can use C-h m to get a bunch of information including commands, key-bindings and links to code. If you have a key command, you can use C-h k, enter the keys, and you'll see exactly what function that command runs. You can get info about functions with C-h f and variables with C-h v; coupled with some kind of fuzzy-find-autocomplete (which, unfortunately, isn't set up by default), it's usually pretty quick to find the functions and config options that are relevant to whatever you're trying to do.

I still use web searches to look up Emacs things occasionally, but the built-in help commands are still useful because they're naturally tied to (and organized by) the core code entities that power Emacs.

1 comments

Yep. `C-h k` to look up what a key does, `C-h f` to look up a function, and `C-h v` to look up a variable/setting will get you pretty far.

I'd also add `C-h b` to show you the key bindings. (And `C-h` after a prefix key will usually show you the bindings that start with that prefix.) `C-h a` for apropos to search commands by substring can also be useful.

The thing that makes it really "self documenting" is that these help commands reflect the live environment at the moment you use it. If you've added a new binding in your init.el, `C-h b` and `C-h k` will show it. If you've added a new function in your init.el, or loaded a custom package, all those functions can now be found via `C-h f`. The help system will show you the doc strings for them and provide hyperlinks right to the source.

Moreover, this works for anything that you define on the fly. Open an Emacs lisp buffer, type some elisp code to define a function or variable, execute the definition, and now it'll appear under the above in the help system the next time you invoke help.