0

I'm trying to use the package checkbox together with markdown-mode. The checkbox documentation gives the following example on how to define a global key binding for it's functionality:

I'd recommend globally binding checkbox-toggle to a convenient keystroke:

(global-set-key (kbd "C-c C-t") 'checkbox-toggle)

Although this does indeed work for all other modes, it does not seem to work with markdown-mode. While in markdown-mode, entering the C-c C-t keystroke simply waits for me to provide additional keystrokes (i.e. it's undefined according to emacs). Any ideas for why this happens, or how to fix it?

(I'm sorry if there is an obvious way to do this or find information about this problem, I'm a bit of an beginner)

8
  • Do you see the same thing if you start Emacs using emacs -Q (no init file) and then load only library checkbox? If not, recursively bisect your init file to find out what is causing the problem.
    – Drew
    Sep 17, 2017 at 1:14
  • Some other bindings for the checkbox-toggle do seem to work btw
    – rien333
    Sep 17, 2017 at 1:15
  • 1
    Another possibility: do C-c C-t C-h and check the commands that are (apparently) bound on prefix key C-c C-t. Their names will likely point you to some library that defines C-c C-t as a prefix key. If so, you have a choice: Don't use C-c C-t as a prefix key or bind checkbox-toggle to some key other than C-c C-t.
    – Drew
    Sep 17, 2017 at 1:15
  • Other keymaps take priority over global keymap bindings. Some mode (major or minor) is likely defining C-c C-t as a prefix key. See above. You can bind checkbox-toggle to any key you want, but if you bind it only in the global keymap and there is a collision with a binding in another map, the other-map binding wins.
    – Drew
    Sep 17, 2017 at 1:18
  • 1
    If you want to use C-c C-t for checkbox-toggle in markdown-mode then you could bind it to that key in markdown-mode-map. But that will prevent it acting as a prefix key...
    – Drew
    Sep 17, 2017 at 1:19

1 Answer 1

1

If you want to use C-c C-t for checkbox-toggle in markdown-mode then you could bind it to that key in markdown-mode-map. But that will prevent it acting as a prefix key...

(Why don't you just bind it to some other, unused key?)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.