bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#68546: 29.1.90; end-of-file has incorrect data when signaled within


From: Dmitry Gutov
Subject: bug#68546: 29.1.90; end-of-file has incorrect data when signaled within a load
Date: Wed, 17 Jan 2024 22:55:41 +0200
User-agent: Mozilla Thunderbird

On 17/01/2024 21:04, Spencer Baugh wrote:
As one particular example of the confusing current behavior, a user had
corrupted their ~/.emacs.d/projects so that reading it failed.  Also,
they had a call to (project-forget-zombie-projects) in their init.el.
In combination, this meant Emacs startup errored with:

End of file during parsing:/home/user/.emacs.d/init.el

even though there was no syntax error in init.el at all.

Would something like this help with this particular sub-problem?

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index a6f14a0865c..196a82757b2 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1694,7 +1694,9 @@ project--read-project-list
                  (let ((name (car elem)))
                    (list (if (file-remote-p name) name
                            (abbreviate-file-name name)))))
-               (read (current-buffer))))))
+               (condition-case nil
+                   (read (current-buffer))
+ (end-of-file (warn "Failed to read the projects list file")))))))
     (unless (seq-every-p
              (lambda (elt) (stringp (car-safe elt)))
              project--list)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]