emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Make org-eldoc work with Emacs 28
@ 2020-07-10 16:22 James N. V. Cash
  2020-07-13 16:23 ` Nicolas Goaziou
  2020-07-16  1:20 ` Basil L. Contovounesios
  0 siblings, 2 replies; 12+ messages in thread
From: James N. V. Cash @ 2020-07-10 16:22 UTC (permalink / raw)
  To: emacs-orgmode


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
arguments.

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."
   (interactive)
-  (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))))
 
 ;;;###autoload
 (add-hook 'org-mode-hook #'org-eldoc-load)
-- 
2.17.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-07-19  0:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-10 16:22 [PATCH] Make org-eldoc work with Emacs 28 James N. V. Cash
2020-07-13 16:23 ` Nicolas Goaziou
     [not found]   ` <87zh83l66q.fsf@gmail.com>
2020-07-13 16:41     ` James N. V. Cash
2020-07-16  1:20 ` Basil L. Contovounesios
2020-07-16  4:29   ` Kyle Meyer
2020-07-16 14:34     ` James N. V. Cash
2020-07-17  5:41       ` [PATCH] org-eldoc: Fix compatibility " Kyle Meyer
2020-07-17 10:12         ` Basil L. Contovounesios
2020-07-17 16:13           ` Eric Abrahamsen
2020-07-17 22:11           ` Kyle Meyer
2020-07-17 11:24         ` Joseph Mingrone
2020-07-19  0:20           ` Kyle Meyer

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).