C-x C-s in entry's buffer.delete-file, Emacs re-saves the buffer to the file.So it appears that when the user calls save-buffer, we need to check whether the entry exists before refusing to save what appears to be an unmodified buffer. (This check is currently happening in Emacs but not in our code.)
basic-save-bufferdoes this:(if (or (buffer-modified-p) ;; Handle the case when no modification has been made but ;; the file disappeared since visited. (and buffer-file-name (not (file-exists-p buffer-file-name)))) ;; Other logic, including write-contents-functions )meaning that there's no way for
hyperdrive--write-contentsto run whenbuffer-modified-preturnsnil.I think the best course of action is to iterate through the buffer list after deleting a file/directory and call
(set-buffer-modified-p)on each buffer visiting a deleted file.Perhaps in a hook?
Fixed in 5d3d0cf9