emacs-devel
[Top][All Lists]
Advanced

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

Re: eldoc error in Emacs 27


From: João Távora
Subject: Re: eldoc error in Emacs 27
Date: Mon, 27 Jul 2020 21:29:55 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

João Távora <joaotavora@gmail.com> writes:

> Yuan Fu <casouri@gmail.com> writes:
>
>> 1.5. I looked around in that file and didn’t see elisp-eldoc-funcall
>> defined anywhere (neither can I in the old eldoc.el that comes with
>> Emacs 27).
>
> Thanks for reporting this.  I introduced this bug.  The function you get
> the error for is not defined in eldoc.el ? 1.5.0 but referenced there:

Actually, a similar bug was lurking before I touched the function, I
just exposed it by making ElDoc available on GNU Elpa.  I think the
patch below is the easiest way to fix it, along with bumping the ElDoc
version to 1.8.  Works in my tests of Emacs 27 and Emacs 26.  Can you
try it out?

diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index b30836cc0b..aa1acabaa3 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -5,7 +5,7 @@
 ;; Author: Noah Friedman <friedman@splode.com>
 ;; Keywords: extensions
 ;; Created: 1995-10-06
-;; Version: 1.7.0
+;; Version: 1.8.0
 ;; Package-Requires: ((emacs "26.3"))
 
 ;; This is a GNU ELPA :core package.  Avoid functionality that is not
@@ -229,11 +229,14 @@ global-eldoc-mode
 (defun eldoc--eval-expression-setup ()
   ;; Setup `eldoc', similar to `emacs-lisp-mode'.  FIXME: Call
   ;; `emacs-lisp-mode' itself?
-  (add-hook 'eldoc-documentation-functions
-            #'elisp-eldoc-var-docstring nil t)
-  (add-hook 'eldoc-documentation-functions
-            #'elisp-eldoc-funcall nil t)
-  (setq eldoc-documentation-strategy 'eldoc-documentation-default)
+  (if (<= emacs-major-version 27)
+      (add-function :before-until (local 'eldoc-documentation-function)
+                    #'elisp-eldoc-documentation-function)
+    (add-hook 'eldoc-documentation-functions
+              #'elisp-eldoc-var-docstring nil t)
+    (add-hook 'eldoc-documentation-functions
+              #'elisp-eldoc-funcall nil t)
+    (setq eldoc-documentation-strategy 'eldoc-documentation-default))
   (eldoc-mode +1))
 
 ;;;###autoload



reply via email to

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