Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

(inferior-haskell-mode): Typo.

Ignore-this: 1aa52d2abd8e687a283a835881ce3f28
(inferior-haskell-mode): Typo.
(inferior-haskell-wait-for-output): Remove.
(inferior-haskell-send-command): New function.
(inferior-haskell-load-file): Use it.

darcs-hash:20041126000151-c2f2e-19b70566bf236c0b8a4e3e6a4ffdb2beb67a3e98.gz
  • Loading branch information...
commit 8512ba1ede4307977d04379db190e77f96e8a117 1 parent e708d7b
monnier authored
Showing with 18 additions and 15 deletions.
  1. +18 −15 inf-haskell.el
View
33 inf-haskell.el
@@ -64,8 +64,8 @@ The format should be the same as for `compilation-error-regexp-alist'.")
(set (make-local-variable 'compilation-error-regexp-alist)
inferior-haskell-error-regexp-alist)
(cond
- ((fboundp 'compilation-shell-minor-mode) (compilation-shell-minor-mode -1))
- ((fboundp 'compilation-minor-mode) (compilation-minor-mode -1))))
+ ((fboundp 'compilation-shell-minor-mode) (compilation-shell-minor-mode 1))
+ ((fboundp 'compilation-minor-mode) (compilation-minor-mode 1))))
(defun inferior-haskell-string-to-strings (string &optional separator)
"Split the STRING into a list of strings.
@@ -118,15 +118,6 @@ setting up the inferior-haskell buffer."
(let ((proc (inferior-haskell-process arg)))
(pop-to-buffer (process-buffer proc))))
-(defun inferior-haskell-wait-for-output ()
- "Wait until output arrives and go to the last input."
- (let ((proc (get-buffer-process (current-buffer))))
- (while (and
- (goto-char comint-last-input-end)
- (not (re-search-forward comint-prompt-regexp nil t))
- proc
- (accept-process-output proc)))))
-
;;;###autoload
(defun inferior-haskell-load-file (&optional reload)
"Pass the current buffer's file to the inferior haskell process."
@@ -138,11 +129,23 @@ setting up the inferior-haskell buffer."
;; Not sure if it's useful/needed and if it actually works.
;; (unless (equal (file-name-as-directory default-directory)
;; (file-name-directory file))
- ;; (comint-send-string proc (concat ":cd " (file-name-directory file)
- ;; "\n")))
+ ;; (inferior-haskell-send-string
+ ;; proc (concat ":cd " (file-name-directory file) "\n")))
(compilation-forget-errors)
- (comint-send-string
- proc (if reload ":reload\n" (concat ":load " file "\n"))))))
+ (inferior-haskell-send-command
+ proc (if reload ":reload" (concat ":load " file))))))
+
+(defun inferior-haskell-send-command (proc str)
+ (setq str (concat str "\n"))
+ (with-current-buffer (process-buffer proc)
+ (while (and
+ (goto-char comint-last-input-end)
+ (not (re-search-forward comint-prompt-regexp nil t))
+ (accept-process-output proc)))
+ (goto-char (process-mark proc))
+ (insert-before-markers str)
+ (move-marker comint-last-input-end (point))
+ (comint-send-string proc str)))
(defun inferior-haskell-reload-file ()
"Tell the inferior haskell process to reread the current buffer's file."
Please sign in to comment.
Something went wrong with that request. Please try again.