@@ -1057,14 +1057,31 @@ don't care when the thing completes as long as it's soonish."
1057
1057
'read-only t
1058
1058
'rear-nonsticky t ))))))
1059
1059
1060
+ (defun haskell-interactive-mode-splices-buffer (session )
1061
+ " Get the splices buffer for the current session."
1062
+ (get-buffer-create (haskell-interactive-mode-splices-buffer-name session)))
1063
+
1064
+ (defun haskell-interactive-mode-splices-buffer-name (session )
1065
+ (format " *%s :splices* " (haskell-session-name session)))
1066
+
1060
1067
(defun haskell-interactive-mode-compile-splice (session message )
1061
1068
" Echo a compiler splice."
1062
- (with-current-buffer (haskell-session-interactive-buffer session)
1063
- (setq next-error-last-buffer (current-buffer ))
1064
- (save-excursion
1065
- (haskell-interactive-mode-goto-end-point)
1066
- (insert (haskell-fontify-as-mode message 'haskell-mode )
1067
- " \n " ))))
1069
+ (with-current-buffer (haskell-interactive-mode-splices-buffer session)
1070
+ (unless (eq major-mode 'haskell-mode )
1071
+ (haskell-mode ))
1072
+ (let* ((parts (split-string message " \n ======>\n " ))
1073
+ (file-and-decl-lines (split-string (nth 0 parts) " \n " ))
1074
+ (file (nth 0 file-and-decl-lines))
1075
+ (decl (mapconcat #'identity (cdr file-and-decl-lines) " \n " ))
1076
+ (output (nth 1 parts)))
1077
+ (insert " -- " file " \n " )
1078
+ (let ((start (point )))
1079
+ (insert decl " \n " )
1080
+ (indent-rigidly start (point ) -4 ))
1081
+ (insert " -- =>\n " )
1082
+ (let ((start (point )))
1083
+ (insert output " \n " )
1084
+ (indent-rigidly start (point ) -4 )))))
1068
1085
1069
1086
(defun haskell-interactive-mode-insert-garbage (session message )
1070
1087
" Echo a read only piece of text before the prompt."
0 commit comments