Skip to content

Commit ed7f2f9

Browse files
committed
Use modern eldoc-documentation-functions hook
eldoc-documentation-function (singular) is deprecated since Emacs 28.1 in favor of the eldoc-documentation-functions hook.
1 parent 839de5b commit ed7f2f9

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

inf-clojure.el

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,8 +1589,9 @@ Return the number of nested sexp the point was over or after."
15891589
(setq inf-clojure-eldoc-last-symbol (cons thing arglists))
15901590
arglists)))))
15911591

1592-
(defun inf-clojure-eldoc ()
1593-
"Backend function for eldoc to show argument list in the echo area."
1592+
(defun inf-clojure-eldoc (callback &rest _ignored)
1593+
"Backend function for eldoc to show argument list in the echo area.
1594+
CALLBACK is the eldoc callback to invoke with the documentation string."
15941595
(when (and (inf-clojure-connected-p)
15951596
inf-clojure-enable-eldoc
15961597
;; don't clobber an error message in the minibuffer
@@ -1599,13 +1600,13 @@ Return the number of nested sexp the point was over or after."
15991600
(thing (car info))
16001601
(value (inf-clojure-eldoc-arglists thing)))
16011602
(when value
1602-
(format "%s: %s"
1603-
(inf-clojure-eldoc-format-thing thing)
1604-
value)))))
1603+
(funcall callback (format "%s: %s"
1604+
(inf-clojure-eldoc-format-thing thing)
1605+
value))))))
16051606

16061607
(defun inf-clojure-eldoc-setup ()
16071608
"Turn on eldoc mode in the current buffer."
1608-
(setq-local eldoc-documentation-function #'inf-clojure-eldoc)
1609+
(add-hook 'eldoc-documentation-functions #'inf-clojure-eldoc nil t)
16091610
(apply #'eldoc-add-command inf-clojure-extra-eldoc-commands))
16101611

16111612
(defun inf-clojure-display-version ()

0 commit comments

Comments
 (0)