Subject: Re: bug#23276: 25.0.92; Crash in auto-revert when file no longer present

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 27 Apr 2022 16:09:54 +0200

Boruch Baum <[email-masked]> writes:

> I don't see in that long discussion treatment of the case of a dired
> buffer when the directory it describes is deleted. In such a case, there
> isn't any meaningful recovery operation that I can think of, and any
> attempted operation on the buffer would only be a waste of time and
> throw errors.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

I tried deleting a directory from underneath a Dired buffer (with
auto-revert on), and Emacs didn't do anything in particular with it
(which is consistent with how Emacs handles other files that disappear).

> The biggest waste-of-time case that I can think of would be entering
> wdired-mode on the buffer. I've tried it and it only throws an error on
> exit, so a user could spend significant time editing the buffer for
> naught. Of course, a solution for that specific case could be coded
> outside of autorevert, to have wdired-mode itself refuse to operate on a
> non-existent dired directory
> 
>   (unless (file-directory-p dired-directory)
>     ...

wdired (now, at least) warns about this situation, but I've now made it
signal an error in Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no