-
Notifications
You must be signed in to change notification settings - Fork 33
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
Virtual buffers? #9
Comments
Not as an option to modify the behavior of |
Thanks. Here's a proof of concept: (defun kvf/recentf-find-file ()
"Find a recent file using selectrum."
(interactive)
(let ((file (selectrum-completing-read "Choose recent file: "
(mapcar 'abbreviate-file-name recentf-list)
nil t)))
(when file
(find-file file)))) |
If it's important to you to show both files and buffers at the same time, I would suggest checking the source code of |
Thanks. I'll close this issue and will continue experimenting when I have time. |
Hey @fintelkai, I'm looking for the same functionality (easy access to Edit: Honestly what you've posted does like 90% of what I want, bound to |
@andschwa I'm currently experimenting with Doom, which has a recent file function, using ivy or helm and processing the |
It seem that adding virtual buffers from recentf-list is not that easy as merely appending filenames from the recentf-list to the list of buffer names. Looking at the virtual buffer implementations in ido and ivy (adapted from ido), the candidates from recentf-list are in the form of a list of alist '((name1 . path1) (name2 . path2)). The names serve for sorting, filtering and displaying results in the minibuffer and paths are for visiting the files (e.g. find-file-nonselect). Therefore the combined list of buffers and virtual buffers is passed to either switch-to-buffer or find-file. In the current selectrum implementation, selectrum-read-buffer is set as read-buffer-function which at most serves for switching to buffer and not visiting files. Am I understanding it correctly? |
I added a command for that in the wiki |
Oo a wiki...thanks @clemera! |
@andschwa Thanks for adding another one. I adjusted it to use |
@clemera That's hilarious, I just noticed that when I was looking at in my |
@andschwa Hehe, I think mine shouldn't depend on selectrum either, but I kind of like the narrowing by prefix. |
@clemera, thank you for selectrum-switch-buffer+ |
I have linked to the wiki from the README. |
Does
|
You have to enable lexical binding, by putting a ;; -*- lexical-binding: t -*- at the top of the file. |
I added this information also to the top of the wiki page. I cannot wait until lexical binding becomes the global default; in Emacs 27 it was changed for interactive evaluation but file buffers still use dynamic binding by default. |
One thing I like about ivy is the injection of recent files into the switch buffer list. Is that in your plans for selectrum/prescient?
The text was updated successfully, but these errors were encountered: