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 (in 4bf4978).

Ref: 4bf49785fd
This commit is contained in:
Henrik Lissner 2022-08-07 12:24:14 +02:00
parent 1abcf913aa
commit 057e6c531c
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
28 changed files with 41 additions and 46 deletions

View file

@ -6,7 +6,7 @@
(declare (indent defun))
(after! evil
(if (listp modes)
(dolist (mode (doom-enlist modes))
(dolist (mode (ensure-list modes))
(evil-set-initial-state mode state))
(evil-set-initial-state modes state))))

View file

@ -76,9 +76,9 @@
(when (and unset (not (gethash name format-all--format-table)))
(error "'%s' formatter does not exist to be unset" name))
(puthash name function format-all--format-table)
(dolist (mode (doom-enlist modes))
(dolist (mode (ensure-list modes))
(cl-destructuring-bind (m &optional probe)
(doom-enlist mode)
(ensure-list mode)
(if unset
(puthash m (assq-delete-all name (gethash key format-all-mode-table))
format-all-mode-table)

View file

@ -11,7 +11,7 @@
"Declare :symbols, :words or :patterns (all lists of strings) that
`rotate-text' will cycle through."
(declare (indent defun))
(dolist (mode (doom-enlist modes))
(dolist (mode (ensure-list modes))
(let ((fn-name (intern (format "+rotate-text-init-%s-h" mode))))
(fset fn-name
(lambda ()

View file

@ -4,7 +4,7 @@
(defun set-yas-minor-mode! (modes)
"Register minor MODES (one mode symbol or a list of them) with yasnippet so it
can have its own snippets category, if the folder exists."
(dolist (mode (doom-enlist modes))
(dolist (mode (ensure-list modes))
(let ((fn (intern (format "+snippets-register-%s-h" mode))))
(fset fn (lambda () (yas-activate-extra-mode mode)))
(add-hook (intern (format "%s-hook" mode)) fn))))