summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2020-07-18 20:15:32 -0400
committerKyle Meyer <kyle@kyleam.com>2020-07-18 20:15:32 -0400
commitbb427f7bd685a9064053c4109c340307eb584daa (patch)
tree898cb8b3cfdfadb1982102666d27de7babcc0587
parent05fac0b765509b609556455aca003b36d1f92c33 (diff)
parentb2b587387e2b7c0a20251dea670105cf2473158c (diff)
downloadorg-mode-bb427f7bd685a9064053c4109c340307eb584daa.tar.gz
Merge branch 'maint'
-rw-r--r--contrib/lisp/org-eldoc.el17
1 files changed, 12 insertions, 5 deletions
diff --git a/contrib/lisp/org-eldoc.el b/contrib/lisp/org-eldoc.el
index 72b10a1..aa1dcb4 100644
--- a/contrib/lisp/org-eldoc.el
+++ b/contrib/lisp/org-eldoc.el
@@ -127,7 +127,7 @@
(declare-function php-eldoc-function "php-eldoc" ())
(declare-function go-eldoc--documentation-function "go-eldoc" ())
-(defun org-eldoc-documentation-function ()
+(defun org-eldoc-documentation-function (&rest _ignored)
"Return breadcrumbs when on a headline, args for src block header-line,
calls other documentation functions depending on lang when inside src body."
(or
@@ -161,11 +161,18 @@
(defun org-eldoc-load ()
"Set up org-eldoc documentation function."
(interactive)
- (if (boundp 'eldoc-documentation-functions)
+ ;; This approach is taken from python.el.
+ (with-no-warnings
+ (cond
+ ((null eldoc-documentation-function) ; Emacs<25
+ (setq-local eldoc-documentation-function
+ #'org-eldoc-documentation-function))
+ ((boundp 'eldoc-documentation-functions) ; Emacs>=28
(add-hook 'eldoc-documentation-functions
- #'org-eldoc-documentation-function nil t)
- (setq-local eldoc-documentation-function
- #'org-eldoc-documentation-function)))
+ #'org-eldoc-documentation-function nil t))
+ (t
+ (add-function :before-until (local 'eldoc-documentation-function)
+ #'org-eldoc-documentation-function)))))
;;;###autoload
(add-hook 'org-mode-hook #'org-eldoc-load)