summaryrefslogtreecommitdiff
path: root/elisp
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-04-10 04:06:57 +0100
committerjao <jao@gnu.org>2022-04-10 04:06:57 +0100
commit1300dd1a410a172588c529734a4fb1c8b58eaef1 (patch)
tree9cf09331f4c8957818f0e3f539376ad1e07b756e /elisp
parentdcbd8e81ac19ec808a4980ea99e7ee3f4f354c79 (diff)
downloadgeiser-1300dd1a410a172588c529734a4fb1c8b58eaef1.tar.gz
geiser-1300dd1a410a172588c529734a4fb1c8b58eaef1.tar.bz2
autodoc: make do without dependending on elpa's eldoc
Playing the trick of checking for eldoc-documentation-functions to know wheter we're at a new enough version, and (hopefully) falling back to the old implementation otherwise.
Diffstat (limited to 'elisp')
-rw-r--r--elisp/geiser-autodoc.el17
-rw-r--r--elisp/geiser.el2
2 files changed, 11 insertions, 8 deletions
diff --git a/elisp/geiser-autodoc.el b/elisp/geiser-autodoc.el
index 54669a1..674e0dd 100644
--- a/elisp/geiser-autodoc.el
+++ b/elisp/geiser-autodoc.el
@@ -193,10 +193,10 @@ when `geiser-autodoc-display-module-p' is on."
(defsubst geiser-autodoc--autodoc-at-point (callback)
(geiser-autodoc--autodoc (geiser-syntax--scan-sexps) callback))
-(defun geiser-autodoc--eldoc-function (callback)
+(defun geiser-autodoc--eldoc-function (&optional callback)
(ignore-errors
(when (not (geiser-autodoc--inhibit))
- (geiser-autodoc--autodoc-at-point callback))))
+ (geiser-autodoc--autodoc-at-point (or callback 'eldoc-message)))))
(defun geiser-autodoc-show ()
"Show the signature or value of the symbol at point in the echo area."
@@ -221,11 +221,14 @@ displayed in the minibuffer."
:lighter geiser-autodoc-mode-string
:group 'geiser-autodoc
- (if geiser-autodoc-mode
- (add-hook 'eldoc-documentation-functions
- #'geiser-autodoc--eldoc-function nil t)
- (remove-hook 'eldoc-documentation-functions
- #'geiser-autodoc--eldoc-function t))
+ (if (boundp 'eldoc-documentation-functions)
+ (if geiser-autodoc-mode
+ (add-hook 'eldoc-documentation-functions
+ #'geiser-autodoc--eldoc-function nil t)
+ (remove-hook 'eldoc-documentation-functions
+ #'geiser-autodoc--eldoc-function t))
+ (set (make-local-variable 'eldoc-documentation-function)
+ (when geiser-autodoc-mode 'geiser-autodoc--eldoc-function)))
(set (make-local-variable 'eldoc-minor-mode-string) nil)
(set (make-local-variable 'eldoc-idle-delay) geiser-autodoc-delay)
(eldoc-mode (if geiser-autodoc-mode 1 -1))
diff --git a/elisp/geiser.el b/elisp/geiser.el
index e89f3d3..7fad7d0 100644
--- a/elisp/geiser.el
+++ b/elisp/geiser.el
@@ -11,7 +11,7 @@
;; Maintainer: Jose Antonio Ortega Ruiz (jao@gnu.org)
;; Keywords: languages, scheme, geiser
;; Homepage: https://gitlab.com/emacs-geiser/
-;; Package-Requires: ((emacs "25.1") (eldoc "1.11") (transient "0.3") (project "0.8.1"))
+;; Package-Requires: ((emacs "25.1") (transient "0.3") (project "0.8.1"))
;; SPDX-License-Identifier: BSD-3-Clause
;; Version: 0.23.2