summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-07-05 09:15:31 +0300
committerThanos Apollo <[email protected]>2024-07-05 09:15:31 +0300
commitfc61cc38230e0f87b9e1913c2cf84d3ec2038517 (patch)
treeff99a6512176a9eba98e7f00006a76ab7192d42f /gnosis.el
parentc2bd634d455b06ce38f1cf04a60609c047aa47c4 (diff)
Add gnosis-validate-actions-keys
Verify gnosis-review-actions-keys have valid values
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/gnosis.el b/gnosis.el
index 532691f..8c9cbe6 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -1571,6 +1571,13 @@ be called with new SUCCESS value plus NOTE & NOTE-COUNT."
(gnosis-display-next-review note success)
(gnosis-review-actions success note note-count))
+(defun gnosis-validate-actions-keys ()
+ "Ensure all actions in `gnosis-review-actions-keys` are valid."
+ (let ((valid-actions '("next" "override" "suspend" "edit" "quit")))
+ (dolist (entry gnosis-review-keybindings)
+ (cl-assert (member (cdr entry) valid-actions) nil
+ "Invalid action: %s" (cdr entry)))))
+
(defun gnosis-review-actions (success note note-count)
"Specify action during review of note.
@@ -1579,6 +1586,7 @@ NOTE: Note ID
NOTE-COUNT: Total notes reviewed
To customize the keybindings, adjust `gnosis-review-keybindings'."
+ (gnosis-validate-actions-keys)
(let* ((choices (mapcar (lambda (pair)
(list (car pair) (cdr pair)))
gnosis-review-keybindings))