-
Notifications
You must be signed in to change notification settings - Fork 19
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
Non-consuming groups ideas #69
Comments
Hello, I think I'd only use non-consuming groups for "manual" workspaces, so just having non-consuming groups for those might be enough for all cases.
I only want to be able to list I'm not sure that having "non-consuming" groups in general (for |
I think there are a number of potential use cases, e.g. having Magit-related buffers displayed with their repo's buffers, but also having all Magit-related buffers displayed together. As well, I intend to use the grouping functionality developed here in other projects, like org-ql. So I don't want to special-case one kind of group and make it behave differently. Any group should be able to be non-consuming just by specifying a plist option. That's my plan, anyway. |
Taking as an example a Magit buffer. I think the best way to do this would be to
(lambda (buffer)
(when (bufler--magit-buffer-p buffer)
"*Magit*")) and a (lambda (buffer)
(when-let* ((project (with-current-buffer buffer
(project-current)))
(project-root (bufler-project-root project)))
(concat "Project: " project-root)))) in the list that would return non-nil values. I call those "predicate leaves".
|
I don't know, that sounds a little complicated to me. I was thinking something like, rather than having each leaf be a predicate, have it be (or optionally be) a struct (or an alist/plist, whatever) that can specify options, such as consuming/non-consuming. Then the grouping function would do the right thing when applying each leaf to a buffer.
I don't know exactly what you mean, and I might be wrong, but that might not be good for performance. The funcall overhead is already an issue for large numbers of buffers (depending on number of predicates). |
@gagbo I had a kind of epiphany, I think. Check this out: https://github.com/alphapapa/taxy.el I think this can be used as the foundation for Bufler, including non-consuming groups. The code is so much simpler than the |
That looks pretty nice indeed, I didn't look too much into the code yet, but the API seems to already provide most of the necessary stuff (and helper macros to reduce the nesting can come later anyway). I wonder if the keyword argument in elisp can have default values, because I think making |
Yes, I set some defaults for some slots. Check what I just pushed, it adds "dynamic taxys", with an example of classifying buffers by their major mode dynamically. I think this does everything Bufler needs! |
I plan to use |
I saw the branch (and the conversations on emacs-devel about arbitrary tab metadata), I'll just wait for it to be more stable before trying to use it :) |
I'll publish v0.3 of Bufler and then convert it to use Taxy. |
See discussion on:
The text was updated successfully, but these errors were encountered: