GNU bug report logs - #72701
eglot crash when project-files-relative-names t

Previous Next

Package: emacs;

Reported by: Ship Mints <shipmints <at> gmail.com>

Date: Sun, 18 Aug 2024 15:47:02 UTC

Severity: normal

Done: Dmitry Gutov <dmitry <at> gutov.dev>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Eli Zaretskii <eliz <at> gnu.org>, joaotavora <at> gmail.com
Cc: 72701 <at> debbugs.gnu.org, shipmints <at> gmail.com
Subject: bug#72701: eglot crash when project-files-relative-names t
Date: Sun, 8 Sep 2024 05:24:17 +0300
On 07/09/2024 10:20, Eli Zaretskii wrote:
> Ping!  Is this issue resolved and can be closed, or do we need to do
> anything else here?

I suggest installing the following. Not a hard necessity, but seems like 
an improvement:

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index acc197754db..e5b14ce9f80 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -3813,6 +3813,7 @@ eglot--code-action
 (cl-defmethod eglot-register-capability
   (server (method (eql workspace/didChangeWatchedFiles)) id &key watchers)
   "Handle dynamic registration of workspace/didChangeWatchedFiles."
+  (defvar project-files-relative-names)
   (eglot-unregister-capability server method id)
   (let* (success
          (globs (mapcar
@@ -3823,6 +3824,7 @@ eglot-register-capability
                          ;; (2), WatchKind.Delete (4)
                          (or kind 7)))
                  watchers))
+         (project-files-relative-names nil)
          (dirs-to-watch
           (delete-dups (mapcar #'file-name-directory
                                (project-files
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index c38d3f0048a..78f5c127900 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -331,7 +331,10 @@ project-files-relative-names
 The file names should be relative to the project root.  And this can
 only happen when all returned files are in the same directory.
 In other words, the DIRS argument of `project-files' has to be nil or a
-list of only one element.")
+list of only one element.
+
+This variable is only meant to be set by Lisp code, not customized by
+the user.")

 (cl-defgeneric project-files (project &optional dirs)
   "Return a list of files in directories DIRS in PROJECT.





This bug report was last modified 254 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.