Skip to content

Commit

Permalink
(inferior-haskell-command): Provide a default.
Browse files Browse the repository at this point in the history
Ignore-this: 38a7ddd68705f991df1f377dd393f236
(inferior-haskell-command): Provide a default.
(with-selected-window): Define if necessary.
(inferior-haskell-load-file): Display the buffer.

darcs-hash:20051111152503-c2f2e-dc07124816d4ae417fcd04211cf36d7ff30c244c.gz
  • Loading branch information
monnier committed Nov 11, 2005
1 parent 8fc700d commit 6dd0f3a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions inf-haskell.el
Expand Up @@ -102,7 +102,7 @@ The SEPARATOR regexp defaults to \"\\s-+\"."
(defun inferior-haskell-command (arg)
(inferior-haskell-string-to-strings
(if (null arg) haskell-program-name
(read-string "Command to run haskell: "))))
(read-string "Command to run haskell: " haskell-program-name))))

(defvar inferior-haskell-buffer nil
"The buffer in which the inferior process is running.")
Expand Down Expand Up @@ -138,6 +138,12 @@ setting up the inferior-haskell buffer."
(let ((proc (inferior-haskell-process arg)))
(pop-to-buffer (process-buffer proc))))

(unless (fboundp 'with-selected-window)
(defmacro with-selected-window (win &rest body)
`(save-selected-window
(select-window ,win)
,@body)))

;;;###autoload
(defun inferior-haskell-load-file (&optional reload)
"Pass the current buffer's file to the inferior haskell process."
Expand All @@ -157,7 +163,10 @@ setting up the inferior-haskell buffer."
(set-marker compilation-parsing-end (point-max))
(setq compilation-parsing-end (point-max))))
(inferior-haskell-send-command
proc (if reload ":reload" (concat ":load \"" file "\""))))))
proc (if reload ":reload" (concat ":load \"" file "\"")))
(display-buffer (current-buffer))
(with-selected-window (get-buffer-window (current-buffer) 0)
(goto-char (point-max))))))

(defun inferior-haskell-send-command (proc str)
(setq str (concat str "\n"))
Expand Down

0 comments on commit 6dd0f3a

Please sign in to comment.