unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#72701: eglot crash when project-files-relative-names t
@ 2024-08-18 15:43 Ship Mints
  2024-08-22 17:04 ` Ship Mints
  2024-08-22 23:22 ` Dmitry Gutov
  0 siblings, 2 replies; 16+ messages in thread
From: Ship Mints @ 2024-08-18 15:43 UTC (permalink / raw)
  To: 72701

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

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

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

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

end of thread, other threads:[~2024-09-08 20:51 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-18 15:43 bug#72701: eglot crash when project-files-relative-names t Ship Mints
2024-08-22 17:04 ` Ship Mints
2024-08-22 17:52   ` Eli Zaretskii
2024-08-22 17:53     ` Ship Mints
2024-08-22 20:38     ` João Távora
2024-08-23 15:07       ` Ship Mints
2024-08-23 22:49         ` João Távora
2024-08-22 23:22 ` Dmitry Gutov
2024-08-23 14:56   ` Ship Mints
2024-08-23 15:08     ` João Távora
2024-08-23 15:10       ` Ship Mints
2024-08-23 23:51       ` Dmitry Gutov
2024-09-07  7:20         ` Eli Zaretskii
2024-09-08  2:24           ` Dmitry Gutov
2024-09-08 10:56             ` João Távora
2024-09-08 20:51               ` Dmitry Gutov

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).