@@ -92,6 +92,7 @@ actual Emacs buffer of the module being loaded."
92
92
(cursor (haskell-process-response-cursor process))
93
93
(warning-count 0 ))
94
94
(haskell-process-set-response-cursor process 0 )
95
+ (haskell-check-remove-overlays module-buffer)
95
96
(while (haskell-process-errors-warnings module-buffer session process buffer)
96
97
(setq warning-count (1+ warning-count)))
97
98
(haskell-process-set-response-cursor process cursor )
@@ -293,6 +294,10 @@ actual Emacs buffer of the module being loaded."
293
294
(defvar haskell-check-warning-fringe (propertize " ?" 'display '(left-fringe question-mark)))
294
295
(defvar haskell-check-hole-fringe (propertize " _" 'display '(left-fringe horizontal-bar)))
295
296
297
+ (defun haskell-check-remove-overlays (buffer )
298
+ (with-current-buffer buffer
299
+ (remove-overlays (point-min ) (point-max ) 'haskell-check t )))
300
+
296
301
(defun haskell-check-paint-overlay (buffer error-from-this-file-p line msg file err hole coln )
297
302
(with-current-buffer buffer
298
303
(let (beg end)
@@ -330,7 +335,6 @@ messages in the interactive buffer or if CONT is specified,
330
335
passes the error onto that.
331
336
332
337
When MODULE-BUFFER is non-NIL, paint error overlays."
333
- (message " hpew 0 " )
334
338
(cond
335
339
((haskell-process-consume
336
340
process
@@ -364,20 +368,24 @@ When MODULE-BUFFER is non-NIL, paint error overlays."
364
368
(- (haskell-process-response-cursor process) 1 ))
365
369
(let* ((buffer (haskell-process-response process))
366
370
(file (match-string 1 buffer))
367
- (location (match-string 2 buffer))
371
+ (location-raw (match-string 2 buffer))
368
372
(error-msg (match-string 3 buffer))
369
373
(warning (string-match " ^Warning:" error-msg))
370
374
(splice (string-match " ^Splicing " error-msg))
375
+ (errorp (not warning ))
376
+ ; ; XXX: extract hole information, pass down to H-C-P-O
371
377
(final-msg (format " %s :%s : %s "
372
378
(haskell-session-strip-dir session file)
373
- location
374
- error-msg)))
379
+ location-raw
380
+ error-msg))
381
+ (location (haskell-process-parse-error (concat file " :" location-raw " : x" )))
382
+ (line (plist-get location :line ))
383
+ (col1 (plist-get location :col )))
384
+ (when module-buffer
385
+ (haskell-check-paint-overlay module-buffer (string= (file-truename (buffer-file-name module-buffer)) (file-truename file))
386
+ line error-msg file errorp nil col1))
375
387
(if return-only
376
- (let* ((location (haskell-process-parse-error (concat file " :" location " : x" )))
377
- (file (plist-get location :file ))
378
- (line (plist-get location :line ))
379
- (col1 (plist-get location :col )))
380
- (list :file file :line line :col col1 :msg error-msg :type (if warning 'warning 'error )))
388
+ (list :file file :line line :col col1 :msg error-msg :type (if warning 'warning 'error ))
381
389
(progn (funcall (cond (warning
382
390
'haskell-interactive-mode-compile-warning )
383
391
(splice
0 commit comments