Emacs consult interface to dash-docs-el
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Ravi R Kiran 23ff2b33c3 Add autoload cookie 1 month ago
.gitignore Initial version of consult-dash extracted from my .emacs.d. 1 month ago
LICENSE Add license 1 month ago
Readme.org Initial version of consult-dash extracted from my .emacs.d. 1 month ago
consult-dash.el Add autoload cookie 1 month ago

Readme.org

Consult interface to dash docs

consult-dash provides a consult interface to dash documentation. The easiest way to install is to add consult-dash.el to your emacs lisp path.

The only interface provided is the function consult-dash, which should be bound to a key sequence. If the default search term should be derived from the symbol at point, please use the normal consult method to customize consult-dash prompts:

  (consult-customize consult-dash :initial (thing-at-point 'symbol))

Support for embark and marginalia are automatically provided for search results, if those packages are installed.

The following is an example use-package declaration:

  (use-package consult-dash
    :bind (("M-s d" . consult-dash))
    :config
    ;; Use the symbol at point as initial search term
    (consult-customize consult-dash :initial (thing-at-point 'symbol))
    ;; Ensure that niceties are loaded too
    (require 'embark)
    (require 'marginalia))

Buffer-local values of docsets to search can be set by customizing the buffer-local variable consult-dash-docsets in a mode hook. The following is an example intended to placed inside a python mode hook:

  (when (functionp 'consult-dash)
    (setq-local consult-dash-docsets '("Python 2" "Python 3" "NumPy")))

Please see dash documentation for more details on installing docsets.

Known limitations

The current implementation works only on Unix-like systems, since it uses a shell command sequence to concatenate search commands for each docset. Patches to support other systems, or a better method for searching in sequence, are welcome. Please see the functions consult-dash--builder-one-docset and consult-dash--builder in the source for details.