Skip to content

Commit d850e88

Browse files
committed
Set REPL open command to use emacsclient
1 parent 59b7126 commit d850e88

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

inf-elixir.el

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ Should be able to be run without any arguments."
5959
:type 'string
6060
:group 'inf-elixir)
6161

62+
(defcustom inf-elixir-open-command "emacsclient --no-wait +__LINE__ __FILE__"
63+
"Value to be populated into the `ELIXIR_EDITOR' environment variable.
64+
65+
The `ELIXIR_EDITOR' is used by the IEx `open/1' helper to open files from the
66+
REPL. Run `h(open)' in an IEx shell for more information about `ELIXIR_EDITOR'.
67+
68+
NOTE: Changing this variable will not affect running REPLs."
69+
:type 'string
70+
:group 'inf-elixir)
71+
6272

6373
;;; Mode definitions and configuration
6474
(defvar inf-elixir-project-buffers (make-hash-table :test 'equal)
@@ -140,6 +150,7 @@ Always returns a REPL buffer for DIR."
140150
(let ((buf-name (inf-elixir--buffer-name dir)))
141151
(if (process-live-p (inf-elixir--get-project-process dir))
142152
(inf-elixir--get-project-buffer dir)
153+
(setenv "ELIXIR_EDITOR" inf-elixir-open-command)
143154
(with-current-buffer
144155
(apply #'make-comint-in-buffer buf-name nil (car cmd) nil (cdr cmd))
145156
(inf-elixir-mode)

0 commit comments

Comments
 (0)