[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-drill b69d212068 053/251: Go back to using org-save-ou
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-drill b69d212068 053/251: Go back to using org-save-outline-visibility instead of org-drill-save-visibility - |
Date: |
Mon, 17 Jan 2022 18:59:00 -0500 (EST) |
branch: elpa/org-drill
commit b69d212068793246c7b8b82912c47a67e5b17cf1
Author: eeeickythump <devnull@localhost>
Commit: eeeickythump <devnull@localhost>
Go back to using org-save-outline-visibility instead of
org-drill-save-visibility -
the latter is no longer needed as the former now returns a useful value.
In org-drill-entry, temporarily bind `outline-view-change-hook' to nil, as
fontification functions in that variable can cause big slowdowns when
moving from
drill item to drill item.
---
org-drill.el | 85 +++++++++++++++++++++++++-----------------------------------
1 file changed, 35 insertions(+), 50 deletions(-)
diff --git a/org-drill.el b/org-drill.el
index 7d3217644f..793d6b483c 100755
--- a/org-drill.el
+++ b/org-drill.el
@@ -1976,23 +1976,6 @@ visible content of the card."
(org-drill-hide-subheadings-if 'org-drill-entry-p)))))
-;;; The following macro is necessary because `org-save-outline-visibility'
-;;; currently discards the value returned by its body and returns a garbage
-;;; value instead. (as at org mode v 7.5)
-
-(defmacro org-drill-save-visibility (&rest body)
- "Store the current visibility state of the org buffer, and restore it
-after executing BODY. Return the value of the last expression
-in BODY."
- (let ((retval (gensym)))
- `(let ((,retval nil))
- (org-save-outline-visibility t
- (setq ,retval
- (progn
- ,@body)))
- ,retval)))
-
-
(defun org-drill-entry ()
"Present the current topic for interactive review, as in `org-drill'.
Review will occur regardless of whether the topic is due for review or whether
@@ -2012,38 +1995,41 @@ See `org-drill' for more details."
;; (org-back-to-heading))
(let ((card-type (org-entry-get (point) "DRILL_CARD_TYPE"))
(answer-fn 'org-drill-present-default-answer)
- (cont nil))
- (org-drill-save-visibility
- (save-restriction
- (org-narrow-to-subtree)
- (org-show-subtree)
- (org-cycle-hide-drawers 'all)
-
- (let ((presentation-fn (cdr (assoc card-type
org-drill-card-type-alist))))
- (if (listp presentation-fn)
- (psetq answer-fn (or (second presentation-fn)
- 'org-drill-present-default-answer)
- presentation-fn (first presentation-fn)))
- (cond
- ((null presentation-fn)
- (message "%s:%d: Unrecognised card type '%s', skipping..."
- (buffer-name) (point) card-type)
- (sit-for 0.5)
- 'skip)
- (t
- (setq cont (funcall presentation-fn))
- (cond
- ((not cont)
- (message "Quit")
- nil)
- ((eql cont 'edit)
- 'edit)
- ((eql cont 'skip)
- 'skip)
- (t
- (save-excursion
- (funcall answer-fn
- (lambda () (org-drill-reschedule)))))))))))))
+ (cont nil)
+ ;; fontification functions in `outline-view-change-hook' can cause big
+ ;; slowdowns, so we temporarily bind this variable to nil here.
+ (outline-view-change-hook nil))
+ (org-save-outline-visibility t
+ (save-restriction
+ (org-narrow-to-subtree)
+ (org-show-subtree)
+ (org-cycle-hide-drawers 'all)
+
+ (let ((presentation-fn (cdr (assoc card-type
org-drill-card-type-alist))))
+ (if (listp presentation-fn)
+ (psetq answer-fn (or (second presentation-fn)
+ 'org-drill-present-default-answer)
+ presentation-fn (first presentation-fn)))
+ (cond
+ ((null presentation-fn)
+ (message "%s:%d: Unrecognised card type '%s', skipping..."
+ (buffer-name) (point) card-type)
+ (sit-for 0.5)
+ 'skip)
+ (t
+ (setq cont (funcall presentation-fn))
+ (cond
+ ((not cont)
+ (message "Quit")
+ nil)
+ ((eql cont 'edit)
+ 'edit)
+ ((eql cont 'skip)
+ 'skip)
+ (t
+ (save-excursion
+ (funcall answer-fn
+ (lambda () (org-drill-reschedule)))))))))))))
(defun org-drill-entries-pending-p ()
@@ -3013,4 +2999,3 @@ returns its return value."
(provide 'org-drill)
-
- [nongnu] elpa/org-drill c1af8a3285 008/251: Allow editing and tag-editing when prompted for recall quality., (continued)
- [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, 2022/01/17
- [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 <=
- [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
- [nongnu] elpa/org-drill 93545edb91 063/251: Added tag 2.3.8 for changeset a8cade42f59c, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 8b6e230886 065/251: Added ability to define arbitrary left and right cloze delimiters (strings),, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill b17bf579bd 039/251: - New card types: show2cloze, hide1_firstmore, show1_firstless, show1_lastmore. See docs for details., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 9487fd21f8 002/251: Added special card type for spanish verbs, to demonstrate custom card types., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 5040d0e6d2 014/251: Added tag 1.4 for changeset 2e4735840112, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill e698616493 026/251: - More robust handling of the situation where we resume a drill session but, ELPA Syncer, 2022/01/17