Skip to content

Commit

Permalink
New module reload functionality inside alchemist-iex
Browse files Browse the repository at this point in the history
- Remove legacy/falsy recompile buffer function
  • Loading branch information
tonini committed Dec 10, 2015
1 parent 0193c41 commit 395e671
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions alchemist-iex.el
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
(require 'comint)
(require 'company)
(require 'alchemist-key)
(require 'alchemist-scope)
(require 'alchemist-project)

(defgroup alchemist-iex nil
Expand Down Expand Up @@ -143,10 +144,10 @@ and jump to the buffer."
(let ((str (format "c(\"%s\")" (buffer-file-name))))
(alchemist-iex--send-command (alchemist-iex-process) str)))

(defun alchemist-iex-recompile-this-buffer ()
"Recompiles and reloads the current buffer in the IEx process."
(defun alchemist-iex-reload-module ()
"Recompiles and reloads the current module in the IEx process."
(interactive)
(let ((str (format "r(\"%s\")" (buffer-file-name))))
(let ((str (format "r(%s)" (alchemist-scope-module))))
(alchemist-iex--send-command (alchemist-iex-process) str)))

(defun alchemist-iex--send-command (proc str)
Expand Down
1 change: 1 addition & 0 deletions alchemist.el
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ Key bindings:
(define-key map (kbd "i r") 'alchemist-iex-send-region)
(define-key map (kbd "i m") 'alchemist-iex-send-region-and-go)
(define-key map (kbd "i b") 'alchemist-iex-compile-this-buffer)
(define-key map (kbd "i R") 'alchemist-iex-reload-module)

(define-key map (kbd "v l") 'alchemist-eval-current-line)
(define-key map (kbd "v k") 'alchemist-eval-print-current-line)
Expand Down

0 comments on commit 395e671

Please sign in to comment.