[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals-release/activities 0a5bdc6f1a 044/103: Add: (activity-n
From: |
ELPA Syncer |
Subject: |
[elpa] externals-release/activities 0a5bdc6f1a 044/103: Add: (activity-new) Use prefix to redefine |
Date: |
Tue, 30 Jan 2024 03:57:49 -0500 (EST) |
branch: externals-release/activities
commit 0a5bdc6f1aa69fa59ca57123546fbc5174f8d5a1
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>
Add: (activity-new) Use prefix to redefine
---
README.org | 3 ++-
activity.el | 11 +++++++----
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/README.org b/README.org
index 21a2502fa3..894f60cb03 100644
--- a/README.org
+++ b/README.org
@@ -66,7 +66,8 @@ If you choose to install it otherwise, you'll need to load
both the ~activity~ a
4. Change window configuration, change tab, close the tab, or even restart
Emacs.
5. Call ~activity-resume~ (~C-x C-a C-a~) to resume the activity where you
left off.
6. Return to the original activity state with ~activity-revert~ (~C-x C-a g~).
-7. Suspend the activity with ~activity-suspend~ (~C-x C-a s~) (which saves its
last state and closes its frame/tab).
+7. Call ~activity-new~ with a universal prefix argument (~C-u C-x C-a n~) to
redefine an activity's default state.
+8. Suspend the activity with ~activity-suspend~ (~C-x C-a s~) (which saves its
last state and closes its frame/tab).
** Bookmarks
diff --git a/activity.el b/activity.el
index 6ed4425f65..94bfe99539 100644
--- a/activity.el
+++ b/activity.el
@@ -260,11 +260,14 @@ Called with one argument, the activity."
;;;; Commands
-(defun activity-new (name)
- "Save current state as a new activity with NAME."
+(cl-defun activity-new (name &key forcep)
+ "Save current state as a new activity with NAME.
+If FORCEP (interactively, with prefix), overwrite existing
+activity."
;; Not sure if this is needed, but let's experiment.
- (interactive (list (read-string "New activity name: ")))
- (when (member name (activity-names))
+ (interactive
+ (list (read-string "New activity name: ") :forcep current-prefix-arg))
+ (when (and (not forcep) (member name (activity-names)))
(user-error "Activity named %S already exists" name))
(let ((activity (make-activity :name name)))
(activity--set activity)
- [elpa] externals-release/activities bf181fa512 019/103: Update FAQ, (continued)
- [elpa] externals-release/activities bf181fa512 019/103: Update FAQ, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities bf84de5214 022/103: WIP (multisession doesn't seem to work with alists, trying persist next), ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities f55b63a1cf 023/103: Seems to work, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 43c4524b47 025/103: Fix: (activity-switch) Set frame name, call make-frame correctly, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 4bc5b0f757 026/103: Fixes and additions, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities e0bdd210bd 027/103: Fix, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 42f9e302be 031/103: Tidy, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 68dc0e0d55 033/103: Fix: Don't redisplay, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 31d563422f 030/103: Fix, tidy, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities d3d1c9f6dd 036/103: Docs: Update readme, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 0a5bdc6f1a 044/103: Add: (activity-new) Use prefix to redefine,
ELPA Syncer <=
- [elpa] externals-release/activities 2f4ce2441c 046/103: Docs: Update, add Info manual, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 99ae983d0b 048/103: Tidy, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 2e18f9cb36 047/103: Rename to "activities", ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities d5e0ad5884 049/103: Merge: Rename to "activities", ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 970ec6c377 042/103: Add: Bookmark support, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 7ee86c2841 043/103: Notes: Update, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 095231ef6a 052/103: Tidy: Indentation, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 8e004b83f1 058/103: Change: (activities--name-buffer) Error for missing buffers, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 5f044d448b 060/103: Change: (activities-resume) Don't reload already active activities, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 379058b3cf 061/103: Tidy, ELPA Syncer, 2024/01/30