Comments (7)
I think this is a function of how you set tab-bar-new-tab-choice
. I have mine set to the scratch buffer. But if it is set to t
then this is what happens:
If t, start a new tab with the current buffer, i.e. the buffer
that was current before calling the command that adds a new tab
(this is the same what make-frame does by default).
If that is what is going on here I'm not sure I want to make any changes in the code since I don't want to conflict with people's tab settings etc. But I can put something in the README about it. Can you try it with something other than t
set and see if that fixes the issue?
from tabspaces.
Ah, yes, I do have that set to t
. It works as you described. I can make use of that in my function. Thanks.
from tabspaces.
Great - thanks for raising the issue though. I'll put a note in the docs about this setting.
from tabspaces.
Hm, seems it is not so straight forward when using this, it does not include the current buffer initially in the buffer list. It gets there eventually though. I admit I don't fully understand the way the buffer list works. That said, I wonder if the current buffer should be included within tabspaces-create-workspace
? If so, you might consider doing:
(defun tabspaces-open-existing-project-and-workspace ()
"Open an existing project as its own workspace."
(interactive)
(let ((tab-bar-new-tab-choice (lambda () (call-interactively #'tabspaces-project-switch-project-open-file))))
(tabspaces-create-workspace))
(tab-bar-rename-tab (tabspaces--name-tab-by-project-or-default)))
from tabspaces.
Interestingly, this function doesn't work well for me (i.e. it doesn't show the buffer picked with tabspaces-project-switch-project-open-file
initially in the buffer list, though it does open that buffer correctly). The old function works perfectly well. I suspect this may also be just a consult problem since the buffer list seems to update just using tabspaces-switch-to-buffer
.
from tabspaces.
I don't think it's a consult problem. I think it doesn't get added to the buffer list until it is switched away from and it is initially filtered out by tabspaces-create-workspace
. Try this:
(defun tabspaces-create-workspace (&optional arg)
"Create a new tab/workspace with cleaned buffer lists.
ARG is directly passed to `tab-bar-new-tab'. Only buffers in
`tabspaces-include-buffers' are kept in the `buffer-list' and
`buried-buffer-list'."
(interactive)
(tab-bar-new-tab arg)
;; https://www.gnu.org/software/emacs/manual/html_node/elisp/Current-Buffer.html
;; The current-tab uses `buffer-list' and `buried-buffer-list'.
;; A hidden tab keeps these as `wc-bl' and `wc-bbl'.
(set-frame-parameter nil
'buffer-list
(seq-filter (lambda (buffer)
(or (eq buffer (current-buffer))
(member (buffer-name buffer)
tabspaces-include-buffers)))
(frame-parameter nil 'buffer-list)))
(set-frame-parameter nil
'buried-buffer-list
(seq-filter (lambda (buffer)
(member (buffer-name buffer)
tabspaces-include-buffers))
(frame-parameter nil 'buried-buffer-list))))
from tabspaces.
The previous method only works coincidentally because your tab-bar-new-tab-choice
happens to be in your tabspaces-include-buffers
. (and the tabspaces-project-switch-project-open-file
happens after the buffer-list
is filtered, ensuring that the new buffer gets added to the buffer-list
)
from tabspaces.
Related Issues (20)
- C-c TAB b to switch buffers always lists the current buffer at the top of the list HOT 2
- when switching buffer and tab to an existing buffer, it gets added to the current tabspace HOT 3
- Support restoring project eshell and dired buffers in tabspaces HOT 1
- Add tabspaces-session-file to no-littering HOT 1
- Error when opening project tab space first time HOT 4
- tabspaces with non-project buffers HOT 2
- Rename created tabspace HOT 2
- [BUG] two projects with same name are considered as one workspace HOT 1
- [SUGGESTION] a nicer tabspaces-ivy-switch-buffer HOT 1
- [SUGGESTION] Don't overwrite `project-switch-commands` HOT 2
- Customise `magit-init` call when opening a project HOT 1
- Unusable `tabspaces-open-or-create-project-and-workspace` HOT 3
- [SUGGESTION] Enable tabspace duplication only when `tabspaces-open-or-create-project-and-workspace` is called with C-u prefix HOT 2
- [BUG] two projects with same name are considered as one workspace HOT 18
- Switch between tabspaces HOT 2
- Question about tabspaces-exclude-buffers HOT 1
- Missing support for tab-group / integration with desktop.el HOT 4
- tabspaces-switch-or-create doesn't create empty workspace HOT 7
- Displays *Messages* buffer HOT 8
- Mixing tabspaces-switch-to-buffer with tab-bar-select-tab leaks buffer to another tab HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tabspaces.