1

Currently, I'm in Doom and I'm pressing M-x which does a nice fuzzy search for commands.

The problem with this is it has no synonym detection. So if I'm trying to collapse something and type M-x collapse, fold does not come up. Then I have to Google to find out the solution. There is also C-h a for apropos, but that is a hassle.

When I'm searching for a command to do something, how can I do that in a semantic way? Meaning that it searches by meaning instead of by text. At least synonyms for the word I type will be included in the results.

This is related to the more general question of semantic search in Emacs and also to how to see what keybindings are available when I'm in some minibuffer mode like Helm (please let me know if that is the correct terminology).

4
  • Please don't pose "best way" questions here. That encourages opinion-based answers and discussion. Ask instead "How can I...?". Thx. For best-way discussion, try a discussion site, such as Reddit.
    – Drew
    Jun 15, 2023 at 16:19
  • Maybe you have a specific question, about how to find commands, including their synonyms...?
    – Drew
    Jun 15, 2023 at 16:20
  • Thank you. I tried to make it more objective.
    – Zaz
    Jun 15, 2023 at 18:14
  • Thx...............
    – Drew
    Jun 15, 2023 at 21:23

2 Answers 2

1

C-h a is bound to command apropos-command. C-h k C-h a tells us:

C-h a runs the command apropos-command (found in global-map), which is an autoloaded interactive Lisp function in ‘apropos.el’.

It is bound to C-h a, <f1> a, <help> a, <menu-bar> <help-menu> <search-documentation> <find-commands-by-name>.

(apropos-command PATTERN &optional DO-ALL VAR-PREDICATE)

Show commands (interactively callable functions) that match PATTERN.

PATTERN can be a word, a list of words (separated by spaces), or a regexp (using some regexp special characters). If it is a word, search for matches for that word as a substring. If it is a list of words, search for matches for any two (or more) of those words.

With C-u prefix, or if apropos-do-all is non-nil, also show noninteractive functions.

If VAR-PREDICATE is non-nil, show only variables, and only those that satisfy the predicate VAR-PREDICATE.

When called from a Lisp program, a string PATTERN is used as a regexp, while a list of strings is used as a word list.

In addition, there are other apropos commands that help. For example, C-h d is bound to apropos-doc:

apropos-documentation is an autoloaded interactive byte-compiled Lisp function in ‘apropos.el’.

It is bound to C-h d, <f1> d, <help> d, <menu-bar> <help-menu> <search-documentation> <search-documentation-strings>.

(apropos-documentation PATTERN &optional DO-ALL)

Show symbols whose documentation contains matches for PATTERN.

PATTERN can be a word, a list of words (separated by spaces), or a regexp (using some regexp special characters). If it is a word, search for matches for that word as a substring. If it is a list of words, search for matches for any two (or more) of those words.

Note that by default this command only searches in the file specified by internal-doc-file-name; i.e., the etc/DOC file. With C-u prefix, or if apropos-do-all is non-nil, it searches all currently defined documentation strings.

Returns list of symbols and documentation found.

0

If you use Icicles then when you use M-x you can type get "apropos" matching for your input pattern in the minibuffer. And you can use C-M-RET or C-M-mouse-2 on any matches to see that command's description in *Help*.

There are also Icicles versions of the ordinary apropos commands, e.g., icicle-doc for apropos-doc.

See A Propos d'Apropos.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.