Subject: bug#76604: eglot causes eldoc error: (invalid-function incf)

From: Daniel Gomez <[email-masked]>
Date: Wed, 26 Feb 2025 21:40:09 +0000

Dear emacs maintainers,

Trying eglot for the first time on a python file.
Everything works but I get on the minibuffer an eldoc error: 
(invalid-function incf).

For context: I use straight for package management, but have no 
declarations regarding eglot nor eldoc on my init.el.
Emacs 30.1, but I tried under 29.4 with the same issue.

If I set debug-on-error, I get the following, which isn't really 
informative:

Debugger entered--Lisp error: (invalid-function incf)
   incf(0)
   #f(compiled-function (method origin) #<bytecode 
-0xaadc1b6e8ed7d7>)(:patient eglot-signature-eldoc-function)
   eldoc--make-callback(:patient eglot-signature-eldoc-function)
   #f(compiled-function (f) #<bytecode 
-0x6cf6f9fa4609ff8>)(eglot-signature-eldoc-function)
   run-hook-wrapped(#f(compiled-function (f) #<bytecode 
-0x6cf6f9fa4609ff8>) eglot-signature-eldoc-function)
   eldoc-documentation-compose()
   eldoc--invoke-strategy(nil)
   eldoc-print-current-symbol-info()
   #f(compiled-function () #<bytecode -0x1617e223c153308b>)()
   apply(#f(compiled-function () #<bytecode -0x1617e223c153308b>) nil)
   timer-event-handler([t 0 0 500000 nil #f(compiled-function () 
#<bytecode -0x1617e223c153308b>) nil idle 0 nil])

It seems incf is being used in eldoc.el, an Emacs core package. That 
should not happen since as far as I understand cl is deprecated.

;;; eldoc.el --- Show function arglist or variable docstring in echo 
area  -*- lexical-binding:t; -*-

;; Copyright (C) 1996-2025 Free Software Foundation, Inc.

;; Author: Noah Friedman <[email-masked]>
;; Keywords: extensions
;; Created: 1995-10-06
;; Version: 1.15.0
;; Package-Requires: ((emacs "26.3"))

;; This is a GNU ELPA :core package.  Avoid functionality that is not
;; compatible with the version of Emacs recorded above.

Thank you.

Regards,
Daniel

ps: issue on github: 
https://github.com/joaotavora/eglot/discussions/1487#discussioncomment-12330803