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

`C-x k` with ivy-mode kills wrong buffer #135

Closed
tsdh opened this Issue Jun 9, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@tsdh
Contributor

tsdh commented Jun 9, 2015

I'm just viewing an attachment of an email received with Gnus. The buffer name is " *mm*-469037". Now I want to kill that buffer and do C-x k. The prompt is 10 Kill buffer (default *mm*-469037): but in the list of candidates, the selected buffer is the gnus summary buffer. And indeed, when I confirm with RET what gets killed is the gnus summary buffer and not the *mm*-469037 buffer. (Well, and having a discrepancy between default value and what's selected is strange anyhow.)

I guess the reason is that the *mm*-469037 buffer is a hidden buffer and thus isn't on the buffer candidate list by default when there's no input starting with a space. If that's indeed the culprit, then basically you have to make sure that the current buffer is always in the list of candidates even though it might be hidden.

@abo-abo abo-abo closed this in 607d943 Jun 9, 2015

@abo-abo

This comment has been minimized.

Show comment
Hide comment
@abo-abo

abo-abo Jun 9, 2015

Owner

Thanks, but it seems to me that kill-buffer is at fault here, since it sets require-match but does not put the proposed default into collection.
Anyway, added a work-around.

Owner

abo-abo commented Jun 9, 2015

Thanks, but it seems to me that kill-buffer is at fault here, since it sets require-match but does not put the proposed default into collection.
Anyway, added a work-around.

@tsdh

This comment has been minimized.

Show comment
Hide comment
@tsdh

tsdh Jun 9, 2015

Contributor

Oleh Krehel notifications@github.com writes:

Thanks, but it seems to me that kill-buffer is at fault here, since
it sets require-match but does not put the proposed default into
collection.
Anyway, added a work-around.

Indeed, that seems strange. But it doesn't only apply to kill-buffer
but to all commands with "b" interactive spec I think. At least
kill-buffer or rather its C subr Fkill_buffer doesn't read the
buffer itself but eventually that's the job of Fcall_interactively
which calls Fread_buffer. And that uses completing read with the
given default and internal-complete-buffer, and the latter suggests
hidden buffers only when the search string has a space prefix.

Bye,
Tassilo

Contributor

tsdh commented Jun 9, 2015

Oleh Krehel notifications@github.com writes:

Thanks, but it seems to me that kill-buffer is at fault here, since
it sets require-match but does not put the proposed default into
collection.
Anyway, added a work-around.

Indeed, that seems strange. But it doesn't only apply to kill-buffer
but to all commands with "b" interactive spec I think. At least
kill-buffer or rather its C subr Fkill_buffer doesn't read the
buffer itself but eventually that's the job of Fcall_interactively
which calls Fread_buffer. And that uses completing read with the
given default and internal-complete-buffer, and the latter suggests
hidden buffers only when the search string has a space prefix.

Bye,
Tassilo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment