-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Mixed project buffer in the tabline #1
Comments
Hi @nicodebo, thanks for reporting this! I'm not using Emacs' The issue seems to be that the new tab is created after selecting the project, but before executing a command within that project ( I looked into the related code briefly, but no obvious solution re. how to handle this in a generic way popped up. I'll continue to look at this once I have more time on my hands, then report back here. Thanks! |
@nicodebo I think I might have found a way to solve the issue you reported. The
I came up with a function that uses the default behavior (all buffers previously visited in the window), then filters out every buffer that doesn't belong to the current buffer's project (if any). Here's that function's definition and how to apply it: (defun project-tab-groups-tab-line-tabs-window-project-buffers ()
"Return a list of tabs that should be displayed in the tab line.
Same as `tab-line-tabs-window-buffers', but if the current buffer
belongs to a project, all other buffers that don't belong to that
project are filtered out."
(let ((window-buffers (tab-line-tabs-window-buffers)))
(if-let* ((pr (project-current))
(project-buffers (project--buffers-to-kill pr)))
(seq-filter (lambda (buf) (member buf project-buffers)) window-buffers)
window-buffers)))
(setq tab-line-tabs-function #'project-tab-groups-tab-line-tabs-window-project-buffers) Add this snippet to your Emacs config if you want and give it a try yourself. A quick first test seems promising, but I want to test-drive this for a week or so before I add it to the package, or its README at least. Note that Let me know if you find anything that's odd or unexpected. Thanks! |
Thank you very much. |
It looks good to me after trying it for a week. |
Awesome, thanks for the update! I'll add a note about this to the project's README, so others can benefit from what we found out. Thanks for your contribution! 🙌 |
It doesn't appear that snippet was ever added to the README. It helps fix the issue for me though, so thanks. :) |
@adamcstephens thanks for the nudge. I added a short description of the problem and a link to this issue / fix in the README's "Limitations" section now. 👍 |
Hello,
Thank you for this package.
I'm not sure if this is an issue.
When opening a new project file (C-x p p f) the previous buffer from the project I switch from appears in the new project tabline.
Consequently, the tabline contains buffer from both projects.
The text was updated successfully, but these errors were encountered: