emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/elpa 4e82f53 53/71: Reload Eldoc if needed on Emacs < 2


From: João Távora
Subject: [elpa] externals/elpa 4e82f53 53/71: Reload Eldoc if needed on Emacs < 28
Date: Wed, 16 Dec 2020 11:42:25 -0500 (EST)

branch: externals/elpa
commit 4e82f53f17a5df0737c353a5ce811a6f6cc9a366
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Reload Eldoc if needed on Emacs < 28
    
    ElDoc is preloaded in Emacs, so `require`-ing won't guarantee we are
    using the latest version from GNU Elpa when we load eglot.el.  Use an
    heuristic to see if we need to `load` it in Emacs < 28.
    
    * eglot.el (Package-Requires): Require eldoc 1.5.0
    (top): Sometimes load eldoc
---
 eglot.el | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/eglot.el b/eglot.el
index 87fd9c8..865ca03 100644
--- a/eglot.el
+++ b/eglot.el
@@ -7,7 +7,7 @@
 ;; Maintainer: João Távora <joaotavora@gmail.com>
 ;; URL: https://github.com/joaotavora/eglot
 ;; Keywords: convenience, languages
-;; Package-Requires: ((emacs "26.1") (jsonrpc "1.0.9") (flymake "1.0.9") 
(project "0.3.0") (xref "1.0.1") (eldoc "1.2.0"))
+;; Package-Requires: ((emacs "26.1") (jsonrpc "1.0.9") (flymake "1.0.9") 
(project "0.3.0") (xref "1.0.1") (eldoc "1.5.0"))
 
 ;; This program is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
@@ -72,6 +72,15 @@
 (require 'filenotify)
 (require 'ert)
 (require 'array)
+
+;; ElDoc is preloaded in Emacs, so `require'-ing won't guarantee we are
+;; using the latest version from GNU Elpa when we load eglot.el.  Use an
+;; heuristic to see if we need to `load' it in Emacs < 28.
+(if (and (< emacs-major-version 28)
+         (not (boundp 'eldoc-documentation-strategy)))
+    (load "eldoc")
+  (require 'eldoc))
+
 ;; forward-declare, but don't require (Emacs 28 doesn't seem to care)
 (defvar markdown-fontify-code-blocks-natively)
 (defvar company-backends)



reply via email to

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