diff options
author | Leon Rische <leon.rische@me.com> | 2020-01-12 13:07:21 +0100 |
---|---|---|
committer | Leon Rische <leon.rische@me.com> | 2020-01-12 13:07:21 +0100 |
commit | 00aef827a9b57620561dad5acbce5bd32e59ed6f (patch) | |
tree | 6ccc6e50984f90f5244086f98a93a173be1cee14 /org-fc-review.el | |
parent | 89892c5da83bcc4cec513cb5b5964d4ef1147fea (diff) |
Fix overlay location & show revealed cloze holes in bold face
Diffstat (limited to 'org-fc-review.el')
-rw-r--r-- | org-fc-review.el | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/org-fc-review.el b/org-fc-review.el index 64b72d1..a11993a 100644 --- a/org-fc-review.el +++ b/org-fc-review.el @@ -86,18 +86,19 @@ (id (plist-get card :id)) (type (plist-get card :type)) (position (plist-get card :position))) - ;; TODO: org-id-goto already jumps to the file - ;; Check if buffer was already open, - ;; set flag in session (kill buffer?) - (with-current-buffer (find-file path) - (goto-char (point-min)) - (org-fc-id-goto id path) - (org-fc-show-all) - (org-fc-narrow-tree) - (org-fc-hide-drawers) - (org-fc-show-latex) - (outline-hide-subtree) - (funcall (org-fc-type-setup-fn type) position))) + (let ((buffer (find-buffer-visiting path))) + (with-current-buffer (find-file path) + ;; If buffer was already open, don't kill it after rating the card + (if buffer (setq-local org-fc-reviewing-existing-buffer t)) + (goto-char (point-min)) + (org-fc-show-all) + (org-fc-id-goto id path) + ;; Make sure the headline the card is in is expanded + (org-reveal) + (org-fc-narrow-tree) + (org-fc-hide-drawers) + (org-fc-show-latex) + (funcall (org-fc-type-setup-fn type) position)))) (progn (message "Review Done") (setq org-fc-review--current-session nil) @@ -157,7 +158,8 @@ a review session." (org-fc-review-update-data path id position rating) (save-buffer) ;; TODO: Conditional kill - (kill-buffer) + (unless org-fc-reviewing-existing-buffer + (kill-buffer)) (org-fc-review-next-card)))) (defun org-fc-review-update-data (path id position rating) |