]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve backwards-compatibility of eglot-mode-map
authorStefan Kangas <stefankangas@gmail.com>
Sat, 15 Jan 2022 16:37:42 +0000 (17:37 +0100)
committerStefan Kangas <stefankangas@gmail.com>
Sat, 15 Jan 2022 18:27:50 +0000 (19:27 +0100)
* eglot.el (eglot-mode-map): Only bind to eldoc-doc-buffer in Emacs
28.1 or later.

lisp/progmodes/eglot.el

index bcd67205b5b136cbd57ba5781d89caef2b7a5724..72a0103c815c582fb046b86e17ce98c0a369e530 100644 (file)
@@ -1519,7 +1519,8 @@ and just return it.  PROMPT shouldn't end with a question mark."
 ;;;
 (defvar eglot-mode-map
   (let ((map (make-sparse-keymap)))
-    (define-key map [remap display-local-help] 'eldoc-doc-buffer)
+    (when (fboundp 'eldoc-doc-buffer) ; Emacs 28.1 or later
+      (define-key map [remap display-local-help] #'eldoc-doc-buffer))
     map))
 
 (defvar-local eglot--current-flymake-report-fn nil