Skip to content

Commit 3abdec0

Browse files
committed
Make org-client keybindings optionally enabled
1 parent 3615c2d commit 3abdec0

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

jupyter-org-client.el

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ See also the docstring of `org-image-actual-width' for more details."
136136
:group 'ob-jupyter
137137
:type 'boolean)
138138

139+
(defcustom jupyter-org-want-keybinding t
140+
"Whether to enable contextual keybindings."
141+
:group 'ob-jupyter
142+
:type 'boolean)
143+
139144
(defconst jupyter-org-mime-types '(:text/org
140145
;; Prioritize images over html
141146
:image/svg+xml :image/jpeg :image/png
@@ -823,12 +828,13 @@ and they only take effect when the variable
823828
#'undefined
824829
(jupyter-org--define-key-filter key))))))))
825830

826-
(jupyter-org-define-key (kbd "C-x C-e") #'jupyter-eval-line-or-region)
827-
(jupyter-org-define-key (kbd "C-M-x") #'jupyter-eval-defun)
828-
(jupyter-org-define-key (kbd "M-i") #'jupyter-inspect-at-point)
829-
(jupyter-org-define-key (kbd "C-c M-:") #'jupyter-eval-string-command)
830-
(jupyter-org-define-key (kbd "C-c C-r") #'jupyter-repl-restart-kernel)
831-
(jupyter-org-define-key (kbd "C-c C-i") #'jupyter-repl-interrupt-kernel)
831+
(when jupyter-org-want-keybinding
832+
(jupyter-org-define-key (kbd "C-x C-e") #'jupyter-eval-line-or-region)
833+
(jupyter-org-define-key (kbd "C-M-x") #'jupyter-eval-defun)
834+
(jupyter-org-define-key (kbd "M-i") #'jupyter-inspect-at-point)
835+
(jupyter-org-define-key (kbd "C-c M-:") #'jupyter-eval-string-command)
836+
(jupyter-org-define-key (kbd "C-c C-r") #'jupyter-repl-restart-kernel)
837+
(jupyter-org-define-key (kbd "C-c C-i") #'jupyter-repl-interrupt-kernel))
832838

833839
;;; Handling ANSI escapes in kernel output
834840

0 commit comments

Comments
 (0)