refactor: replace doom-enlist with ensure-list
doom-enlist is now a deprecated alias for ensure-list, which is built into Emacs 28.1+ and is its drop-in replacement. We've already backported it for 27.x users in doom-lib (in4bf4978
). Ref:4bf49785fd
This commit is contained in:
parent
1abcf913aa
commit
057e6c531c
28 changed files with 41 additions and 46 deletions
|
@ -7,7 +7,7 @@
|
|||
:defer t
|
||||
:config
|
||||
(setq org-cite-global-bibliography
|
||||
(doom-enlist
|
||||
(ensure-list
|
||||
(or (bound-and-true-p citar-bibliography)
|
||||
(bound-and-true-p bibtex-completion-bibliography)))
|
||||
;; Setup export processor; default csl/citeproc-el, with biblatex for
|
||||
|
|
|
@ -119,9 +119,9 @@
|
|||
(pcase-dolist (`((,category . ,modules) :after ,after :require ,libs)
|
||||
+debugger--dap-alist)
|
||||
(when (doom-module-p category (car modules) (cadr modules))
|
||||
(dolist (lib (doom-enlist after))
|
||||
(dolist (lib (ensure-list after))
|
||||
(with-eval-after-load lib
|
||||
(mapc #'require (doom-enlist libs))))))
|
||||
(mapc #'require (ensure-list libs))))))
|
||||
|
||||
(dap-mode 1)
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ recognized:
|
|||
Defaults to `+eval/region', which will run the :send-region specified function
|
||||
or `+eval/send-region-to-repl'."
|
||||
(declare (indent defun))
|
||||
(dolist (mode (doom-enlist modes))
|
||||
(dolist (mode (ensure-list modes))
|
||||
(setf (alist-get mode +eval-repls)
|
||||
(cons command plist))))
|
||||
|
||||
|
@ -59,7 +59,7 @@ MODES can be list of major mode symbols, or a single one.
|
|||
4. If MODE is not a string and COMMANd is a symbol, add it to
|
||||
`+eval-runners', which is used by `+eval/region'."
|
||||
(declare (indent defun))
|
||||
(dolist (mode (doom-enlist modes))
|
||||
(dolist (mode (ensure-list modes))
|
||||
(cond ((symbolp command)
|
||||
(push (cons mode command) +eval-runners))
|
||||
((stringp command)
|
||||
|
|
|
@ -27,7 +27,7 @@ Example:
|
|||
Used by `+lookup/in-docsets' and `+lookup/documentation'."
|
||||
(declare (indent defun))
|
||||
(let ((action (if (keywordp (car docsets)) (pop docsets))))
|
||||
(dolist (mode (doom-enlist modes))
|
||||
(dolist (mode (ensure-list modes))
|
||||
(let ((hook (intern (format "%s-hook" mode)))
|
||||
(fn (intern (format "+lookup-init--%s-%s" (or action "set") mode))))
|
||||
(if (null docsets)
|
||||
|
|
|
@ -66,7 +66,7 @@ This can be passed nil as its second argument to unset handlers for MODES. e.g.
|
|||
|
||||
\(fn MODES &key DEFINITION IMPLEMENTATIONS TYPE-DEFINITION REFERENCES DOCUMENTATION FILE XREF-BACKEND ASYNC)"
|
||||
(declare (indent defun))
|
||||
(dolist (mode (doom-enlist modes))
|
||||
(dolist (mode (ensure-list modes))
|
||||
(let ((hook (intern (format "%s-hook" mode)))
|
||||
(fn (intern (format "+lookup--init-%s-handlers-h" mode))))
|
||||
(if (null (car plist))
|
||||
|
@ -106,7 +106,7 @@ This can be passed nil as its second argument to unset handlers for MODES. e.g.
|
|||
(defun +lookup--set-handler (spec functions-var &optional async enable)
|
||||
(when spec
|
||||
(cl-destructuring-bind (fn . plist)
|
||||
(doom-enlist spec)
|
||||
(ensure-list spec)
|
||||
(if (not enable)
|
||||
(remove-hook functions-var fn 'local)
|
||||
(put fn '+lookup-async (or (plist-get plist :async) async))
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
single one. If a list, the first field found will be returned. Will error out
|
||||
otherwise, unless NOERROR is non-nill."
|
||||
(if-let* ((data (if (listp entry) entry (+pass-get-entry entry))))
|
||||
(cl-loop for key in (doom-enlist fields)
|
||||
(cl-loop for key in (ensure-list fields)
|
||||
when (assoc key data)
|
||||
return (cdr it))
|
||||
(unless noerror
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue