emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/markdown-mode 4477f381de 3/3: Merge pull request #708 from


From: ELPA Syncer
Subject: [nongnu] elpa/markdown-mode 4477f381de 3/3: Merge pull request #708 from buzztaiki/emacs28_eldoc
Date: Fri, 13 May 2022 10:58:41 -0400 (EDT)

branch: elpa/markdown-mode
commit 4477f381de0068a04b55e198c32614793f67b38a
Merge: 5b6e660c13 1db4ea76d6
Author: Shohei YOSHIDA <syohex@gmail.com>
Commit: GitHub <noreply@github.com>

    Merge pull request #708 from buzztaiki/emacs28_eldoc
    
    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..edd09a72cf 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 (&rest _ignored)
   "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)



reply via email to

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