Replies: 6 comments 2 replies
-
Just to be concrete about what I meant when I said you'd still end up with the same amount of code and complexity, take Frame(defun activities--switch (activity)
"Switch to ACTIVITY.
Select's ACTIVITY's frame, making a new one if needed. Its state
is not changed."
(if (activities-activity-active-p activity)
(select-frame (activities--frame activity))
(pcase activities-resume-into-frame
('current nil)
('new (select-frame (make-frame `((activity . ,activity)))))))
(unless activities-saving-p
;; HACK: Don't raise the frame when saving the activity's state.
;; (I don't love this solution, largely because it only applies
;; when not using `activities-tabs-mode', but it will do for now.)
(raise-frame))
(when activities-set-frame-name
(set-frame-name (activities-name-for activity)))) tab-bar(defun activities-tabs--switch (activity)
"Switch to ACTIVITY.
Selects its tab, making one if needed. Its state is not changed."
(if-let ((tab (activities-tabs--tab activity)))
(tab-bar-switch-to-tab (alist-get 'name tab))
(tab-bar-new-tab))
(tab-bar-rename-tab (activities-name-for activity))) So a new unified
I can fairly well envision that this would be at least as complicated as the two separate functions we have now, of which only one is active at a time. It seems to me a small additional bit of logic in an advice to |
Beta Was this translation helpful? Give feedback.
-
Yep there will be those cases. Perhaps some unification makes policy setting and feature implementations easier if it's all in one place? Maybe this is just me being new to the code. While your point may not argue in support of unifying the code, it doesn't negate the point/need about supporting both modes at the same time. Perhaps using the method I described to tell if a frame is tabbed or not. Thank you for taking the time and effort to participate in the discussion. Your own Emacs contributions are clever. Gonna grab |
Beta Was this translation helpful? Give feedback.
-
I edited the topic to make it clearer that I (perhaps we) prioritize simultaneous support for both frames and tabs and unifying the code base might just be a nice-to-have or just be impractical. Supporting both modes can be done with the existing code structure for sure. |
Beta Was this translation helpful? Give feedback.
-
IMO what you're really wanting is a complete redesign of how activities interact with frames and tabs. I think it would be helpful to start by thinking in terms of 2 or 3 use cases or workflows in which we describe the end result the user wants, and then think about how to design the functionality to enable the user to do so in a flexible, simple way. For example:
IME the hardest part is designing this kind of functionality to be useful, simple, and comprehensible. Once the design is done, writing the code is straightforward, just a matter of looking up the APIs and fixing edge cases. |
Beta Was this translation helpful? Give feedback.
-
Other discussion also happened in #78 and #84. Please consolidate further discussion here. Thanks. |
Beta Was this translation helpful? Give feedback.
-
After reading the different discussions on the matter, I'd like to advocate the idea of activity groups (with sub-activities) which has been somewhat discussed in #84 (the use case described there is exactly how I currently use emacs frame/tab-constellations). If I am not misunderstanding the other suggestions, the notion of activity groups (as per #84 (comment)) could be a good approach which allows adding on top of existing functionality without requiring a redesign from the ground up. EDIT: as to implementation, I had something in mind which appears more simple than what I have read in prior discussions. In my current workflow, an activity group consists of one frame with several tabs, each of which is a sub-activity of the project I am currently working on. What is part of this project (the bundled sub-activities) might change over time, which means I delete tabs I deem no longer relevant, while others persist and new ones are created. In my mind, a command could be written that creates an activity group out of those tabs within the current frame. There is no "reparenting" of sub-activities, an activity group can be altered by changing the (contents of) tabs and overwriting its prior state. I believe such a limited implementation would leave the current code largely untouched, simply adding another "module" to extisting functionality. It could even be its own supplemental package with a narrow scope. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This discussion started in #102 which included @jdtsmith and @alphapapa and now moved here. I am attempting to copy the core of the ideas and concerns here for discussion.
The current
activities
code base is bifurcated, frame-only, and tabs-only which itself is built on top of the frame-only code through many function overrides that lead to duplication of code and policy. This makes it harder to diagnose issues, harder to introduce new features, and generally harder to understand.It also makes it impossible in its current form to support both frame-oriented style and tab-oriented style of use simultaneously. I prefer a combination work flow with certain frames containing a no-tab
activities
activity tied to the frame and some frames havingactivities
-aware tabs. I'd guess the ability to handle both workflows is the default assumption of most new users and may be the cause of some confusion as they try to get the best of both worlds. Supporting both is also useful for multi-monitor or multi-desktop users who want frames from the same Emacs session in more than one place and this includes users ofemacs-mac
which affords more native frame experience to MacOS users.In the current
activities
implementation, to get both styles (but with limitations on frame behavior), one is forced to pick tab-mode with one hidden tab. For frame-only users, they currently give up ever having the option to use tabs in alternative frames, being stuck in frame-only mode.One idea to make this possible it to piggyback on the
tab-bar-mode
frame-parameter
'tab-bar-lines
which is set to 1 when a frame hastab-bar
enabled, and 0 otherwise.Users can control in which frames
tab-bar-mode
is enabled. This seems like a nice feature foractivities
to use to determine if it should have frame policy or tab policy frame-by-frame.I suppose one would still need
winner-mode
in frames withouttab-bar-mode
enabled. In framestab-bar-mode
, one could usetab-bar-history-mode
which provideswinner-mode
behavior. This setting is depicted below.I'd be happy to help with implementing such an approach. It seems a natural method to leverage in Emacs 28+.
P.S. Here's a snippet for people to look at to understand how one gets an emulated frame-orientation with
activities-tab-mode
enabled:Beta Was this translation helpful? Give feedback.
All reactions