3

Suppose I want to install a new package. To do this I need to remember that M-x package-install RET package-name is the sequence of keystrokes to type into emacs to do this.

If I forget this keystroke, my go to solution is to google the action I want to complete and browse through the results until I find the right command.

I suspect there is a better way to look up emacs commands and what they do though. If so, can anybody point me to it?

Thanks!

user220419
  • 549
  • 1
  • 4
  • 11

3 Answers3

5

The number one goto command for this would be the apropos-command, which is invoked by using C-h a (or M-x apropos-command), and then typing a search query for the command.

If you know the name of a function, you can use C-h f which runs the describe-function command to get more details about the command.

Lastly, if you know the key sequence, and want more details regarding the command you run, you can use C-h k - describe-key to have emacs tell you what command and the documentation for that command when typing a sequence of keys.

You can get a more complete list of help commands by typing C-h ?.

Patrick
  • 17,669
  • 6
  • 70
  • 85
  • 1
    `C-h k` is the more informative version of `C-h c` (showing you the same details as `C-h f`, if you had the function name rather than the key binding). Also note that you can use tab-completion when entering function names with `describe-function`, so you can use that mechanism to assist when you can't remember the entire name. – phils May 25 '14 at 22:04
  • @phils: Nice, I've never used that one :-) – Patrick May 25 '14 at 22:06
1

The built-in manuals are the other obvious places to look, and you can search each one using its index, or isearch through the full-text of the manual.

https://stackoverflow.com/a/22380057/324105

Community
  • 1
  • 1
phils
  • 71,335
  • 11
  • 153
  • 198
1

If you use Icicles then the equivalent of apropos-command is built into every command that reads a command name, and you can change the pattern on the fly to tweak the set of matches. See apropos completion.

Whereas with apropos-command you need to provide at the outset the regexp or the complete list of keywords to match (and you need to get them right), with Icicles you can modify/correct them incrementally, and you can add more patterns progressively (progressive completion).

And when you have a set of matches for your pattern(s), you can see the complete doc for each on demand, as opposed to searching the output from apropos-command (which only shows partial doc anyway).

In addition, Icicles extends the standard apropos commands in various ways.

Drew
  • 29,895
  • 7
  • 74
  • 104