diff options
| author | Paul Sexton <eeeickythump@gmail.com> | 2015-09-11 07:42:42 +1200 |
|---|---|---|
| committer | Paul Sexton <eeeickythump@gmail.com> | 2015-09-11 07:42:42 +1200 |
| commit | 8c374c0998b2170550c052da4c218402df43b6ae (patch) | |
| tree | 315f1b39be65dbbeb3c06aa40d8da7d36fe690b9 | |
| parent | 44289690b7bcee22bd0ca57dfd1679001a4c1f4f (diff) | |
| parent | 66d74724d7c9ad95472c046d429eac95382df550 (diff) | |
| download | org-drill-8c374c0998b2170550c052da4c218402df43b6ae.tar.gz org-drill-8c374c0998b2170550c052da4c218402df43b6ae.zip | |
Merged in Fuco/org-drill/fix-input (pull request #3)
Turn off input method while reading events
| -rwxr-xr-x | org-drill.el | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/org-drill.el b/org-drill.el index 7690ac3..250cb5f 100755 --- a/org-drill.el +++ b/org-drill.el @@ -1369,6 +1369,14 @@ of QUALITY." intervals)) (reverse intervals))) +(defun org-drill--read-key-sequence (prompt) + "Just like `read-key-sequence' but with input method turned off." + (let ((old-input-method current-input-method)) + (unwind-protect + (progn + (set-input-method nil) + (read-key-sequence prompt)) + (set-input-method old-input-method)))) (defun org-drill-reschedule () "Returns quality rating (0-5), or nil if the user quit." @@ -1385,7 +1393,7 @@ of QUALITY." org-drill--edit-key 7 ; C-g ?0 ?1 ?2 ?3 ?4 ?5))) - (setq input (read-key-sequence + (setq input (org-drill--read-key-sequence (if (eq ch org-drill--help-key) (format "0-2 Means you have forgotten the item. 3-5 Means you have remembered the item. @@ -1581,7 +1589,7 @@ Consider reformulating the item to make it easier to remember.\n" (format-time-string "%M:%S " elapsed)) prompt)) (sit-for 1))) - (setq input (read-key-sequence nil)) + (setq input (org-drill--read-key-sequence nil)) (if (stringp input) (setq ch (elt input 0))) (if (eql ch org-drill--tags-key) (org-set-tags-command))) |
