diff options
| author | LLLL Colonq <llll@colonq> | 2024-09-13 13:52:38 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2024-09-13 13:52:38 -0400 |
| commit | d93ab7e848bf0f4bc1087504eecd7c959d19bf6c (patch) | |
| tree | f4f1806ceb56d2a68c9641313000f9a50fa77d78 /src/gizmo/wasp-cyclone.el | |
| parent | cc3ccebbd3af825f5e4866532906f1a7a2756518 (diff) | |
Update :3
Diffstat (limited to 'src/gizmo/wasp-cyclone.el')
| -rw-r--r-- | src/gizmo/wasp-cyclone.el | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/gizmo/wasp-cyclone.el b/src/gizmo/wasp-cyclone.el new file mode 100644 index 00000000..d7a0d02d --- /dev/null +++ b/src/gizmo/wasp-cyclone.el @@ -0,0 +1,41 @@ +;;; wasp-cyclone --- Gizmocycling -*- lexical-binding: t; -*- +;;; Commentary: +;;; Code: + +(require 'wasp-utils) +(require 'wasp-friend) +(require 'wasp-heartrate) +(require 'wasp-chatsummary) + +(defconst w/gizmo-buffer-names + (list + w/friend-buffer + w/heartrate-buffer + w/chatsummary-buffer)) + +(defvar w/gizmo-windows (list)) + +(defun w/gizmo-tag-window () + "Tag the current window as containing a gizmo." + (interactive) + (when-let ((w (selected-window))) + (add-to-list 'w/gizmo-windows w))) + +(defun w/gizmo-cycle-window (w) + "Cycle the gizmo in W." + (when-let* + ((cur (buffer-name (window-buffer w))) + (idx (--find-index (equal it cur) w/gizmo-buffer-names)) + (bufs (-non-nil (-map #'get-buffer w/gizmo-buffer-names))) + (nidx (mod (+ idx 1) (length bufs))) + (buf (nth nidx bufs))) + (set-window-buffer w buf))) + +(defun w/gizmo-cycle () + "Cycle all gizmo-bearing windows." + (interactive) + (--each w/gizmo-windows + (w/gizmo-cycle-window it))) + +(provide 'wasp-cyclone) +;;; wasp-cyclone.el ends here |
