From fc61cc38230e0f87b9e1913c2cf84d3ec2038517 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Fri, 5 Jul 2024 09:15:31 +0300 Subject: Add gnosis-validate-actions-keys Verify gnosis-review-actions-keys have valid values --- gnosis.el | 8 ++++++++ 1 file changed, 8 insertions(+) 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)) -- cgit v1.2.3