From 0739cdcf20850aa94c7bbfd9791e344fe9202fd1 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 15 Jan 2022 17:37:42 +0100 Subject: [PATCH] Improve backwards-compatibility of eglot-mode-map * eglot.el (eglot-mode-map): Only bind to eldoc-doc-buffer in Emacs 28.1 or later. --- lisp/progmodes/eglot.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index bcd67205b5b..72a0103c815 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -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 -- 2.39.5