From 238f35f986e6e06f614f1c8bf63846b615ef9df7 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sat, 9 Jun 2012 22:32:46 +0200 Subject: [PATCH] Option to specify command for ein:connect-run-buffer --- ein-connect.el | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ein-connect.el b/ein-connect.el index 1c478d2..89d258e 100644 --- a/ein-connect.el +++ b/ein-connect.el @@ -60,9 +60,9 @@ of OPTION: ;;; Variable/class -(defcustom ein:connect-run-options "-n" - "Default %run option for `ein:connect-run-buffer'." - :type '(string :tag "Option" "-n -i -t -d") +(defcustom ein:connect-run-command "%run -n" + "%run command used for `ein:connect-run-buffer'." + :type '(string :tag "Command" "%run -n -i -t -d") :group 'ein) (defcustom ein:connect-save-before-run 'yes @@ -116,18 +116,18 @@ of OPTION: (ein:connect-eval-string-internal (buffer-string)) (ein:log 'info "Whole buffer is sent to the kernel.")) -(defun ein:connect-run-buffer (&optional ask-option) +(defun ein:connect-run-buffer (&optional ask-command) "Run buffer using %run. Ask for option if the prefix (C-u) is given. Variable `ein:connect-run-options' sets the default option." (interactive "P") ;; FIXME: this should be more intelligent than just `buffer-file-name' ;; to support connecting IPython over ssh. (ein:aif (buffer-file-name) - (let* ((option (if ask-option - (read-from-minibuffer "Option for %run: " - ein:connect-run-options) - ein:connect-run-options)) - (cmd (format "%%run %s %s" option it))) + (let* ((command (if ask-command + (read-from-minibuffer "Command: " + ein:connect-run-command) + ein:connect-run-command)) + (cmd (format "%s %s" command it))) (if (ein:maybe-save-buffer ein:connect-save-before-run) (progn (ein:connect-eval-string-internal cmd)