Alexander-Miller/treemacs@6857816 -> Alexander-Miller/treemacs@9eaef27 DarwinAwardWinner/amx@b991497 -> DarwinAwardWinner/amx@37f9c7a Dewdrops/evil-exchange@3030e21 -> Dewdrops/evil-exchange@ac50f21 JuliaEditorSupport/julia-emacs@8ea90c7 -> JuliaEditorSupport/julia-emacs@fe6f6f7 OmniSharp/omnisharp-emacs@8ec5929 -> OmniSharp/omnisharp-emacs@5fad683 ProofGeneral/PG@bdb6782 -> ProofGeneral/PG@f0f0476 Sarcasm/irony-mode@76fd37f -> Sarcasm/irony-mode@ec6dce7 Silex/docker.el@0ca910b -> Silex/docker.el@ed0cdf0 Wilfred/helpful@584ecc8 -> Wilfred/helpful@7e4b1f0 abo-abo/swiper@1deef76 -> abo-abo/swiper@bb7965a agda/agda@9d08edb -> agda/agda@ecb9323 akermu/emacs-libvterm@a3fadd2 -> akermu/emacs-libvterm@1bc4516 akreisher/eshell-syntax-highlighting@172c9fb -> akreisher/eshell-syntax-highlighting@eeace52 alexmurray/flycheck-posframe@24fd9b3 -> alexmurray/flycheck-posframe@8f60c9b amake/flutter.el@696228a -> amake/flutter.el@960b635 ananthakumaran/tide@7f7334b -> ananthakumaran/tide@ad6fa78 asok/projectile-rails@8d6b373 -> asok/projectile-rails@f1fe6e8 bastibe/org-journal@f4b1549 -> bastibe/org-journal@043bb9e bbatsov/projectile@fd59947 -> bbatsov/projectile@1528ed4 bradyt/dart-mode@04fcd64 -> bradyt/dart-mode@43975c9 brotzeit/rustic@61d600e -> brotzeit/rustic@d97ec86 charignon/github-review@d0c8234 -> charignon/github-review@341b7a1 clojure-emacs/cider@815204f -> clojure-emacs/cider@4278d7c clojure-emacs/clj-refactor.el@b24ce76 -> clojure-emacs/clj-refactor.el@9f3e735 clojure-emacs/clojure-mode@f26379b -> clojure-emacs/clojure-mode@a14671e codesuki/add-node-modules-path@f31e69c -> codesuki/add-node-modules-path@7d9be65 company-mode/company-mode@88001d7 -> company-mode/company-mode@7207cb1 cpitclaudel/company-coq@4da7b41 -> cpitclaudel/company-coq@7423ee2 cython/cython@9a761a6 -> cython/cython@9decfca dgutov/diff-hl@4c46b3b -> dgutov/diff-hl@1af31fe dgutov/robe@3ef165c -> dgutov/robe@126650a domtronn/all-the-icons.el@2f5ea72 -> domtronn/all-the-icons.el@a8c8417 editorconfig/editorconfig-emacs@048c553 -> editorconfig/editorconfig-emacs@9da2dab elixir-editors/emacs-elixir@9de08c1 -> elixir-editors/emacs-elixir@0212b06 ema2159/centaur-tabs@50fd573 -> ema2159/centaur-tabs@df97209 emacs-csharp/csharp-mode@09b4d57 -> emacs-csharp/csharp-mode@f977800 emacs-ess/ESS@5169b0d -> emacs-ess/ESS@126d344 emacs-evil/evil-collection@334670e -> emacs-evil/evil-collection@b45ec5b emacs-evil/evil@cc9d688 -> emacs-evil/evil@7eace67 emacs-helm/helm-org@b7a18df -> emacs-helm/helm-org@d67186d emacs-helm/helm@dbdec63 -> emacs-helm/helm@98af298 emacs-jp/migemo@f42832c -> emacs-jp/migemo@f756cba emacs-lsp/dap-mode@aa15b9c -> emacs-lsp/dap-mode@ae395aa emacs-lsp/helm-lsp@e934fea -> emacs-lsp/helm-lsp@74a02f8 emacs-lsp/lsp-dart@71902ca -> emacs-lsp/lsp-dart@f3b70ec emacs-lsp/lsp-ivy@c70ee8b -> emacs-lsp/lsp-ivy@515e597 emacs-lsp/lsp-java@5f6d357 -> emacs-lsp/lsp-java@542aaf1 emacs-lsp/lsp-metals@c76eeb6 -> emacs-lsp/lsp-metals@51a89c1 emacs-lsp/lsp-mode@c3cbadc -> emacs-lsp/lsp-mode@eda51c2 emacs-lsp/lsp-ui@0ac3e12 -> emacs-lsp/lsp-ui@1dbea9f emacs-php/php-mode@8cdc727 -> emacs-php/php-mode@a2bca9b emacs-php/phpactor.el@62d2372 -> emacs-php/phpactor.el@80788a8 emacs-straight/auctex@384c4b9 -> emacs-straight/auctex@0f3639a emacs-straight/dired-git-info@b47f2b0 -> emacs-straight/dired-git-info@9461476 emacs-straight/org-mode@0b117f7 -> emacs-straight/org-mode@7a62a4d emacs-straight/project@2e7afbe -> emacs-straight/project@388ffdf emacs-straight/xclip@2951c6b -> emacs-straight/xclip@ef2ad92 emacsattic/nose@f852829 -> emacsattic/nose@f852829 emacsorphanage/quickrun@8008780 -> emacsorphanage/quickrun@57db985 erlang/otp@af06b43 -> erlang/otp@94c9738 factor/factor@1928e60 -> factor/factor@5bfeab6 flycheck/flycheck@01396a5 -> flycheck/flycheck@f8c679f greghendershott/racket-mode@75ea8f6 -> greghendershott/racket-mode@5115c47 hakimel/reveal.js@0582f57 -> hakimel/reveal.js@cf8e64b haskell/haskell-mode@3a019e6 -> haskell/haskell-mode@1baa12a hlissner/doom-snippets@aa5587b -> hlissner/doom-snippets@afe549b hlissner/emacs-counsel-css@6427dfc -> hlissner/emacs-counsel-css@f7647b4 hlissner/emacs-doom-themes@55f01ed -> hlissner/emacs-doom-themes@4199e74 hlissner/emacs-solaire-mode@a8fe09d -> hlissner/emacs-solaire-mode@9d143db hvesalai/emacs-sbt-mode@7b121fc -> hvesalai/emacs-sbt-mode@0bdc36b hvesalai/emacs-scala-mode@402d6df -> hvesalai/emacs-scala-mode@1ab5f64 ideasman42/emacs-spell-fu@a7db587 -> ideasman42/emacs-spell-fu@30c5eea iqbalansari/emacs-emojify@cfa0086 -> iqbalansari/emacs-emojify@1b72641 jacktasia/dumb-jump@f6a1165 -> jacktasia/dumb-jump@8bc1950 jaor/geiser@26dd2f4 -> jaor/geiser@8e61c27 jcollard/elm-mode@188b9c7 -> jcollard/elm-mode@e9fcf9c jkitchin/ox-clip@38b83ac -> jkitchin/ox-clip@2095537 joaotavora/eglot@a2d1fc9 -> joaotavora/eglot@2fbcab2 joaotavora/sly@fb84318 -> joaotavora/sly@5966d68 jorgenschaefer/circe@265f36c -> jorgenschaefer/circe@e67e2d1 js-emacs/js2-refactor.el@d4c40b5 -> js-emacs/js2-refactor.el@a0977c4 js-emacs/xref-js2@6f1ed5d -> js-emacs/xref-js2@fd6b723 jscheid/dtrt-indent@4a30d8e -> jscheid/dtrt-indent@37529fc justbur/emacs-which-key@c0608e8 -> justbur/emacs-which-key@c632dbf justinbarclay/parinfer-rust-mode@c825606 -> justinbarclay/parinfer-rust-mode@f130fa0 jyp/dante@7b1ab64 -> jyp/dante@8741419 kaushalmodi/ox-hugo@a05667e -> kaushalmodi/ox-hugo@02140a2 kidd/org-gcal.el@0a6f9a7 -> kidd/org-gcal.el@d38acda leanprover/lean-mode@15bee87 -> leanprover/lean-mode@5c50338 ledger/ledger-mode@3495d12 -> ledger/ledger-mode@32fef09 magit/forge@8382fd3 -> magit/forge@f4c95dd magit/magit@4735b92 -> magit/magit@577f16d magit/orgit@ac9b1a4 -> magit/orgit@609fd0c magnars/expand-region.el@ea6b4cb -> magnars/expand-region.el@4b83227 magnars/multiple-cursors.el@a9d7764 -> magnars/multiple-cursors.el@7b13b03 mhayashi1120/Emacs-wgrep@f0ef9bf -> mhayashi1120/Emacs-wgrep@f9687c2 millejoh/emacs-ipython-notebook@4ff76e5 -> millejoh/emacs-ipython-notebook@142ff50 non-Jedi/lsp-julia@c523c25 -> non-Jedi/lsp-julia@c487ed7 nonsequitur/inf-ruby@1fc972e -> nonsequitur/inf-ruby@c6990a6 ocaml-ppx/ocamlformat@7db8d13 -> ocaml-ppx/ocamlformat@448ac7c ocaml/dune@f839fc1 -> ocaml/dune@a88ce5b ocaml/merlin@36d0aef -> ocaml/merlin@cc17ed6 ocaml/tuareg@ccde45b -> ocaml/tuareg@37a6730 org-roam/org-roam@b0fd126 -> org-roam/org-roam@8ad57b1 purcell/diredfl@cd052df -> purcell/diredfl@4ca3265 purcell/envrc@a7c6ca8 -> purcell/envrc@110a221 purescript-emacs/purescript-mode@8410baf -> purescript-emacs/purescript-mode@0acd1af racer-rust/emacs-racer@f17f9d7 -> racer-rust/emacs-racer@1e63e98 raxod502/prescient.el@9631db7 -> raxod502/prescient.el@8573df9 redguardtoo/evil-nerd-commenter@2730820 -> redguardtoo/evil-nerd-commenter@b8ac35f rolandwalker/flyspell-lazy@d57382c -> rolandwalker/flyspell-lazy@0fc5996 rubocop/rubocop-emacs@1372ee3 -> rubocop/rubocop-emacs@f5fd18a seagle0128/doom-modeline@5fe7fd6 -> seagle0128/doom-modeline@00bc89b seagle0128/grip-mode@1aebf9c -> seagle0128/grip-mode@98d566d skeeto/elfeed@362bbe5 -> skeeto/elfeed@e29c8b9 skk-dev/ddskk@275a831 -> skk-dev/ddskk@cec9936 snosov1/toc-org@aef220c -> snosov1/toc-org@c4c61c5 spotify/dockerfile-mode@ed1d04c -> spotify/dockerfile-mode@3b13745 takaxp/org-tree-slide@c9487e5 -> takaxp/org-tree-slide@9d2ba1d technomancy/fennel-mode@bebc9dd -> technomancy/fennel-mode@ba14a7d travisbhartwell/nix-emacs@977b9a5 -> travisbhartwell/nix-emacs@053a2d5 tumashu/posframe@3454a4c -> tumashu/posframe@fff21cc tumashu/pyim@e54153f -> tumashu/pyim@f48c3ed widefox/flycheck-raku@046f35a -> widefox/flycheck-raku@b1acccd wyuenho/all-the-icons-dired@fc2dfa1 -> wyuenho/all-the-icons-dired@f401fe2 xuchunyang/elisp-demos@ed9578d -> xuchunyang/elisp-demos@924b07d xuchunyang/osx-dictionary.el@1b79ff6 -> xuchunyang/osx-dictionary.el@4d4cc19 yqrashawn/fd-dired@9fb966d -> yqrashawn/fd-dired@7d18938 yyoncho/helm-icons@5a668ef -> yyoncho/helm-icons@e4a2cd1 Closes #4786 Closes #4801 Closes #4803 Skipped bumping straight.el because of raxod502/straight.el#714. Will adapt soon.
tools/lookup
Table of Contents TOC
Description
This module adds code navigation and documentation lookup tools to help you quickly look up definitions, references, documentation, dictionary definitions or synonyms.
- Jump-to-definition and find-references implementations that just work.
- Powerful xref integration for languages that support it.
- Search online providers like devdocs.io, stackoverflow, google, duckduckgo or youtube (duckduckgo and google have live suggestions).
- Integration with Dash.app docsets.
- Support for online (and offline) dictionaries and thesauruses.
Module Flags
-
+dictionary
Enable word definition and thesaurus lookup functionality.+offline
Install and prefer offline dictionary/thesaurus.
+docsets
Enable integration with Dash.app docsets.
Plugins
- dumb-jump
- ivy-xref or helm-xref
- request
-
+docsets
-
+dictionary
-
if macOS
- osx-dictionary* (on macOS)
-
else
- define-word
- powerthesaurus
-
+offline
-
Prerequisites
This module has several soft dependencies:
ripgrep
as a last-resort fallback for jump-to-definition/find-references.sqlite3
for Dash docset support (if you have+docsets
enabled)wordnet
for offline dictionary and thesaurus support (if you have+dictionary +offline
enabled).
MacOS
brew install ripgrep wordnet
# An older version of sqlite is included in MacOS. If it causes you problems (and
# folks have reported it will), install it through homebrew:
brew install sqlite
# Note that it's keg-only, meaning it isn't symlinked to /usr/local/bin. You'll
# have to add it to PATH yourself (or symlink it into your PATH somewhere). e.g.
export PATH="/usr/local/opt/sqlite/bin:$PATH"
Arch Linux
sudo pacman -S sqlite ripgrep
yay -S wordnet-cli
NixOS
environment.systemPackages = with pkgs; [
ripgrep
sqlite
wordnet
];
Features
Jump to definition
Use +lookup/definition
(bound to gd
in normal mode) to jump to the
definition of the symbol at point
This module provides a goto-definition implementation that will try the following sources before giving up:
- Whatever
:definition
function is registered for the current buffer with the:lookup
setting (see "Configuration" section). - Any available xref backends.
dumb-jump
(a text search with aides to reduce false positives).- An ordinary project-wide text search with ripgrep.
- If
evil-mode
is active, useevil-goto-definition
, which preforms a simple text search within the current buffer.
If there are multiple results, you will be prompted to select one.
Find references
Use +lookup/references
(bound to gD
in normal mode) to see a list of
references for the symbol at point from throughout your project.
Like +lookup/definition
, this tries a number of sources before giving up. It
will try:
- Whatever
:references
function is registered for the current buffer with the:lookup
setting (see "Configuration" section). - Any available xref backends.
- An ordinary project-wide text search with ripgrep.
If there are multiple results, you will be prompted to select one.
Look up documentation
+lookup/documentation
(bound to K
in normal mode) will open documentation
for the symbol at point.
Depending on your configuration, this will try a list of sources:
- Whatever
:documentation
function is registered for the current buffer with the:lookup
setting (see "Configuration" section). - Any Dash.app docsets, if any are installed for the current major mode.
- devdocs.io, if it has a docset for the current mode.
- An online search; using the last engine used (it will prompt you the first
time, or if
current-prefix-arg
is non-nil).
Search a specific documentation backend
You can perform a documentation lookup on any backends directly:
- Dash Docsets:
+lookup/in-docsets
, or:dash QUERY
for evil users. - Online (generic):
+lookup/online
or+lookup/online-select
(bound toSPC / o
), or:lo[okup] QUERY
for evil users.
Dash.app Docset integration
You can install dash docsets with M-x dash-docset-install-docset
and search
them offline with M-x +lookup/in-docsets
, or with +lookup/documentation
in
modes that don't have a specialized :documentation lookup handler.
Configuration
Associating lookup handlers with major modes
set-lookup-handlers! MODES &key DEFINITION REFERENCES DOCUMENTATION FILE XREF-BACKEND ASYNC
Use set-lookup-handlers!
to register lookup targets for MODES (a major or
minor mode symbol or list thereof). PLIST accepts the following optional
properties:
-
:definition FN
- Run when jumping to a symbol's definition. Used by
+lookup/definition
. -
:references FN
- Run when looking for usage references of a symbol in the
current project. Used by
+lookup/references
. -
:documentation FN
- Run when looking up documentation for a symbol. Used by
+lookup/documentation
. -
:file FN
- Run when looking up the file for a symbol/string. Typically a
file path. Used by
+lookup/file
. -
:xref-backend FN
- Defines an xref backend, which implicitly provides :definition and :references handlers. If you specify them anyway, they will take precedence over the xref backend, however.
e.g.
;; For python-mode, anaconda-mode offers a backend for all three lookup
;; functions. We can register them like so:
(set-lookup-handlers! 'python-mode
:definition #'anaconda-mode-find-definitions
:references #'anaconda-mode-find-references
:documentation #'anaconda-mode-show-doc)
;; If a language or plugin provides a custom xref backend available for it, use
;; that instead. It will provide the best jump-to-definition and find-references
;; experience. You can specify custom xref backends with:
(set-lookup-handlers! 'js2-mode :xref-backend #'xref-js2-xref-backend)
;; NOTE: xref doesn't provide a :documentation backend.
Associating Dash docsets with major modes
set-docsets! MODES &rest DOCSETS...
Use set-docsets!
to register DOCSETS (one string or list of strings) for MODES
(one major mode symbol or a list of them). It is used by +lookup/in-docsets
and +lookup/documentation
.
e.g.
(set-docsets! 'js2-mode "JavaScript" "JQuery")
;; Add docsets to minor modes by starting DOCSETS with :add
(set-docsets! 'rjsx-mode :add "React")
;; Or remove docsets from minor modes
(set-docsets! 'nodejs-mode :remove "JQuery")
This determines what docsets to implicitly search for when you use
+lookup/documentation
in a mode with no :documentation
handler. Those
docsets must be installed with dash-docset-install-docset
.
Open in eww instead of browser
To open results from +lookup/online
or +lookup/in-docsets
in EWW instead
of your system browser, change +lookup-open-url-fn
(default:
#'browse-url
):
(setq +lookup-open-url-fn #'eww)
Open in Xwidget WebKit instead of browser
To open results from +lookup/online
or +lookup/in-docsets
in Xwidget
WebKit instead of your system browser, set +lookup-open-url-fn
to
+lookup-xwidget-webkit-open-url-fn
(needs Emacs with Xwidgets support):
(setq +lookup-open-url-fn #'+lookup-xwidget-webkit-open-url-fn)
Appendix
Commands
+lookup/definition
+lookup/references
+lookup/documentation
+lookup/online
+lookup/online-select
+lookup/in-devdocs
+lookup/in-docsets