Function: hsys-activities

hsys-activities is an autoloaded, interactive and byte-compiled function defined in hsys-activities.el.

Signature

(hsys-activities NAME)

Documentation

Create, resume and revert activity NAME in one function.

- Create activity with NAME if it does not exist.
- If activity NAME is not active, switch to its latest state.
- If activity NAME is active and current, revert to its default state.
- If activity NAME is active and hsys-activity is called with
  current-prefix-arg, then update the default state.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hsys-activities.el
;;; ************************************************************************
;;; Public functions
;;; ************************************************************************

;;;###autoload
(defun hsys-activities (name)
  "Create, resume and revert activity NAME in one function.
- Create activity with NAME if it does not exist.
- If activity NAME is not active, switch to its latest state.
- If activity NAME is active and current, revert to its default state.
- If activity NAME is active and hsys-activity is called with
  `current-prefix-arg', then update the default state."
  (interactive (list (completing-read "Activity: " (activities-names) nil nil)))
  (let ((activity (activities-named name)))
    (cond ((not activity)
           (activities-define name)
           (message "Activity %s defined" name))
          ((let ((current-activity (activities-current)))
             (and current-activity
                  (string-equal
                   (activities-name-for activity)
                   (activities-name-for current-activity))))
           (if current-prefix-arg
               (progn
                 (activities-define name :forcep t)
                 (message "Activity %s set to new default" name))
             (activities-revert activity)
             (message "Activity %s reverted" name)))
          (t
           (activities-resume activity)
           (message "Activity %s resumed" name)))))