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

Evil-mode problems #41

Closed ram535 closed 4 years ago

ram535 commented 4 years ago

In the README says, we should add this config.

(evil-define-minor-mode-key '(normal insert emacs) 'org-fc-review-flip-mode
  (kbd "RET") 'org-fc-review-flip
  (kbd "n") 'org-fc-review-flip
  (kbd "s") 'org-fc-review-suspend-card
  (kbd "q") 'org-fc-review-quit)

(evil-define-minor-mode-key '(normal insert emacs) 'org-fc-review-rate-mode
  (kbd "a") 'org-fc-review-rate-again
  (kbd "h") 'org-fc-review-rate-hard
  (kbd "g") 'org-fc-review-rate-good
  (kbd "e") 'org-fc-review-rate-easy
  (kbd "s") 'org-fc-review-suspend-card
  (kbd "q") 'org-fc-review-quit)

But I get this error when added:

Error (use-package): org-fc/:config: Symbol’s function definition is void: evil-define-minor-mode-key

It seems like there is not org-fc-review-rate-mode and org-fc-review-flip-mode.

When I am reviewing cards and check the mode, it says org-mode.

Another alternative solution for evil mode users would be:

  (evil-set-initial-state 'org-fc-dashboard-mode 'emacs) ;; this works
  (evil-set-initial-state 'org-fc-flip-mode 'emacs) ;; does not work, this mode is not detected
  (evil-set-initial-state 'org-fc-rate-mode 'emacs) ;; does not work, this mode is not detected

if org-fc-flip-mode and org-fc-rate-mode would exist or detected.

l3kn commented 4 years ago

Maybe you're using an outdated version of org-fc?

An easy way to check if the two review modes are available is do a M-x and see if org-fc-review-rate-mode shows up in the list.

If I hit C-h m (mode help) during review, the major mode is org-mode and "org-fc-review-flip/rate` is listed as one of the minor modes.

ram535 commented 4 years ago

I see. I use general.el for my key bindings. I added this to my configuration and it worked. Thanks.

  (general-define-key
   :definer 'minor-mode
   :states 'normal
   :keymaps 'org-fc-review-flip-mode
   "RET" 'org-fc-review-flip
   "n" 'org-fc-review-flip
   "s" 'org-fc-review-suspend-card
   "q" 'org-fc-review-quit)

  (general-define-key
   :definer 'minor-mode
   :states 'normal
   :keymaps 'org-fc-review-rate-mode
   "a" 'org-fc-review-rate-again
   "h" 'org-fc-review-rate-hard
   "g" 'org-fc-review-rate-good
   "e" 'org-fc-review-rate-easy
   "s" 'org-fc-review-suspend-card
   "q" 'org-fc-review-quit)