8000 Use region as default code for ein:shared-output-eval-string · tkf/emacs-ipython-notebook@76591e0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 76591e0

Browse files
committed
Use region as default code for ein:shared-output-eval-string
1 parent 9a63792 commit 76591e0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lisp/ein-shared-output.el

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,10 @@ shared output buffer. You can open the buffer by the command
199199
;; ... so error will be raised before user typing code if it
200200
;; is impossible to execute
201201
(code (read-string
202-
"IP[y]: " nil 'ein:shared-output-eval-string-history)))
202+
"IP[y]: "
203+
(when (region-active-p)
204+
(buffer-substring (region-beginning) (region-end)))
205+
'ein:shared-output-eval-string-history)))
203206
(list code nil t kernel)))
204207
(unless kernel (setq kernel (ein:get-kernel-or-error)))
205208
(let ((cell (ein:shared-output-get-cell)))

0 commit comments

Comments
 (0)
0