Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add guard in case dir of buffer is not/no longer readable. #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MagielBruntink
Copy link

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.

@muffinmad
Copy link
Owner

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.

@MagielBruntink
Copy link
Author

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 , directory test 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

@muffinmad
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants