Skip to content

Commit 3932c8a

Browse files
committed
Make org-client keybindings optionally enabled
1 parent db8a9e2 commit 3932c8a

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

jupyter-org-client.el

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ See also the docstring of `org-image-actual-width' for more details."
123123
:group 'ob-jupyter
124124
:type 'boolean)
125125

126+
(defcustom jupyter-org-want-keybinding t
127+
"Whether to enable contextual keybindings."
128+
:group 'ob-jupyter
129+
:type 'boolean)
130+
126131
(defconst jupyter-org-mime-types '(:text/org
127132
;; Prioritize images over html
128133
:image/svg+xml :image/jpeg :image/png
@@ -722,11 +727,12 @@ and they only take effect when the variable
722727
#'undefined
723728
(jupyter-org--define-key-filter key))))))))
724729

725-
(jupyter-org-define-key (kbd "C-x C-e") #'jupyter-eval-line-or-region)
726-
(jupyter-org-define-key (kbd "C-M-x") #'jupyter-eval-defun)
727-
(jupyter-org-define-key (kbd "M-i") #'jupyter-inspect-at-point)
728-
(jupyter-org-define-key (kbd "C-c C-r") #'jupyter-repl-restart-kernel)
729-
(jupyter-org-define-key (kbd "C-c C-i") #'jupyter-repl-interrupt-kernel)
730+
(when jupyter-org-want-keybinding
731+
(jupyter-org-define-key (kbd "C-x C-e") #'jupyter-eval-line-or-region)
732+
(jupyter-org-define-key (kbd "C-M-x") #'jupyter-eval-defun)
733+
(jupyter-org-define-key (kbd "M-i") #'jupyter-inspect-at-point)
734+
(jupyter-org-define-key (kbd "C-c C-r") #'jupyter-repl-restart-kernel)
735+
(jupyter-org-define-key (kbd "C-c C-i") #'jupyter-repl-interrupt-kernel))
730736

731737
;;; Handling ANSI escapes in kernel output
732738

0 commit comments

Comments
 (0)