You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any way to create another keybinding which acts like a toggle to activate/deactivate these four keybindings? I have tried things with :predicate and :prefix-map but couldn't quite figure out how to use them properly (not sure if these are even the solutions for my problems).
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Not sure exactly what the purpose of toggling is (e.g. do you want these keybindings to do something else in some context or just go away), but here are some ideas:
Create a minor mode, bind the keys in it, and bind another key to toggle the minor mode
Use :predicate with a variable and bind a key to toggle that variable
May be able to provide a better solution if you describe the use case in detail.
Thanks for your reply. The use case is as follows: I use org-mode for my exploratory data analysis using Python with emacs-jupyter. When I work in an org file that is used as such a notebook, I want to have keybindings for commands such as jupyter-org-execute-and-next-block. However, I don't want to have these keybindings nor do I want them to show up in the Which Key pop up if I work in a "normal" org file (e.g. journalling, org-roam etc.).
I would have to look at the jupyter code in more depth. Do you just want jupyter-org-interaction-mode-map? If that doesn't work the best way would be to use :predicate with a check for whether the current buffer is being used as a notebook.
Hi all, I have the following snippet in my config.
Is there any way to create another keybinding which acts like a toggle to activate/deactivate these four keybindings? I have tried things with
:predicate
and:prefix-map
but couldn't quite figure out how to use them properly (not sure if these are even the solutions for my problems).Thanks in advance!
The text was updated successfully, but these errors were encountered: