[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/markdown-mode b2e0348dd1 1/3: support newer version Eldoc
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/markdown-mode b2e0348dd1 1/3: support newer version Eldoc ships with Emacs 28 |
Date: |
Fri, 13 May 2022 10:58:41 -0400 (EDT) |
branch: elpa/markdown-mode
commit b2e0348dd107544bdd022ed5e2ff45652ee045b6
Author: Taiki Sugawara <buzz.taiki@gmail.com>
Commit: Taiki Sugawara <buzz.taiki@gmail.com>
support newer version Eldoc ships with Emacs 28
---
CHANGES.md | 1 +
markdown-mode.el | 8 +++++---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/CHANGES.md b/CHANGES.md
index da1f7d795f..5232113e9f 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -13,6 +13,7 @@
- `markdown` passes `buffer-file-name` as a parameter to
`markdown-command` when `markdown-command-needs-filename` is
`t` and `markdown-command` is a function.
+ - Support newer version Eldoc ships with Emacs 28.
[gh-705]: https://github.com/jrblevin/markdown-mode/issues/705
diff --git a/markdown-mode.el b/markdown-mode.el
index 3eca261e66..83d18b7466 100644
--- a/markdown-mode.el
+++ b/markdown-mode.el
@@ -9663,7 +9663,7 @@ rows and columns and the column alignment."
;;; ElDoc Support =============================================================
-(defun markdown-eldoc-function ()
+(defun markdown-eldoc-function (&optional _callback &rest _args)
"Return a helpful string when appropriate based on context.
* Report URL when point is at a hidden URL.
* Report language name when point is a code block with hidden markup."
@@ -9803,8 +9803,10 @@ rows and columns and the column alignment."
;; Cause use of ellipses for invisible text.
(add-to-invisibility-spec '(outline . t))
;; ElDoc support
- (add-function :before-until (local 'eldoc-documentation-function)
- #'markdown-eldoc-function)
+ (if (boundp 'eldoc-documentation-functions)
+ (add-hook 'eldoc-documentation-functions #'markdown-eldoc-function nil t)
+ (add-function :before-until (local 'eldoc-documentation-function)
+ #'markdown-eldoc-function))
;; Inhibiting line-breaking:
;; Separating out each condition into a separate function so that users can
;; override if desired (with remove-hook)