From f4f116b26f428b2bb96bab5a3e6fee750a5ea542 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Wed, 15 Aug 2012 23:16:32 +0200 Subject: [PATCH] Replace ein:pytools-eval-string-internal with ein:shared-output-eval-string --- lisp/ein-pytools.el | 15 ++++++--------- lisp/ein-shared-output.el | 6 +++--- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/lisp/ein-pytools.el b/lisp/ein-pytools.el index 5e6785d..c5c64b1 100644 --- a/lisp/ein-pytools.el +++ b/lisp/ein-pytools.el @@ -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). diff --git a/lisp/ein-shared-output.el b/lisp/ein-shared-output.el index 01b6bf1..ecb6f53 100644 --- a/lisp/ein-shared-output.el +++ b/lisp/ein-shared-output.el @@ -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)))