Subject: Re: bug#38294: [PATCH] Handle killing of virtual buffers in Ido

From: Stefan Kangas <[email-masked]>
Date: Wed, 22 Jan 2020 10:00:24 +0100

Hi Dario,

Dario Gjorgjevski <[email-masked]> writes:

> What follows is a way to reproduce this scenario, assuming the file
> ‘foo’ does not exist.
>
> Start by
>
>   M-x recentf-mode <RET>
>   M-x ido-mode <RET>
>   M-: (setq ido-use-virtual-buffers t) <RET>
>   C-x C-f foo <RET> <RET>
>   C-x C-s
>   C-x k <RET>
>
> Now, ‘foo’ is a _virtual buffer_ in the terminology of Ido, and since we
> have ‘ido-use-virtual-buffers’ set to t, we should be able to operate on
> it: switch to it or kill it.  Switching works fine; however, *killing is
> a no-op*.
>
> At this point, when you do
>
>   C-x k foo <RET>
>
> you will notice that ‘foo’ remains in the list of buffers, despite being
> “killed.”  You will still see when doing C-x b or C-x k.  In fact, you
> can repeat the above step ad infinitum.

Thank you for the detailed explanation.

> What this patch changes is exactly this behavior: once a virtual buffer
> has been “killed” from C-x k, it no longer appears in the list of
> buffers.
>
> Let me know if this makes sense.

I think the current behaviour makes sense, but I can very much see
that some users would want what you suggest.  Both choices here are
valid.

Given that Ido has behaved like this for a long time, I would
be wary of changing the default behaviour at this point.  It risks
surprising users.

My suggestion would theferefore be to add a new option to enable the
behaviour you suggest.  It could perhaps be named something like
ido-kill-removes-virtual-buffers, and should be disabled by default.

What do you think?

Best regards,
Stefan Kangas