[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-drill 5ebfe9c717 017/251: Improved key input during dr
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-drill 5ebfe9c717 017/251: Improved key input during drill sessions. Once the answer is revealed, it is now possible to navigate |
Date: |
Mon, 17 Jan 2022 18:58:57 -0500 (EST) |
branch: elpa/org-drill
commit 5ebfe9c7171bc3c967151903be6d6c9d9c1100f7
Author: eeeickythump <devnull@localhost>
Commit: eeeickythump <devnull@localhost>
Improved key input during drill sessions. Once the answer is revealed, it
is now possible to navigate
within the topic using the cursor, PgUp/PgDn and mouse scroll wheel. This
is sometimes necessary for
topics which do not fit entirely on one screen.
---
org-drill.el | 50 +++++++++++++++++++++++++++++++++++++-------------
1 file changed, 37 insertions(+), 13 deletions(-)
diff --git a/org-drill.el b/org-drill.el
index bc7a7f437b..760256f8db 100644
--- a/org-drill.el
+++ b/org-drill.el
@@ -1,7 +1,7 @@
;;; org-drill.el - Self-testing with org-learn
;;;
;;; Author: Paul Sexton <eeeickythump@gmail.com>
-;;; Version: 1.4
+;;; Version: 1.5
;;; Repository at http://bitbucket.org/eeeickythump/org-drill/
;;;
;;;
@@ -522,11 +522,16 @@ Returns a list: (INTERVAL N EF OFMATRIX), where:
(defun org-drill-reschedule ()
"Returns quality rating (0-5), or nil if the user quit."
- (let ((ch nil))
- (while (not (memq ch '(?q ?e ?0 ?1 ?2 ?3 ?4 ?5)))
- (setq ch (read-char-exclusive
- (if (eq ch ??)
- (format "0-2 Means you have forgotten the item.
+ (let ((ch nil)
+ (input nil)
+ (next-review-date-3 (org-drill-hypothetical-next-review-date 3))
+ (next-review-date-4 (org-drill-hypothetical-next-review-date 4))
+ (next-review-date-5 (org-drill-hypothetical-next-review-date 5)))
+ (save-excursion
+ (while (not (memq ch '(?q ?e ?0 ?1 ?2 ?3 ?4 ?5)))
+ (setq input (read-key-sequence
+ (if (eq ch ??)
+ (format "0-2 Means you have forgotten the item.
3-5 Means you have remembered the item.
0 - Completely forgot.
@@ -537,12 +542,28 @@ Returns a list: (INTERVAL N EF OFMATRIX), where:
5 - You remembered the item really easily. (+%s days)
How well did you do? (0-5, ?=help, e=edit, t=tags, q=quit)"
- (org-drill-hypothetical-next-review-date 3)
- (org-drill-hypothetical-next-review-date 4)
- (org-drill-hypothetical-next-review-date 5))
- "How well did you do? (0-5, ?=help, e=edit, q=quit)")))
- (if (eql ch ?t)
- (org-set-tags-command)))
+ next-review-date-3
+ next-review-date-4
+ next-review-date-5)
+ "How well did you do? (0-5, ?=help, e=edit, q=quit)")))
+ (cond
+ ((stringp input)
+ (setq ch (elt input 0)))
+ ((and (vectorp input) (symbolp (elt input 0)))
+ (case (elt input 0)
+ (up (ignore-errors (forward-line -1)))
+ (down (ignore-errors (forward-line 1)))
+ (left (ignore-errors (backward-char)))
+ (right (ignore-errors (forward-char)))
+ (prior (ignore-errors (scroll-down))) ; pgup
+ (next (ignore-errors (scroll-up))))) ; pgdn
+ ((and (vectorp input) (listp (elt input 0))
+ (eventp (elt input 0)))
+ (case (car (elt input 0))
+ (wheel-up (ignore-errors (mwheel-scroll (elt input 0))))
+ (wheel-down (ignore-errors (mwheel-scroll (elt input 0)))))))
+ (if (eql ch ?t)
+ (org-set-tags-command))))
(cond
((and (>= ch ?0) (<= ch ?5))
(let ((quality (- ch ?0))
@@ -597,6 +618,7 @@ the current topic."
(defun org-drill-presentation-prompt (&rest fmt-and-args)
(let* ((item-start-time (current-time))
+ (input nil)
(ch nil)
(last-second 0)
(prompt
@@ -637,13 +659,15 @@ Consider reformulating the item to make it easier to
remember.\n"
'face '(:foreground "red"))
prompt)))
(while (memq ch '(nil ?t))
+ (setq ch nil)
(while (not (input-pending-p))
(message (concat (format-time-string
"%M:%S " (time-subtract
(current-time) item-start-time))
prompt))
(sit-for 1))
- (setq ch (read-char-exclusive))
+ (setq input (read-key-sequence nil))
+ (if (stringp input) (setq ch (elt input 0)))
(if (eql ch ?t)
(org-set-tags-command)))
(case ch
- [nongnu] branch elpa/org-drill created (now bf8fe812d4), ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill a678ed9f5e 001/251: First commit, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 19efe535f7 003/251: Minor change to docs., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 663f0a3c1e 004/251: Added README with more detailed documentation., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill b3e8d7b931 007/251: Added tag 1.1 for changeset bc740455003b, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill c1af8a3285 008/251: Allow editing and tag-editing when prompted for recall quality., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 259033811d 010/251: Added tag 1.3 for changeset c8dd87db2ce1, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 7806c770d6 011/251: Added ability to skip cards during review (answer is not shown)., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 0e2040ba7e 013/251: * Documentation added for multicloze cards and cram mode., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 5ebfe9c717 017/251: Improved key input during drill sessions. Once the answer is revealed, it is now possible to navigate,
ELPA Syncer <=
- [nongnu] elpa/org-drill 1c93810202 019/251: Added tag 1.6 for changeset 6ff8dd70c108, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 5d4694dc3b 020/251: - Hide comments (#...) in items during drill sessions., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 4c7669692d 025/251: Added tag 2.1 for changeset da0c515d1d39, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 97aad88728 029/251: - 'multicloze' card type renamed to 'hide1cloze' (though 'multicloze' is, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 02e454f8d0 033/251: Added tag 2.3 for changeset b5d5b9f5c203, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill b69d212068 053/251: Go back to using org-save-outline-visibility instead of org-drill-save-visibility -, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 6dc1b90f21 050/251: Added tag 2.3.5 for changeset 872dde6580f6, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 9cb409a1ba 012/251: * New command: 'M-x org-drill-cram'. "Cram Mode" is the same as an ordinary drill session, except, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 5749d5bb7a 057/251: Contents of entry drawers are now hidden while displaying answers., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 79a0ac93ae 058/251: Hide entry drawers when showing answers for verb conjugation and noun, ELPA Syncer, 2022/01/17