unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* eldoc error in Emacs 27
@ 2020-07-27 18:51 Yuan Fu
  2020-07-27 20:03 ` João Távora
  0 siblings, 1 reply; 5+ messages in thread
From: Yuan Fu @ 2020-07-27 18:51 UTC (permalink / raw)
  To: emacs-devel

I’ve been using Emacs 27 pretest and this error occurs to me recently: When I type M-: and type anything in the minibuffer, Emacs shows an error "eldoc error: (void-function elisp-eldoc-funcall)". And if I have debug-on-error set to t, a backtrack pops up and Emacs hangs. Often I can get out of the hang, sometimes I can’t, and sometimes Emacs crashes (once). 

M-x find-library eldoc shows that I’m using the new ELPA version 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). 

I can reproduce by starting Emacs without the dump file (I deleted it) and load the ELPA eldoc.el. Below is the output of report-Emacs-bugs.

Yuan

In GNU Emacs 27.0.91 (build 1, x86_64-apple-darwin19.5.0, NS appkit-1894.50 Version 10.15.5 (Build 19F101))
of 2020-07-27 built on Brown
Windowing system distributor 'Apple', version 10.3.1894
System Description:  Mac OS X 10.15.5

Recent messages:
Loading uniquify...done
Loading electric...done
Loading emacs-lisp/eldoc...done
Loading cus-start...done
Loading tooltip...done
Loading /Applications/Emacs.app/Contents/Resources/lisp/leim/leim-list.el (source)...done
Finding pointers to doc strings...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Loading loadup.el (source)...done
eldoc error: (void-function elisp-eldoc-funcall)
Quit
Configured using:
'configure --with-modules --with-pdumper=yes
--oldincludedir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libxml2/
--with-ns
PKG_CONFIG_PATH=/usr/local/Cellar/zlib/1.2.8/lib/pkgconfig:/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig'

Configured features:
RSVG DBUS GLIB NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS
XIM NS MODULES THREADS JSON PDUMPER LCMS2

Important settings:
 value of $LC_CTYPE: UTF-8
 value of $LANG: en_CN.UTF-8
 locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
 tooltip-mode: t
 global-eldoc-mode: t
 electric-indent-mode: t
 mouse-wheel-mode: t
 tool-bar-mode: t
 menu-bar-mode: t
 file-name-shadow-mode: t
 global-font-lock-mode: t
 blink-cursor-mode: t
 auto-composition-mode: t
 auto-encryption-mode: t
 auto-compression-mode: t
 buffer-read-only: t
 line-number-mode: t
 transient-mark-mode: t

Load-path shadows:
/Applications/Emacs.app/Contents/Resources/lisp/mail/metamail hides /Applications/Emacs.app/Contents/Resources/lisp/obsolete/metamail
/Applications/Emacs.app/Contents/Resources/lisp/sb-image hides /Applications/Emacs.app/Contents/Resources/lisp/obsolete/sb-image

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg
epg-config gnus-util rmail rmail-loaddefs text-property-search time-date
subr-x seq byte-opt bytecomp byte-compile cconv mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils cl-macs gv
easy-mmode cl-loaddefs cl-lib tooltip cus-start eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win
ucs-normalize mule-util term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
timer select scroll-bar mouse jit-lock font-lock syntax facemenu
font-core term/tty-colors frame minibuffer cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads dbusbind kqueue
cocoa ns lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 273628 13956)
(symbols 48 20909 2)
(strings 32 56592 2494)
(string-bytes 1 2401947)
(vectors 16 51731)
(vector-slots 8 1412156 63014)
(floats 8 188 88)
(intervals 56 219 0)
(buffers 1000 12))




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: eldoc error in Emacs 27
  2020-07-27 18:51 eldoc error in Emacs 27 Yuan Fu
@ 2020-07-27 20:03 ` João Távora
  2020-07-27 20:28   ` Yuan Fu
  2020-07-27 20:29   ` João Távora
  0 siblings, 2 replies; 5+ messages in thread
From: João Távora @ 2020-07-27 20:03 UTC (permalink / raw)
  To: Yuan Fu; +Cc: emacs-devel

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:

   (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)
     (eldoc-mode +1))

Why is this Elisp-specific function in eldoc.el? Perhaps it shouldn't
be, but eldoc.el and elisp-mode.el are so unfortunately interwined so it
will have to remain there at least until we abandon Emacs 27 or make
elisp-mode.el a GNU ELPA :core package, too.

For now, the fix is to ensure that this function has an implementation
compatible with Emacs < 28, so that if you package-install a newer ElDoc
version you will not run into this problem.  The FIXME comment _could_
work in theory but I think it'll just bring more problems.  I'll post a
simpler, safer fix, soon.  In the meantime, can you make a bug report to
track this?

Thanks,
João




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: eldoc error in Emacs 27
  2020-07-27 20:03 ` João Távora
@ 2020-07-27 20:28   ` Yuan Fu
  2020-07-27 20:29   ` João Távora
  1 sibling, 0 replies; 5+ messages in thread
From: Yuan Fu @ 2020-07-27 20:28 UTC (permalink / raw)
  To: João Távora; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 607 bytes --]



> On Jul 27, 2020, at 4:03 PM, João Távora <joaotavora@gmail.com> wrote:
> 
> For now, the fix is to ensure that this function has an implementation
> compatible with Emacs < 28, so that if you package-install a newer ElDoc
> version you will not run into this problem.  The FIXME comment _could_
> work in theory but I think it'll just bring more problems.  I'll post a
> simpler, safer fix, soon.  In the meantime, can you make a bug report to
> track this?

Ah, ok. I thought that this could be trivially fixed so didn’t create a bug report. Anyway, now it’s on debbugs #42563.

Yuan

[-- Attachment #2: Type: text/html, Size: 5218 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: eldoc error in Emacs 27
  2020-07-27 20:03 ` João Távora
  2020-07-27 20:28   ` Yuan Fu
@ 2020-07-27 20:29   ` João Távora
  2020-07-27 21:13     ` Yuan Fu
  1 sibling, 1 reply; 5+ messages in thread
From: João Távora @ 2020-07-27 20:29 UTC (permalink / raw)
  To: Yuan Fu; +Cc: emacs-devel

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



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: eldoc error in Emacs 27
  2020-07-27 20:29   ` João Távora
@ 2020-07-27 21:13     ` Yuan Fu
  0 siblings, 0 replies; 5+ messages in thread
From: Yuan Fu @ 2020-07-27 21:13 UTC (permalink / raw)
  To: João Távora; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 906 bytes --]



> On Jul 27, 2020, at 4:29 PM, João Távora <joaotavora@gmail.com> wrote:
> 
> João Távora <joaotavora@gmail.com <mailto: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?

Yes, the error went away after I applied the patch :-)

Yuan

[-- Attachment #2: Type: text/html, Size: 7907 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-07-27 21:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-27 18:51 eldoc error in Emacs 27 Yuan Fu
2020-07-27 20:03 ` João Távora
2020-07-27 20:28   ` Yuan Fu
2020-07-27 20:29   ` João Távora
2020-07-27 21:13     ` Yuan Fu

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).