Add ibuffer-vc-buffer-file-name-function option #34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is one way of fixing #25. To recap the issue:
Expected behavior
Only file buffers, "directory buffers" (e.g. Dired buffers), and other VC-related buffers (e.g. Magit buffers) should show up in the VC groups. Examples of buffers that should not show up are: ERC, Gnus,
*Help*
,*info*
, or any other buffer at all that is not related to that VC directory.Actual behavior
If you're visiting a VC-controlled file, and you open an unrelated buffer such as those from ERC, or Gnus, or a
*Help*
buffer, etc., it'll show up in the VC group (because the buffer'sdefault-directory
will point to a VC-controlled directory).Proposed solution
@c-alpha's suggestion in the issue thread works great but it excludes e.g. Dired and Magit buffers, which IMO should go in the VC filter group too. And other people may have other preferences. But right now I don't think we can customize that since
ibuffer-vc-include-function
takes a filename, instead of a buffer.If we introduce a new
ibuffer-vc-include-buffer-function
option that takes a buffer instead, the user can have more control. e.g. I could implement the expected behavior with: