From 08d9a04776a9fa38bde79c2c4c27f856ddfa4957 Mon Sep 17 00:00:00 2001 From: Leroy Campbell Date: Wed, 10 Jul 2013 11:44:15 -0400 Subject: [PATCH 1/2] add "-S mix" flags to `elixir-mode-iex` This will run compile the project for `IEx` the command is started inside a `mix` project --- elixir-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elixir-mode.el b/elixir-mode.el index 2f54a950..d97776aa 100644 --- a/elixir-mode.el +++ b/elixir-mode.el @@ -414,7 +414,7 @@ (unless (comint-check-proc "*IEX*") (set-buffer (apply 'make-comint "IEX" - elixir-iex-command nil '()))) + elixir-iex-command nil '("-S" "mix")))) (pop-to-buffer "*IEX*")) ;;;###autoload From bae462d24c38f145ebb294fae8f32d12818c3926 Mon Sep 17 00:00:00 2001 From: Leroy Campbell Date: Thu, 11 Jul 2013 09:24:06 -0400 Subject: [PATCH 2/2] add universal-argument to elixir-mode-iex to prompt for additional args --- elixir-mode.el | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/elixir-mode.el b/elixir-mode.el index d97776aa..ebca33ef 100644 --- a/elixir-mode.el +++ b/elixir-mode.el @@ -408,13 +408,16 @@ (message "Compiled and saved as %s" (elixir-mode-compiled-file-name))))) ;;;###autoload -(defun elixir-mode-iex () +(defun elixir-mode-iex (&optional args-p) "Elixir mode interactive REPL." - (interactive) - (unless (comint-check-proc "*IEX*") - (set-buffer - (apply 'make-comint "IEX" - elixir-iex-command nil '("-S" "mix")))) + (interactive "P") + (let ((switches (if (equal args-p nil) + '() + (split-string (read-string "Additional args: "))))) + (unless (comint-check-proc "*IEX*") + (set-buffer + (apply 'make-comint "IEX" + elixir-iex-command nil switches)))) (pop-to-buffer "*IEX*")) ;;;###autoload