Skip to content

Commit f8b8a45

Browse files
committed
; 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.
1 parent a36c681 commit f8b8a45

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

eglot.el

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -451,11 +451,11 @@ on unknown notifications and errors on unknown requests."))
451451
(eglot--interface interface-name)
452452
(when-let ((missing (and enforce-required
453453
(cl-set-difference required-keys
454-
(map-keys object)))))
454+
(eglot--plist-keys object)))))
455455
(eglot--error "A `%s' must have %s" interface-name missing))
456456
(when-let ((excess (and disallow-non-standard
457457
(cl-set-difference
458-
(map-keys object)
458+
(eglot--plist-keys object)
459459
(append required-keys optional-keys)))))
460460
(eglot--error "A `%s' mustn't have %s" interface-name excess))
461461
(when check-types
@@ -580,7 +580,7 @@ treated as in `eglot-dbind'."
580580
;; has all the keys the user wants to destructure.
581581
`(null (cl-set-difference
582582
',vars-as-keywords
583-
(map-keys ,obj-once)))))
583+
(eglot--plist-keys ,obj-once)))))
584584
collect `(,condition
585585
(cl-destructuring-bind (&key ,@vars &allow-other-keys)
586586
,obj-once
@@ -3103,7 +3103,12 @@ If INTERACTIVE, prompt user for details."
31033103

31043104
(make-obsolete-variable 'eglot--managed-mode-hook
31053105
'eglot-managed-mode-hook "1.6")
3106-
(define-obsolete-function-alias 'eglot--plist-keys #'map-keys "1.9")
3106+
3107+
(if (< emacs-major-version 27)
3108+
(defun eglot--plist-keys (plist)
3109+
(cl-loop for (k _v) on plist by #'cddr collect k))
3110+
;; Make into an obsolete alias once we drop support for Emacs 26.
3111+
(defalias 'eglot--plist-keys #'map-keys))
31073112

31083113
(provide 'eglot)
31093114

0 commit comments

Comments
 (0)