Kungsgeten / ryo-modal

Roll your own modal mode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Conflict between major mode and minor mode

WeissP opened this issue · comments

commented
(use-package ryo-modal
  :commands ryo-modal-mode
  :bind ("M-m" . ryo-modal-mode)
  :config
  (ryo-modal-keys
   ("l" right-char :mode 'org-mode)
   )  
  (ryo-modal-keys
   ("l" left-char :mode 'abbrev-mode)
   )  
  ) 

When i write something like the code above, the keys defined in the major mode (org-mode here) seems has higher precedence. Is there a way to change the precedence between major mode and minor mode? (And it would be great if it is possible to change the precedence between two minor modes.)

I'm not really sure how this could be done. I read in the Emacs manual a while back how keybinding precendence works, but I can't remember exactly. Does it matter if you put the abbrev clause above the org-mode clause (so the minor-mode comes first)?

commented

Does it matter if you put the abbrev clause above the org-mode clause

No there is no difference.

Just figured it out using minor-mode-overriding-map-alist (Controlling the Active Keymaps).
like:

  (setq minor-mode-overriding-map-alist (assoc-delete-all 'the-minor-mode-you-want-have-higher-precedence minor-mode-overriding-map-alist))

but it seems like i've asked a question that is nothing about ryo-modal, sorry and happy holidays 🥰 .