summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-10-06 08:25:37 +0300
committerThanos Apollo <[email protected]>2024-10-06 08:25:37 +0300
commit0ce218ddce66dcc0d42c30bc62c94dbf093d155a (patch)
tree03d64da4e46350f35042f3ac3d1ff886ca1b0d3d /gnosis.el
parentb83de5ab8410ce9cfbd6cf41bcb05803ac021c16 (diff)
[Rewrite] review-actions using read-char-choice.
* read-multiple-choice locks emacs. Using read-char-choice user can now switch buffers during review.
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el27
1 files changed, 15 insertions, 12 deletions
diff --git a/gnosis.el b/gnosis.el
index 03a9fc8..c85c9cc 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -1797,18 +1797,21 @@ 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))
- (choice (car (read-multiple-choice "Note actions" choices)))
- (action (alist-get choice gnosis-review-keybindings)))
- (pcase action
- ("next" (gnosis-review-result note success))
- ("override" (gnosis-review-action--override success note note-count))
- ("suspend" (gnosis-review-action--suspend success note note-count))
- ("edit" (gnosis-review-action--edit success note note-count))
- ("quit" (gnosis-review-action--quit success note)))))
+ (let* ((choice
+ (read-char-choice
+ (format "Action: %sext gnosis, %sverride result, %suspend note, %sdit note, %suit review session"
+ (propertize "n" 'face 'match)
+ (propertize "o" 'face 'match)
+ (propertize "s" 'face 'match)
+ (propertize "e" 'face 'match)
+ (propertize "q" 'face 'match))
+ '(?n ?o ?s ?e ?q))))
+ (pcase choice
+ (?n (gnosis-review-result note success))
+ (?o (gnosis-review-action--override success note note-count))
+ (?s (gnosis-review-action--suspend success note note-count))
+ (?e (gnosis-review-action--edit success note note-count))
+ (?q (gnosis-review-action--quit success note)))))
(defun gnosis-review-session (notes &optional due note-count)
"Start review session for NOTES.