Skip to content

Instantly share code, notes, and snippets.

@FernandoBasso
Last active August 11, 2016 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FernandoBasso/fd347b0f73917b674d977c371f9ddb14 to your computer and use it in GitHub Desktop.
Save FernandoBasso/fd347b0f73917b674d977c371f9ddb14 to your computer and use it in GitHub Desktop.
Tips and a summary of most common and useful commands for finding help in Emacs.
━━━━━━━━━━━━━━━━
EMACS SUMMARY
Fernando Basso
━━━━━━━━━━━━━━━━
Table of Contents
─────────────────
1 Help in Emacs :help:
.. 1.1 Basic Concepts :concepts:
.. 1.2 List of useful commands :commands:
..... 1.2.1 Apropos
1 Help in Emacs :help:
═══════════════
Knowing how to obtain help inside Emacs is important!
1.1 Basic Concepts :concepts:
──────────────────
`META' is `Alt'. `M-a' is `Alt-a'.
`CTRL' is `Control', and `C-c' is `Ctrl-c'.
`Shift' is `S'.
`Delete' is the `Delete' key. Not to be confused with `DEL' which is
the `Backspace' key.
`C-f' is a single input event but not a complete key (it waits for
some other input events to make a complete key).
`C-x C-f' is two input events and they form a complete key because
they indeed invoke a function (`find-file' in this case).
*key sequence* (or key, for short) → one or more input events that is
meaningful as a unit. If it invokes a command, we call it a *complete
key*. If it isn't long enough to invoke a command, we call it a
*prefix key*.
`C-x' and `C-x 4' are prefix keys, whereas `C-/' or `C-x C-s' are
complete keys.
A prefix key makes emacs wait for further input, a complete key does
not and it invokes a command.
By default, the prefix keys in Emacs are `C-c', `C-h', `C-x', `C-x
<RET>', `C-x @', `C-x a', `C-x n', `C-x r', `C-x v', `C-x 4', `C-x 5',
`C-x 6', `<ESC>', `M-g', and `M-o'. (`<F1>' and `<F2>' are aliases
for `C-h' and `C-x 6'.)
Try those prefix keys followed by `C-h', for instance, `C-x C-h', `C-x
a C-h' or `M-g C-h'.
`C-h' is the “help” prefix key.
1.2 List of useful commands :commands:
───────────────────────────
Tutorial:
┌────
│ C-h t
└────
Show all key bindings:
┌────
│ C-h b
└────
General help:
┌────
│ C-h C-h
│ C-h C-?
└────
Describe input key/event and see what function it invokes:
┌────
│ C-h k (describe-key)
│ C-h k <some input keys>
│ C-h k C-x C-s
│ C-h c (describe-key-briefly)
│ C-h c C-x C-s
└────
Describe a function and see which key bindings (if any) invoke it:
┌────
│ C-h f (describe-function)
│ C-h f <some function>
│ C-h f next-line
└────
Information about the current major mode:
┌────
│ C-h m
└────
And that tells you that the prefix key is, say, `C-c'. Now you can do
┌────
│ C-c C-h
└────
to see all key bindings for that mode.
Key bindings and help for a specific mode, like the “Rectangles” mode:
┌────
│ C-x r ?
│ C-x r C-h
│ C-h i m Emacs RET m Rectangles RET
│ M-x info-emacs-manual RET m Rectangles RET
└────
Documentation for a variable:
┌────
│ C-h v <variable name>
│ C-h v inhibit-startup-screen
│ C-h v initial-buffer-choice
└────
1.2.1 Apropos
╌╌╌╌╌╌╌╌╌╌╌╌╌
Find help about something, using a string as the search:
┌────
│ M-x apropos RET <string> RET
│ M-x apropos RET insert RET
│ M-x apropos RET truncate RET
└────
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment