Skip to content

Commit

Permalink
Updates to stack-mode, for more recent API
Browse files Browse the repository at this point in the history
  • Loading branch information
mgsloan committed Jul 21, 2015
1 parent d6f3509 commit c4a02ae
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions stack-mode/stack-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,11 @@
"Load the current buffer's file."
(interactive)
(save-buffer)
(let ((filename (buffer-file-name)))
(with-current-buffer (stack-mode-buffer)
(stack-mode-update-file
(file-relative-name filename default-directory)))))
;; FIXME: probably should check if the buffer is part of the
;; project, or someting along those lines>
(with-current-buffer
(stack-mode-buffer)
(stack-mode-reload)))

(defun stack-mode-goto ()
"Go to definition of thing at point."
Expand Down Expand Up @@ -402,14 +403,12 @@ directory."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Commands

(defun stack-mode-update-file (filepath)
"Load the given filepath."
(defun stack-mode-reload ()
"Compile the code and fetch compile errors."
(with-current-buffer (stack-mode-buffer)
(stack-mode-enqueue
`((request . "UpdateSession")
(update . (,(stack-mode-list->hashtable
`((update . "updateSourceFileFromFile")
(filePath . ,filepath))))))
`((tag . "RequestUpdateSession")
(contents . []))
nil
'stack-mode-loading-callback)))

Expand Down Expand Up @@ -459,7 +458,8 @@ directory."
:continue)
(t
(stack-mode-enqueue
`((request . "GetSourceErrors"))
`((tag . "RequestGetSourceErrors")
(contents . []))
nil
'stack-mode-get-source-errors-callback)
:done)))
Expand Down

0 comments on commit c4a02ae

Please sign in to comment.