浏览代码

org-eldoc: Use eldoc-documentation-functions when available

This reflects recent changes in GNU Emacs master branch:

2020-02-25T17:53:04-05:00!mvoteiza@udel.edu
c0fcbd2c11 (Expose ElDoc functions in a hook (Bug#28257))

* lisp/org-eldoc.el (org-eldoc-load):
Use 'eldoc-documentation-functions' when available.
Štěpán Němec 5 年之前
父节点
当前提交
7454d20189
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      contrib/lisp/org-eldoc.el

+ 5 - 1
contrib/lisp/org-eldoc.el

@@ -161,7 +161,11 @@
 (defun org-eldoc-load ()
 (defun org-eldoc-load ()
   "Set up org-eldoc documentation function."
   "Set up org-eldoc documentation function."
   (interactive)
   (interactive)
-  (setq-local eldoc-documentation-function #'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)))
 
 
 ;;;###autoload
 ;;;###autoload
 (add-hook 'org-mode-hook #'org-eldoc-load)
 (add-hook 'org-mode-hook #'org-eldoc-load)