After some profiling, it turns out map-put and map-delete are 5-7x slower (more on Emacs 25) than delq, setf/alist-get and add-to-list for small lists (under 250 items), which is exactly how I've been using them. The only caveat is alist-get's signature is different on Emacs 25, thus a polyfill is necessary in core-lib.
21 lines
663 B
EmacsLisp
21 lines
663 B
EmacsLisp
;;; feature/lookup/autoload/devdocs.el -*- lexical-binding: t; -*-
|
|
;;;###if (featurep! +devdocs)
|
|
|
|
;;;###autodef
|
|
(defun set-devdocs! (modes docset)
|
|
"Map major MODES (one major-mode symbol or a list of them) to a devdocs
|
|
DOCSET (a string).
|
|
|
|
See `devdocs-alist' for the defaults. "
|
|
(after! (:when (boundp 'devdocs-alist))
|
|
(dolist (mode (doom-enlist modes))
|
|
(setf (alist-get mode devdocs-alist) docset))))
|
|
|
|
;;;###autoload
|
|
(def-setting! :devdocs (modes docset)
|
|
"Map major MODES (one major-mode symbol or a list of them) to a devdocs
|
|
DOCSET (a string).
|
|
|
|
See `devdocs-alist' for the defaults. "
|
|
:obsolete set-devdocs!
|
|
`(set-devdocs! ,modes ,docset))
|