When ido-use-virtual-buffers
is set to t
, ido-switch-buffer
shows, after the list of live buffers, a list of killed file buffers in chronological order, last killed first. Those are what Ido calls virtual buffers.
I'd like to have a command – I'll call it ido-find-virtual-buffer-file
– that prompts for a virtual buffer, offering the virtual buffers from that list as completion candidates. In other words, ido-find-virtual-buffer-file
would work just like ido-switch-buffer
except that it would omit the list of live buffers.
This would make it a quick operation to reopen a recently killed file and in particular, if ido-find-virtual-buffer-file
was bound to, say, C-c r
, then C-c r RET
would directly open the most recently killed file.
ido-virtual-buffers
: IIUC, that's exactly what you need.recentf-list
with fontification added, as far as I understand. Crucially, buffers are not in the same order as they appear in the completion candidates ofido-switch-buffer
. However, Ido uses the functionido-add-virtual-buffers-to-list
to attach the list of virtual buffers to the list of live buffers. I've tried to turn that into a function that makes a standalone list of virtual buffers and it seems to work. An edit is coming soon. Can you take a look at it, please?(setq ido-virtual-buffers nil)
at the beginning of your function is questionable. I would need to understand the rest of the code that modifiesido-virtual-bufers
much better to make any constructive comments.(setq ido-virtual-buffers nil)
at the beginning of your function is questionable I thought the same but it's inido-add-virtual-buffers-to-list
, the function works, so I kept it. I think the function rebuildsido-virtual-buffers
where it does(push (cons name head) ido-virtual-buffers)
.