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: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ship Mints <shipmints <at> gmail.com>
Subject: bug#72701: closed (Re: bug#72701: eglot crash when
 project-files-relative-names t)
Date: Sun, 08 Sep 2024 20:52:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#72701: eglot crash when project-files-relative-names t

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 72701 <at> debbugs.gnu.org.

-- 
72701: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=72701
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Dmitry Gutov <dmitry <at> gutov.dev>
To: João Távora <joaotavora <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 72701-done <at> debbugs.gnu.org,
 shipmints <at> gmail.com
Subject: Re: bug#72701: eglot crash when project-files-relative-names t
Date: Sun, 8 Sep 2024 23:51:43 +0300
On 08/09/2024 13:56, João Távora wrote:
> On Sun, Sep 8, 2024 at 3:24 AM Dmitry Gutov <dmitry <at> gutov.dev> wrote:
>>
>> 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:
> 
> Let's not, for all the reasons enunciated up-thread.

Very well - I've just installed the docstring update. Thanks, closing.

[Message part 3 (message/rfc822, inline)]
From: Ship Mints <shipmints <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: eglot crash when project-files-relative-names t
Date: Sun, 18 Aug 2024 11:43:01 -0400
[Message part 4 (text/plain, inline)]
project-files-relative-names was introduced a few months ago, so it's no
surprise that there are some side effects when set.

This affects the handler for workspace/didChangeWatchedFiles. The result is
that dirs-to-watch...

         (dirs-to-watch
          (delete-dups (mapcar #'file-name-directory
                               (project-files
                                (eglot--project server))))))

...is nil when project-files-relative-names is t, due to
file-name-directory failing to parse the directories it was expecting. This
results in file-readable-p failing with a nil dir:

         (watch-dir (dir)
           (when-let ((probe
                       (and (file-readable-p dir)

One solution which I've tested is simply the defensive:

         (project-files-relative-names nil) ; add this
         (dirs-to-watch
          (delete-dups (mapcar #'file-name-directory
                               (project-files
                                (eglot--project server))))))

-Stephane
[Message part 5 (text/html, inline)]

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.