emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/eglot2emacs bc05805887 036/120: ; unbreak tests on emacs 26


From: João Távora
Subject: feature/eglot2emacs bc05805887 036/120: ; unbreak tests on emacs 26
Date: Thu, 20 Oct 2022 07:16:48 -0400 (EDT)

branch: feature/eglot2emacs
commit bc058058872a13e6ee3d9a04c6d37f2bba5a4852
Author: Stefan Kangas <stefankangas@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>

    ; unbreak tests on emacs 26
    
    * eglot.el (eglot--plist-keys): Define in Emacs 26, no longer
    obsolete in Emacs 27 or later.
    (eglot--check-object): Go back to eglot--plist-keys.
---
 lisp/progmodes/eglot.el | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 9c9f055cfa..14a4d1cd43 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -451,11 +451,11 @@ on unknown notifications and errors on unknown 
requests."))
       (eglot--interface interface-name)
     (when-let ((missing (and enforce-required
                              (cl-set-difference required-keys
-                                                (map-keys object)))))
+                                                (eglot--plist-keys object)))))
       (eglot--error "A `%s' must have %s" interface-name missing))
     (when-let ((excess (and disallow-non-standard
                             (cl-set-difference
-                             (map-keys object)
+                             (eglot--plist-keys object)
                              (append required-keys optional-keys)))))
       (eglot--error "A `%s' mustn't have %s" interface-name excess))
     (when check-types
@@ -580,7 +580,7 @@ treated as in `eglot-dbind'."
                   ;; has all the keys the user wants to destructure.
                   `(null (cl-set-difference
                           ',vars-as-keywords
-                          (map-keys ,obj-once)))))
+                          (eglot--plist-keys ,obj-once)))))
            collect `(,condition
                      (cl-destructuring-bind (&key ,@vars &allow-other-keys)
                          ,obj-once
@@ -3103,7 +3103,12 @@ If INTERACTIVE, prompt user for details."
 
 (make-obsolete-variable 'eglot--managed-mode-hook
                         'eglot-managed-mode-hook "1.6")
-(define-obsolete-function-alias 'eglot--plist-keys #'map-keys "1.9")
+
+(if (< emacs-major-version 27)
+    (defun eglot--plist-keys (plist)
+      (cl-loop for (k _v) on plist by #'cddr collect k))
+  ;; Make into an obsolete alias once we drop support for Emacs 26.
+  (defalias 'eglot--plist-keys #'map-keys))
 
 (provide 'eglot)
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]