[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals-release/activities 77852faab7 039/103: Add/Change: acti
|
From: |
ELPA Syncer |
|
Subject: |
[elpa] externals-release/activities 77852faab7 039/103: Add/Change: activity-switch, activity--switch |
|
Date: |
Tue, 30 Jan 2024 03:57:49 -0500 (EST) |
branch: externals-release/activities
commit 77852faab7e68418c17789c6ac8ec952522d1c55
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>
Add/Change: activity-switch, activity--switch
---
README.org | 1 +
activity-tabs.el | 6 +++---
activity.el | 19 ++++++++++++++-----
3 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/README.org b/README.org
index 0fd5cea6d3..6b2c7368f5 100644
--- a/README.org
+++ b/README.org
@@ -35,6 +35,7 @@ Until this library is available from a package archive, it's
recommended to inst
;; user need not lift the Control key. This makes it easier to
;; quickly switch between activities.
("C-x C-a C-a" . activity-resume)
+ ("C-x C-a RET" . activity-switch)
("C-x C-a g" . activity-revert)
("C-x C-a n" . activity-new)
("C-x C-a s" . activity-suspend))
diff --git a/activity-tabs.el b/activity-tabs.el
index 60022b80ae..9cf32c00da 100644
--- a/activity-tabs.el
+++ b/activity-tabs.el
@@ -58,7 +58,7 @@ accordingly."
:group 'activity
(let ((override-map '((activity-active-p . activity-tabs-activity-active-p)
(activity--set . activity-tabs-activity--set)
- (activity-switch . activity-tabs-switch)
+ (activity--switch . activity-tabs--switch)
(activity-current . activity-tabs-current)
(activity-close . activity-tabs-close))))
(if activity-tabs-mode
@@ -77,10 +77,10 @@ accordingly."
"Close ACTIVITY.
Its state is not saved, and its frames, windows, and tabs are
closed."
- (activity-switch activity)
+ (activity--switch activity)
(tab-bar-close-tab))
-(defun activity-tabs-switch (activity)
+(defun activity-tabs--switch (activity)
"Switch to ACTIVITY.
Selects its tab, making one if needed. Its state is not changed."
(if-let ((tab (activity-tabs--tab activity)))
diff --git a/activity.el b/activity.el
index 2ffd60f506..ee2135fbec 100644
--- a/activity.el
+++ b/activity.el
@@ -152,7 +152,7 @@ Selects ACTIVITY's frame/tab and then switches back."
(error "Activity %S not active" (activity-name ,activity)))
(unwind-protect
(progn
- (activity-switch ,activity)
+ (activity--switch ,activity)
,@body)
(pcase-let (((map :frame :window :tab-index) ,original-state-var))
(when frame
@@ -253,7 +253,7 @@ Called with one argument, the activity."
(let ((activity (make-activity :name name)))
(activity--set activity)
(activity-save activity :defaultp t :lastp t)
- (activity-switch activity)
+ (activity--switch activity)
activity))
(cl-defun activity-resume (activity &key resetp)
@@ -262,7 +262,7 @@ If RESETP (interactively, with universal prefix), reset to
ACTIVITY's default state; otherwise, resume its last state, if
available."
(interactive (list (activity-completing-read) :resetp current-prefix-arg))
- (activity-switch activity)
+ (activity--switch activity)
(activity-set activity :state (if resetp 'default 'last)))
(defun activity-suspend (activity)
@@ -384,7 +384,7 @@ See option `activity-always-persist'."
"Close ACTIVITY.
Its state is not saved, and its frames, windows, and tabs are
closed."
- (activity-switch activity)
+ (activity--switch activity)
;; TODO: Set frame parameter when resuming.
(delete-frame))
@@ -394,6 +394,15 @@ closed."
(defun activity-switch (activity)
"Switch to ACTIVITY.
+Interactively, offers active activities."
+ (interactive
+ (list (activity-completing-read
+ :activities (cl-remove-if-not #'activity-active-p
activity-activities :key #'cdr)
+ :prompt "Switch to: ")))
+ (activity--switch activity))
+
+(defun activity--switch (activity)
+ "Switch to ACTIVITY.
Select's ACTIVITY's frame, making a new one if needed. Its state
is not changed."
(select-frame (or (activity--frame activity)
@@ -624,7 +633,7 @@ PROMPT is passed to `completing-read', which see."
(defun activity-bookmark-handler (bookmark)
"Switch to BOOKMARK's activity."
- (activity-switch (map-elt activity-activities (car bookmark))))
+ (activity--switch (map-elt activity-activities (car bookmark))))
(defun activity--buffer-local-variables (variables)
"Return alist of buffer-local VARIABLES for current buffer.
- [elpa] externals-release/activities a45ca6dd3a 021/103: WIP: Use multisession, (continued)
- [elpa] externals-release/activities a45ca6dd3a 021/103: WIP: Use multisession, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 552704ed45 004/103: Meta: makem.sh, .gitignore, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities d8b3264b95 017/103: Add README, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 03427b803c 016/103: Reasonably functional, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 9f566e9523 020/103: WIP (Stuff is broken, don't use yet), ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 6725048041 024/103: Tidy: Header, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 7a3bba7b26 028/103: Add/Fix, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 760877b5eb 029/103: Set name of new activities' tabs/frames, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities a6b7ec1816 032/103: Fix: Mutation of window state, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 46a2346ea6 035/103: Update docs, bindings, alias, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 77852faab7 039/103: Add/Change: activity-switch, activity--switch,
ELPA Syncer <=
- [elpa] externals-release/activities c7c3224aaa 045/103: Notes: Update, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 09b5d7f5f3 041/103: Remove: (activity-major-mode-alist), ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 2372117021 040/103: Tidy, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities f41e4d0736 051/103: Notes: Update, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 79be058053 053/103: Meta: Use persist 0.6, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 21a728124a 056/103: Change: (activity--serialize) Demote bookmark errors, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 0eef05103b 057/103: Add: (activities-tabs-face), ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 05cabe39c5 059/103: Fix: (activity--serialize) Error, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 36f73326d0 067/103: Merge: v0.1.1, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 7c90a5e637 074/103: Fix: Alias, ELPA Syncer, 2024/01/30