mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-05 17:11:41 -05:00
Replace ein:pytools-eval-string-internal
with ein:shared-output-eval-string
This commit is contained in:
parent
ee1557913b
commit
f4f116b26f
2 changed files with 9 additions and 12 deletions
|
@ -33,7 +33,6 @@
|
|||
|
||||
(require 'ein)
|
||||
(require 'ein-kernel)
|
||||
(require 'ein-shared-output)
|
||||
|
||||
(defun ein:goto-file (filename lineno &optional other-window)
|
||||
"Jump to file FILEAME at line LINENO.
|
||||
|
@ -137,24 +136,22 @@ given, open the last point in the other window."
|
|||
(ein:goto-marker it other-window)
|
||||
(ein:log 'info "Nothing on stack.")))
|
||||
|
||||
(defun ein:pytools-eval-string-internal (code &optional popup)
|
||||
(let ((cell (ein:shared-output-get-cell))
|
||||
(kernel (ein:get-kernel))
|
||||
(code (ein:trim-indent code)))
|
||||
(ein:cell-execute cell kernel code popup)))
|
||||
(define-obsolete-function-alias
|
||||
'ein:pytools-eval-string-internal
|
||||
'ein:shared-output-eval-string "0.1.2")
|
||||
|
||||
(defun ein:pytools-doctest ()
|
||||
"Do the doctest of the object at point."
|
||||
(interactive)
|
||||
(let ((object (ein:object-at-point)))
|
||||
(ein:pytools-eval-string-internal
|
||||
(ein:shared-output-eval-string
|
||||
(format "__import__('ein').run_docstring_examples(%s)" object)
|
||||
t)))
|
||||
|
||||
(defun ein:pytools-whos ()
|
||||
"Execute ``%whos`` magic command and popup the result."
|
||||
(interactive)
|
||||
(ein:pytools-eval-string-internal "%whos" t))
|
||||
(ein:shared-output-eval-string "%whos" t))
|
||||
|
||||
(defun ein:pytools-hierarchy (&optional ask)
|
||||
"Draw inheritance graph of the class at point.
|
||||
|
@ -168,7 +165,7 @@ You can explicitly specify the object by selecting it.
|
|||
(setq object (read-from-minibuffer "class or object: " object)))
|
||||
(assert (and object (not (equal object "")))
|
||||
nil "Object at point not found.")
|
||||
(ein:pytools-eval-string-internal (format "%%hierarchy %s" object) t)))
|
||||
(ein:shared-output-eval-string (format "%%hierarchy %s" object) t)))
|
||||
|
||||
(defun ein:pytools-pandas-to-ses (dataframe)
|
||||
"View pandas_ DataFrame in SES_ (Simple Emacs Spreadsheet).
|
||||
|
|
|
@ -161,7 +161,7 @@ See also `ein:cell-max-num-outputs'."
|
|||
(defvar ein:shared-output-eval-string-history nil
|
||||
"History of the `ein:shared-output-eval-string' prompt.")
|
||||
|
||||
(defun ein:shared-output-eval-string (code &optional verbose kernel)
|
||||
(defun ein:shared-output-eval-string (code &optional popup verbose kernel)
|
||||
"Evaluate a code. Prompt will appear asking the code to run.
|
||||
This is handy when you want to execute something quickly without
|
||||
making a cell. If the code outputs something, it will go to the
|
||||
|
@ -173,10 +173,10 @@ shared output buffer. You can open the buffer by the command
|
|||
;; is impossible to execute
|
||||
(code (read-string
|
||||
"IP[y]: " nil 'ein:shared-output-eval-string-history)))
|
||||
(list code t kernel)))
|
||||
(list code nil t kernel)))
|
||||
(unless kernel (setq kernel (ein:get-kernel-or-error)))
|
||||
(let ((cell (ein:shared-output-get-cell)))
|
||||
(ein:cell-execute cell kernel (ein:trim-indent code)))
|
||||
(ein:cell-execute cell kernel (ein:trim-indent code) popup))
|
||||
(when verbose
|
||||
(ein:log 'info "Code \"%s\" is sent to the kernel." code)))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue