feat(lib): backport ensure-list from 28+
And deprecate doom-enlist, which it replaces.
This commit is contained in:
parent
1402db5129
commit
4bf49785fd
1 changed files with 11 additions and 1 deletions
|
@ -44,6 +44,8 @@ list is returned as-is."
|
|||
;;
|
||||
;;; Public library
|
||||
|
||||
(define-obsolete-function-alias 'doom-enlist 'ensure-list "v3.0.0")
|
||||
|
||||
(defun doom-unquote (exp)
|
||||
"Return EXP unquoted."
|
||||
(declare (pure t) (side-effect-free t))
|
||||
|
@ -793,7 +795,15 @@ testing advice (when combined with `rotate-text').
|
|||
;;
|
||||
;;; Backports
|
||||
|
||||
;; None at the moment!
|
||||
(unless EMACS28+
|
||||
(defun ensure-list (object)
|
||||
"Return OBJECT as a list.
|
||||
If OBJECT is already a list, return OBJECT itself. If it's
|
||||
not a list, return a one-element list containing OBJECT."
|
||||
(declare (pure t) (side-effect-free t))
|
||||
(if (listp object)
|
||||
object
|
||||
(list object))))
|
||||
|
||||
(provide 'core-lib)
|
||||
;;; core-lib.el ends here
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue