From 7d681f4c5b3806eb3aa359f82af283ef1110cb81 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Tue, 2 Jan 2024 15:28:02 +0200 Subject: gnosis-review--session: Redo with read-char-choice Previous implemntation with completing-read takes 1+ keypresses (select option & enter). Using read-char-choice we reduce it to 1. Maybe we can add a custom option for next, to optionally be e.g space to make it more anki like --- gnosis.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gnosis.el b/gnosis.el index b82a4a7..c7c3fa5 100644 --- a/gnosis.el +++ b/gnosis.el @@ -851,10 +851,10 @@ NOTE-NUM: The number of notes reviewed in the session." (cl-loop for note in notes do (progn (gnosis-review-note note) (setf note-count (1+ note-count)) - (pcase (completing-read "Note Action: " '(next suspend quit)) - ("next" nil) - ("suspend" (gnosis-suspend-note note)) - ("quit" (progn (gnosis-review-commit note-count) + (pcase (read-char-choice "Note Action: [n]ext, [s]uspend, [q]uit: " '(?n ?s ?q)) + (?n nil) + (?s (gnosis-suspend-note note)) + (?q (progn (gnosis-review-commit note-count) (cl-return))))) finally (gnosis-review-commit note-count))))) -- cgit v1.2.3