docs/emacs-configuration.md
elpaca or use-package.This document describes how to use RustOwl from Emacs. It mirrors the detail level of docs/neovim-configuration.md and is derived from rustowl.el.
Install the rustowl executable (see docs/installation.md). Install the Emacs package via elpaca or use-package.
Elpaca example:
(elpaca
(rustowl
:host github
:repo "cordx56/rustowl"))
Use-package example:
(use-package rustowl
:after lsp-mode)
rust-mode, rust-ts-mode, and rustic-mode using rustowl as the executable.rustowl/analyze on save (see rustowl-enable-analyze-on-save).rustowl/cursor when the cursor has been idle for rustowl-cursor-timeout seconds (default 2.0 seconds) and applies underlines via overlays.rustowl-cursor-timeout (float) — default: 2.0 seconds. Idle time before the cursor request is sent.rustowl-cursor-timer — internal timer variable managed by the package.rustowl/cursor with position and document URI. The server responds with decorations (type, range, hover text, overlapped).lifetime → #00cc00 (green)imm_borrow → #0000cc (blue)mut_borrow → #cc00cc (purple)move / call → #cccc00 (yellow)outlive → #cc0000 (red)(:underline (:color <color> :style wave)).enable-rustowl-cursor — enable cursor-based highlighting for current buffer (adds post-command-hook).disable-rustowl-cursor — disable cursor-based highlighting (removes hook and cancels timer).rust-mode-hook, rust-ts-mode-hook, and rustic-mode-hook.To disable analyze-on-save globally, remove the hooks or call:
(remove-hook 'rust-mode-hook #'enable-rustowl-cursor)
To customize the timeout in your config:
(setq rustowl-cursor-timeout 1.0) ; 1 second
lsp-mode is active and rustowl server is reachable.M-x rustowl-clear-overlays to clear overlays if they persist.See docs/lsp-spec.md for the LSP request/response shapes.