diff options
author | Leon Rische <leon.rische@me.com> | 2020-07-19 18:37:51 +0200 |
---|---|---|
committer | Leon Rische <leon.rische@me.com> | 2020-08-08 17:04:13 +0200 |
commit | 4e1081d2b918021854f6a098a9038a1bab25e6f5 (patch) | |
tree | 27652801e74c5f02e5360d8d4df4dee73211234b /org-fc.el | |
parent | 9fcb924078ee36b443dfa8552e22acfbaa4c2f32 (diff) |
Support setup-fn returning "'rate"
Diffstat (limited to 'org-fc.el')
-rw-r--r-- | org-fc.el | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -1886,15 +1886,18 @@ If RESUMING is non-nil, some parts of the buffer setup are skipped." (setq org-fc-timestamp (time-to-seconds (current-time))) (run-hooks 'org-fc-before-setup-hook) - (funcall (org-fc-type-setup-fn type) position) - (run-hooks 'org-fc-after-setup-hook) - - ;; If the card has a no-noop flip function, - ;; skip to rate-mode - (let ((flip-fn (org-fc-type-flip-fn type))) - (if (or (null flip-fn) (eq flip-fn #'org-fc-noop)) - (org-fc-review-rate-mode 1) - (org-fc-review-flip-mode 1)))))) + (let ((step (funcall (org-fc-type-setup-fn type) position))) + (run-hooks 'org-fc-after-setup-hook) + + ;; If the card has a no-noop flip function, + ;; skip to rate-mode + (let ((flip-fn (org-fc-type-flip-fn type))) + (if (or + (eq step 'rate) + (null flip-fn) + (eq flip-fn #'org-fc-noop)) + (org-fc-review-rate-mode 1) + (org-fc-review-flip-mode 1))))))) (error (org-fc-review-quit) (signal (car err) (cdr err)))) |