emacs-ibuffer-project
emacs-ibuffer-project copied to clipboard
Add guard in case dir of buffer is not/no longer readable.
In case the file/directory of an open buffer has been deleted/moved/made unreadable, calling project-current
would throw an error Opening directory: Not a directory
. This PR adds a guard against that situation.
Thank you for PR!
Can you please provide steps to reproduce the issue?
The default-directory
buffer variable is not changed when directory is deleted. And the project-current
function will return nil
for not existing directory.
I've opened file inside git repository, then deleted the project folder and I see no errors when calling ibuffer.
It's quite an edge case, really. Had to puzzle a bit to replicate it :-)
- Create a directory, eg
test
and open it with dired -
M-x ibuffer
, directorytest
should appear - Kill the Ibuffer buffer
- Delete the directory
-
M-x ibuffer-project-clear-cache
- Create a file in the same dir with the same name
test
, save it -
M-x ibuffer
should then show the error message
I still cannot reproduce the issue. What is the value of the default-directory
variable in newly created file after this step?
Create a file in the same dir with the same name
test
, save it