]> git.eshelyaron.com Git - emacs.git/commitdiff
Eglot: define eglot--ensure-list with defalias
authorJoão Távora <joaotavora@gmail.com>
Fri, 24 Mar 2023 22:16:49 +0000 (22:16 +0000)
committerJoão Távora <joaotavora@gmail.com>
Sun, 2 Apr 2023 22:40:46 +0000 (23:40 +0100)
This avoids annoying obsoletion warnings when compiling the whole buffer.

* lisp/progmodes/eglot.el (eglot--ensure-list): define with defalias.

lisp/progmodes/eglot.el

index e52a40b7f2259d959b6dff40ecc596ccca07951c..3458fbc7cb2c75fd2cebeca261e11eeeb93db8a9 100644 (file)
@@ -1779,9 +1779,9 @@ and just return it.  PROMPT shouldn't end with a question mark."
 (defun eglot--plist-keys (plist) "Get keys of a plist."
   (cl-loop for (k _v) on plist by #'cddr collect k))
 
-(defun eglot--ensure-list (x) (if (listp x) x (list x)))
-(when (fboundp 'ensure-list)            ; Emacs 28 or later
-  (define-obsolete-function-alias 'eglot--ensure-list #'ensure-list "29.1"))
+(defalias 'eglot--ensure-list
+  (if (fboundp 'ensure-list) #'ensure-list
+    (lambda (x) (if (listp x) x (list x)))))
 
 \f
 ;;; Minor modes