|
| 1 | +;;; hsys-activities.el --- actype for external package activities -*- lexical-binding: t; -*- |
| 2 | +;; |
| 3 | +;; Author: Mats Lidell |
| 4 | +;; |
| 5 | +;; Orig-Date: 21-Sep-25 at 20:41:48 |
| 6 | +;; Last-Mod: 21-Sep-25 at 22:15:36 by Mats Lidell |
| 7 | +;; |
| 8 | +;; SPDX-License-Identifier: GPL-3.0-or-later |
| 9 | +;; |
| 10 | +;; Copyright (C) 2025 Free Software Foundation, Inc. |
| 11 | +;; See the "HY-COPY" file for license information. |
| 12 | +;; |
| 13 | +;; This file is part of GNU Hyperbole. |
| 14 | + |
| 15 | +;;; Commentary: |
| 16 | +;; |
| 17 | +;; Stores the name of the activity rather than the activity itself. |
| 18 | +;; |
| 19 | +;; This actype resumes the activity. For reseting the default state |
| 20 | +;; for the activity use activites-resume with a prefix argument. With |
| 21 | +;; the default key binding for activities this is: {C-u C-x C-a g} |
| 22 | + |
| 23 | +;;; Code: |
| 24 | + |
| 25 | +(require 'hypb) |
| 26 | +(declare-function activities-activity-name "ext:activities") |
| 27 | +(declare-function activities-completing-read "ext:activities") |
| 28 | +(declare-function activities-named "ext:activities") |
| 29 | +(declare-function activities-resume "ext:activities") |
| 30 | + |
| 31 | +(defun hsys-activities-read () |
| 32 | + "Prompt user for activity and return the activity name." |
| 33 | + (hypb:require-package 'activities) |
| 34 | + (activities-activity-name (activities-completing-read :prompt "Activity"))) |
| 35 | + |
| 36 | +(defact activity (activity) |
| 37 | + "Action type for activities." |
| 38 | + (interactive (list (hsys-activities-read))) |
| 39 | + (hypb:require-package 'activities) |
| 40 | + (when (stringp activity) |
| 41 | + (activities-resume (activities-named activity)))) |
| 42 | + |
| 43 | +(provide 'hsys-activities) |
| 44 | +;;; hsys-activities.el ends here |
0 commit comments