[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals-release/activities d9d474c48e 101/103: Add: (activities
|
From: |
ELPA Syncer |
|
Subject: |
[elpa] externals-release/activities d9d474c48e 101/103: Add: (activities-list) |
|
Date: |
Tue, 30 Jan 2024 03:57:55 -0500 (EST) |
branch: externals-release/activities
commit d9d474c48ef04f18953af678db7f492d242cd6d6
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>
Add: (activities-list)
---
README.org | 1 +
activities-list.el | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
activities.info | 12 ++++---
3 files changed, 105 insertions(+), 5 deletions(-)
diff --git a/README.org b/README.org
index 20f12e9563..27ffd1787b 100644
--- a/README.org
+++ b/README.org
@@ -119,6 +119,7 @@ When option ~activities-bookmark-store~ is enabled, an
Emacs bookmark is stored
** v0.3-pre
*Additions*
++ Command ~activities-list~ lists activities in a ~vtable~ buffer in which
they can be managed.
+ Offer current activity name by default when redefining an activity with
~activities-new~.
+ Record times at which activities' states were updated.
diff --git a/activities-list.el b/activities-list.el
new file mode 100644
index 0000000000..13b7c5eac2
--- /dev/null
+++ b/activities-list.el
@@ -0,0 +1,97 @@
+;;; activities-list.el --- List activities -*- lexical-binding: t;
-*-
+
+;; Copyright (C) 2024 Free Software Foundation, Inc.
+
+;; Author: Adam Porter <adam@alphapapa.net>
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This library implements a list view for activities.
+
+;;; Code:
+
+(require 'map)
+(require 'vtable)
+
+(require 'activities)
+
+(defgroup activities-list nil
+ "Activities list buffer."
+ :group 'activities)
+
+(defcustom activities-list-time-format "%c"
+ "Time format for `activities-list' buffer."
+ :type 'string)
+
+(defmacro activities-list-command (command)
+ "Expand to a lambda that applies its args to COMMAND and reverts the list
buffer."
+ `(lambda (&rest args)
+ (let ((list-buffer (current-buffer)))
+ (apply #',command args)
+ (with-current-buffer list-buffer
+ (vtable-revert)))))
+
+;;;###autoload
+(defun activities-list ()
+ "List activities."
+ (interactive)
+ (with-current-buffer (get-buffer-create "*Activities*")
+ (let ((inhibit-read-only t))
+ (read-only-mode)
+ (erase-buffer)
+ (make-vtable
+ :columns
+ `(( :name "Active" :primary descend
+ :getter (lambda (object _table)
+ (if (activities-activity-active-p object)
+ "*" " ")))
+ ( :name "Name"
+ :getter (lambda (object _table)
+ (activities-activity-name object)))
+ ( :name "Last saved"
+ :getter (lambda (activity _table)
+ (or (map-elt (activities-activity-state-etc
(activities-activity-last activity)) 'time)
+ 0))
+ :formatter activities-list--format-time)
+ ( :name "Default saved"
+ :getter (lambda (activity _table)
+ (or (map-elt (activities-activity-state-etc
(activities-activity-default activity)) 'time)
+ 0))
+ :formatter activities-list--format-time))
+ :objects-function (lambda ()
+ (map-values activities-activities))
+ :sort-by '((2 . ascend) (0 . descend))
+ :actions `("q" (lambda (&rest _) (bury-buffer))
+ "n" (lambda (&rest _) (forward-line 1))
+ "p" (lambda (&rest _) (forward-line -1))
+ "RET" ,(activities-list-command activities-resume)
+ "k" ,(activities-list-command activities-kill)
+ "s" ,(activities-list-command activities-suspend)
+ "D" ,(activities-list-command activities-discard)))
+ (pop-to-buffer (current-buffer)))))
+
+;;;###autoload
+(defalias 'list-activities #'activities-list)
+
+(defun activities-list--format-time (time)
+ "Return TIME formatted according to `activities-list-time-format', which
see.."
+ (format-time-string activities-list-time-format time))
+
+;;;; Footer
+
+(provide 'activities-list)
+
+;;; activities-list.el ends here
diff --git a/activities.info b/activities.info
index 4f57cd21e4..47bc9c0f0a 100644
--- a/activities.info
+++ b/activities.info
@@ -322,6 +322,8 @@ File: README.info, Node: v03-pre, Next: v02, Up:
Changelog
============
*Additions*
+ • Command ‘activities-list’ lists activities in a ‘vtable’ buffer in
+ which they can be managed.
• Offer current activity name by default when redefining an activity
with ‘activities-new’.
• Record times at which activities’ states were updated.
@@ -393,11 +395,11 @@ Node: Bookmarks8301
Node: FAQ8653
Node: Changelog11729
Node: v03-pre11920
-Node: v0212195
-Node: v01312691
-Node: v01212840
-Node: v01113017
-Node: v0113180
+Node: v0212309
+Node: v01312805
+Node: v01212954
+Node: v01113131
+Node: v0113294
End Tag Table
- [elpa] externals-release/activities 8ee16991a1 073/103: Fix: Autoload -new and -resume, (continued)
- [elpa] externals-release/activities 8ee16991a1 073/103: Fix: Autoload -new and -resume, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities b35fb176cf 076/103: Merge: v0.1.3, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 0e10aba980 078/103: Change/Fix: (activities-completing-read) Variable and require match, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 8211fb1bd1 080/103: Comment: Add TODO, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 7fb531c494 082/103: Tidy: Docstring, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities b271af1e07 083/103: Change: (activities-new) Use project name as default name prompt, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 8afee346ab 084/103: Add: (activities-default-name-fn) And use as default activity name, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 53ca02eda4 094/103: Release: v0.2, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 9e56e7ca96 098/103: Change: (activities-activity-state) Add slot metadata, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities a96cd66fc0 100/103: Merge: Record activity state times, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities d9d474c48e 101/103: Add: (activities-list),
ELPA Syncer <=
- [elpa] externals-release/activities 51467e12f4 102/103: Docs: Update, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 28b9738af3 054/103: Tidy: Docstrings, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 19577e5601 055/103: Tidy, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 7e4fc3f552 064/103: Meta: Add LICENSE, .elpaignore, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities d6d568f70e 071/103: Merge: v0.1.2, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities f38b65c8d7 066/103: Fix: (activity--serialize) Ignore non-file-backed buffers, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 895042141a 079/103: Tidy, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities cefe213205 075/103: Release: v0.1.3, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities c62f3a53a5 077/103: Docs: Update, ELPA Syncer, 2024/01/30
- [elpa] externals-release/activities 29587db34e 091/103: Merge: Improve completion defaults, ELPA Syncer, 2024/01/30