[Top][All Lists]

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

[PATCH] Make org-eldoc work with Emacs 28

From: James N. V. Cash
Subject: [PATCH] Make org-eldoc work with Emacs 28
Date: Fri, 10 Jul 2020 12:22:18 -0400

In Emacs 28, eldoc now passes in a callback to the documentation
functions. This breaks org-eldoc as it currently is, as
org-eldoc-documentation-function gets called with the wrong number of

This patch makes it continue to work by setting the new variable
eldoc-documentation-strategy, which puts eldoc in
"backwards-compatability" mode.

>From 5c04048c0d1ed3f80c7dd3e6477e12fc8e760675 Mon Sep 17 00:00:00 2001
From: "James N. V. Cash" <james.nvc@gmail.com>
Date: Fri, 10 Jul 2020 11:56:23 -0400
Subject: [PATCH] Make org-eldoc work with Emacs 28's new eldoc API

Still using backward-compatability to use the old style of
function. The new way is to make the documentation function take a
callback, but this approach means the fewest changes.
 contrib/lisp/org-eldoc.el | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/contrib/lisp/org-eldoc.el b/contrib/lisp/org-eldoc.el
index 72b10a1fb..060674b24 100644
--- a/contrib/lisp/org-eldoc.el
+++ b/contrib/lisp/org-eldoc.el
@@ -161,11 +161,15 @@
 (defun org-eldoc-load ()
   "Set up org-eldoc documentation function."
-  (if (boundp 'eldoc-documentation-functions)
-      (add-hook 'eldoc-documentation-functions
-               #'org-eldoc-documentation-function nil t)
-    (setq-local eldoc-documentation-function
-               #'org-eldoc-documentation-function)))
+  (cond
+   ((boundp 'eldoc-documentation-strategy)
+    (setq-local eldoc-documentation-strategy
+               #'org-eldoc-documentation-function))
+   ((boundp 'eldoc-documentation-functions)
+    (add-hook 'eldoc-documentation-functions
+             #'org-eldoc-documentation-function nil t))
+   (t (setq-local eldoc-documentation-function
+                 #'org-eldoc-documentation-function))))
 (add-hook 'org-mode-hook #'org-eldoc-load)

reply via email to

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