One way you can try to find such commands is to use C-h a
. In vanilla Emacs this is bound to apropos-command
.
For C-h a
you can input words to match in the command documentation - e.g., org
and indent
.
C-h a org indent
This is the kind of output you get:
Type RET on an entry to view its full documentation.
org-indent-line (750) M-x ... RET
Indent line depending on context.
org-indent-mode (680) M-x ... RET
When active, indent text according to outline structure.
org-return-indent (671) M-x ... RET
Goto next table row or insert a newline and indent.
org-indent-region (654) M-x ... RET
Indent each non-blank line in the region.
org-unindent-buffer (647) M-x ... RET
Un-indent the visible part of the buffer.
org-indent-item (582) M-x ... RET
Indent a local list item, but not its children.
org-indent-block (579) M-x ... RET
Indent the block at point.
org-indent-drawer (573) M-x ... RET
Indent the drawer at point.
org-delete-indentation (567) M-x ... RET
Join current line to previous and fix whitespace at join.
org-indent-item-tree (564) M-x ... RET
Indent a local list item including its children.
org-indent-to-column (564) M-x ... RET
Indent from point with tabs and spaces until COLUMN is reached.
org-cdlatex-environment-indent (490) M-x ... RET
Execute `cdlatex-environment' and indent the inserted environment.
However, your question asks how to match against command descriptions, not just command names. C-h a
cannot help with that - it matches only against command names.
If you use Icicles then you can match against command descriptions, i.e., doc strings.
There are several Icicles apropos commands, which can help.
You can see information about commands and other things by matching patterns incrementally: change your current minibuffer input and the set of matches changes accordingly.
In this case, you don't have a good idea about the command name, and you want to find a command whose doc string matches one or more patterns (e.g. regexps) - e.g., two simple patterns: org
and indent
.
Multi-command icicle-fundoc
prompts you for a 2-part, multi-completion input.
If you use C-$
during completion it toggles between all functions and just commands (interactive functions).
To match both org
and indent
in either order, you can use progressive completion.
You use C-M-j
to separate the parts of your input.
Summary:
M-x icicle-fundoc
C-$
- match only commands.
At the prompt:
.*
- you don't know what the command names are (or use org.*
if you know the name contains org
, or use ^org.*
if you it starts with org
)
C-M-j
.*[iI]ndent
- match indent
or Indent
in the doc
S-SPC
- to provide another pattern
.*org
- and match org
In my Emacs that shows these 12 completion candidates:
org-cdlatex-environment-indent
Execute ‘cdlatex-environment’ and indent the inserted environment.
ENVIRONMENT and ITEM are passed to ‘cdlatex-environment’.
The inserted environment is indented to current indentation
unless point is at the beginning of the line, in which the
environment remains unintended.
org-indent-block
Indent the block at point.
org-indent-drawer
Indent the drawer at point.
org-indent-item
Indent a local list item, but not its children.
If a region is active, all items inside will be moved.
org-indent-item-tree
Indent a local list item including its children.
If a region is active, all items inside will be moved.
org-indent-line
Indent line depending on context.
Indentation is done according to the following rules:
- Footnote definitions, diary sexps, headlines and inline tasks
have to start at column 0.
- On the very first line of an element, consider, in order, the
next rules until one matches:
1. If there’s a sibling element before, ignoring footnote
definitions and inline tasks, indent like its first line.
2. If element has a parent, indent like its contents. More
precisely, if parent is an item, indent after the
description part, if any, or the bullet (see
‘org-list-description-max-indent’). Else, indent like
parent’s first line.
3. Otherwise, indent relatively to current level, if
‘org-adapt-indentation’ is non-nil, or to left margin.
- On a blank line at the end of an element, indent according to
the type of the element. More precisely
1. If element is a plain list, an item, or a footnote
definition, indent like the very last element within.
2. If element is a paragraph, indent like its last non blank
line.
3. Otherwise, indent like its very first line.
- In the code part of a source block, use language major mode
to indent current line if ‘org-src-tab-acts-natively’ is
non-nil. If it is nil, do nothing.
- Otherwise, indent like the first non-blank line above.
The function doesn’t indent an item as it could break the whole
list structure. Instead, use ‘<M-S-left>’ or ‘<M-S-right>’.
Also align node properties according to ‘org-property-format’.
org-indent-mode
When active, indent text according to outline structure.
Internally this works by adding ‘line-prefix’ and ‘wrap-prefix’
properties, after each buffer modification, on the modified zone.
The process is synchronous. Though, initial indentation of
buffer, which can take a few seconds on large buffers, is done
during idle time.
org-list-repair
Fix indentation, bullets and checkboxes in the list at point.
org-return-indent
Goto next table row or insert a newline and indent.
Calls ‘org-table-next-row’ or ‘newline-and-indent’, depending on
context. See the individual commands for more information.
org-unindent-buffer
Un-indent the visible part of the buffer.
Relative indentation (between items, inside blocks, etc.) isn’t
modified.
You can continue to use S-SPC
to enter other patterns to match, to narrow the list of candidates.
Why did C-h a
list also command org-delete-indentation
, but it is missing from the list of Icicles candidates? Because we didn't try to match indent
also in the command name, and indent
is missing from that doc string.
Why is command org-list-repair
included among the Icicles candidates but missing from the output of C-h a
? Because it contains indent
only in the doc string, not in the command name. C-h a
does not match against doc.
With Icicles you can match anything in the command name or the doc string, or both. With apropos-command
you can match only against the command name.
apropos-command
is what you're looking for. It's bound toC-h a
by default.helm-info-elisp
, but I don't think there's a single answer for this one.