jyp / boon

Ergonomic Command Mode for Emacs
GNU General Public License v3.0
323 stars 34 forks source link

C-c C-, behavior in org-mode #141

Closed shirakami-chigusa closed 1 month ago

shirakami-chigusa commented 1 month ago

When using org-mode, shortcuts using the c key do not work as expected.

Expected Behavior

c <letter> runs C-c C-<letter>

c , runs C-c C-,, it runs org-insert-structure-template.

Current Behavior

c , runs C-c ,, it runs org-priority.

Environment

describe-key c shows

c runs the command boon-c-god (found in boon-moves-map)

describe-key C-c , shows

C-c , runs the command org-priority (found in org-mode-map)

describe-key C-c C-, shows

C-c C-, runs the command org-insert-structure-template (found in org-mode-map)

ajay00sharma commented 1 month ago

1.Identify and confirm the conflicting keybindings using describe-key. 2.Rebind keys in org-mode using org-mode-hook if necessary. 3.Check and unbind or remap keys in boon-mode.

for rebinding:- (defun my-org-mode-keybindings () (local-set-key (kbd "c ,") (lambda () (interactive) (org-insert-structure-template))) (local-set-key (kbd "c a") (lambda () (interactive) (org-agenda))) ;; Add other keybindings as needed )

(add-hook 'org-mode-hook 'my-org-mode-keybindings)

shirakami-chigusa commented 1 month ago

https://github.com/jyp/boon/blob/9e006726be9ac508e0bb0393393abce06f7493f4/boon-main.el#L432-L437

I read and understood the code documentation of boon-c-god.

Input a key sequence, prepending C- to each key (unless such key is already reserved for minor mode, see `boon-god-control-swap')

If both C-c C-<letter> and C-c <letter> are defined in minor mode, boon-c-god does not prepend C-.