Skip to content

Commit 30010a1

Browse files
committed
Merge pull request #22 from artisonian/iex-mode-args
Enhance `elixir-mode-iex` to accept additional arguments
2 parents 2738c46 + d2a23b1 commit 30010a1

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

elixir-mode.el

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -408,13 +408,16 @@
408408
(message "Compiled and saved as %s" (elixir-mode-compiled-file-name)))))
409409

410410
;;;###autoload
411-
(defun elixir-mode-iex ()
411+
(defun elixir-mode-iex (&optional args-p)
412412
"Elixir mode interactive REPL."
413-
(interactive)
414-
(unless (comint-check-proc "*IEX*")
415-
(set-buffer
416-
(apply 'make-comint "IEX"
417-
elixir-iex-command nil '())))
413+
(interactive "P")
414+
(let ((switches (if (equal args-p nil)
415+
'()
416+
(split-string (read-string "Additional args: ")))))
417+
(unless (comint-check-proc "*IEX*")
418+
(set-buffer
419+
(apply 'make-comint "IEX"
420+
elixir-iex-command nil switches))))
418421
(pop-to-buffer "*IEX*"))
419422

420423
;;;###autoload

0 commit comments

Comments
 (0)