mickeynp / combobulate

Structured Editing and Navigation in Emacs with Tree-Sitter
GNU General Public License v3.0
921 stars 53 forks source link

Unbind `combobulate-key-prefix`. #117

Open joostkremers opened 1 week ago

joostkremers commented 1 week ago

I would like to disable combobulate-key-prefix altogether, but that doesn't seem possible.

The doc string for combobulate-key-prefix says "Leave blank to disable", which I interpret to mean either the empty string or nil, but neither works. Instead, whenever I type a key that's bound in combobulate-key-map, the relevant combobulate function is activated. Which is kinda unpractical, because it binds some unmodified keys. :smile:

Is there something I'm missing, or is it really not possible to disable the prefix?

mickeynp commented 1 week ago

Sounds like it might be a bug.

joostkremers commented 1 week ago

Just FYI: below are the key bindings reported by describe-mode with the prefix bound to nil and "", respectively.

I took a quick look at the source, but I'd need a bit more time than I have to find a solution...

Prefix = nil

Key             Binding

M-<down>    combobulate-splice-down
M-<left>    combobulate-splice-self
M-<right>   combobulate-splice-parent
M-<up>      combobulate-splice-up

<remap> <indent-for-tab-command> combobulate-python-indent-for-tab-command

M-(     combobulate-python-envelope-wrap-parentheses

C-M-a       combobulate-navigate-beginning-of-defun
C-M-d       combobulate-navigate-down
C-M-e       combobulate-navigate-end-of-defun
C-M-h       combobulate-mark-defun
C-M-n       combobulate-navigate-next
C-M-p       combobulate-navigate-previous
C-M-t       combobulate-transpose-sexps
C-M-u       combobulate-navigate-up
M-N     combobulate-drag-down
M-P     combobulate-drag-up
M-a     combobulate-navigate-logical-previous
M-e     combobulate-navigate-logical-next
M-h     combobulate-mark-node-dwim
M-k     combobulate-kill-node-dwim
M-n     combobulate-navigate-sequence-next
M-p     combobulate-navigate-sequence-previous

n i l e (   combobulate-python-envelope-wrap-parentheses
n i l e @   combobulate-python-envelope-decorate

n i l e b W combobulate-python-envelope-nest-with
n i l e b d combobulate-python-envelope-nest-def
n i l e b f combobulate-python-envelope-nest-for
n i l e b i combobulate-python-envelope-nest-if-else
n i l e b w combobulate-python-envelope-nest-while

n i l e b t e   combobulate-python-envelope-nest-try-except
n i l e b t f   combobulate-python-envelope-nest-try-finally

Prefix = ""

Key             Binding

M-<down>    combobulate-splice-down
M-<left>    combobulate-splice-self
M-<right>   combobulate-splice-parent
M-<up>      combobulate-splice-up

<remap> <indent-for-tab-command> combobulate-python-indent-for-tab-command

M-(     combobulate-python-envelope-wrap-parentheses

e (     combobulate-python-envelope-wrap-parentheses
e @     combobulate-python-envelope-decorate

C-M-a       combobulate-navigate-beginning-of-defun
C-M-d       combobulate-navigate-down
C-M-e       combobulate-navigate-end-of-defun
C-M-h       combobulate-mark-defun
C-M-n       combobulate-navigate-next
C-M-p       combobulate-navigate-previous
C-M-t       combobulate-transpose-sexps
C-M-u       combobulate-navigate-up
M-N     combobulate-drag-down
M-P     combobulate-drag-up
M-a     combobulate-navigate-logical-previous
M-e     combobulate-navigate-logical-next
M-h     combobulate-mark-node-dwim
M-k     combobulate-kill-node-dwim
M-n     combobulate-navigate-sequence-next
M-p     combobulate-navigate-sequence-previous

e b W       combobulate-python-envelope-nest-with
e b d       combobulate-python-envelope-nest-def
e b f       combobulate-python-envelope-nest-for
e b i       combobulate-python-envelope-nest-if-else
e b w       combobulate-python-envelope-nest-while

e b t e     combobulate-python-envelope-nest-try-except
e b t f     combobulate-python-envelope-nest-try-finally