Closed thermopyle closed 2 years ago
Emacs has this cool feature of "future history". So instead of going back M-p
in the minibuffer history M-n
puts the current "symbol" into the minibuffer. See https://github.com/astoff/devdocs.el/blob/main/devdocs.el#L558 for the implementation.
Example: When invoking devdocs-lookup
with the point at os.path.re|alpath
M-n
gives me realpath
good enough to filter os.path.realpath
as the first hit.
To complement what @matzebond said, devdocs-lookup
accepts an INITIAL-INPUT
argument so you can define your own command with this behavior. Note that it can be tricky to make it work well in some cases since the thing at point can have several matching entries in the documentation index, which is one of the reasons I don't want to provide such a command in the package.
Thanks for a great package!
If you want to search for a specific word you either type the word into the "Go to documentation:" buffer presented by
devdocs-lookup
, or you select the region with the word and then calldevdocs-lookup
without the need to type the word to lookup. To make this more efficient it would be nice to have adevdocs-at-point
(inspired bydash-at-point
) which pre-selects the word at point (without the need to select a region) and runs a search for the word.