l3kn / org-fc

Spaced Repetition System for Emacs org-mode
https://www.leonrische.me/fc/index.html
GNU General Public License v3.0
262 stars 31 forks source link

Can't refresh the dashboard #53

Closed souew closed 3 years ago

souew commented 3 years ago

My actions: Create new flashcard (type doesn't matter) Open dashboard, the card gets recognized, stats are correct Press [r] for review Review the card

After review I get back to the dashboard, but now with old information in it. If I press g I get:

revert-buffer: Wrong number of arguments: ((t) (context) "Show the dashboard view for CONTEXT in the current buffer." (let* ((buf (get-buffer-create org-fc-dashboard-buffer-name)) (inhibit-read-only t) (index (org-fc-index context)) (stats (org-fc-dashboard-stats index)) (created-stats (plist-get stats :created)) (due-stats (plist-get stats :due)) (reviews-stats (org-fc-awk-stats-reviews))) (save-current-buffer (set-buffer buf) (erase-buffer) (insert (propertize "Card Statistics

" 'face 'org-level-1)) (insert (format "  New: %d (day) %d (week) %d (month) 
" (plist-get created-stats :day) (plist-get created-stats :week) (plist-get created-stats :month))) (insert "
") (insert (format "  %6d Cards, %d suspended
" (plist-get stats :total) (plist-get stats :suspended))) (let ((--dolist-tail-- (plist-get stats :by-type))) (while --dolist-tail-- (let ((pair (car --dolist-tail--))) (insert (format "  %6d %s
" (cdr pair) (car pair))) (setq --dolist-tail-- (cdr --dolist-tail--))))) (insert "
") (insert (propertize "Position Statistics

" 'face 'org-level-1)) ...))), 2

If I press G I get: command-execute: Wrong type argument: commandp, org-fc-dashboard-view

If I press [q] I'm thrown into *Buffer List* but *org-fc Dashboard* is still present, I can switch to it and get same old information.

If I kill Dashboard manually and open it again, the information gets updated.

l3kn commented 3 years ago

Thanks for including the error logs!

When adding review contexts, org-fc-dashboard-view got a new function argument and that's not yet handled by the revert function.

This shouldn't be hard to fix, I'll see when I can find the time to look into it.

l3kn commented 3 years ago

I've removed the G binding and the default g for revert-buffer should be fixed now.