Subject: bug#72701: closed (Re: bug#72701: eglot crash when project-files-relative-names t)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 08 Sep 2024 20:52:02 +0000

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 [email-masked].

-- 
72701: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=72701
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#72701: eglot crash when project-files-relative-names t
From: Dmitry Gutov <[email-masked]>
To: João Távora <[email-masked]>
Cc: Eli Zaretskii <[email-masked]>, [email-masked], [email-masked]
Date: Sun, 8 Sep 2024 23:51:43 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

On 08/09/2024 13:56, João Távora wrote:
> On Sun, Sep 8, 2024 at 3:24 AM Dmitry Gutov <[email-masked]> 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.

Subject: eglot crash when project-files-relative-names t
From: Ship Mints <[email-masked]>
To: [email-masked]
Date: Sun, 18 Aug 2024 11:43:01 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

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