@@ -584,7 +584,7 @@ SESSION in specified FILE to remove IMPORT on given LINE."
584
584
(cl-case (read-event
585
585
(propertize (format " %s The import line `%s' is redundant. Remove? (y, n, c: comment out) "
586
586
(if (not first)
587
- " Please answer y, n or c: "
587
+ " Please answer n, y or c: "
588
588
" " )
589
589
import)
590
590
'face
@@ -594,38 +594,21 @@ SESSION in specified FILE to remove IMPORT on given LINE."
594
594
(save-excursion
595
595
(goto-char (point-min ))
596
596
(forward-line (1- line))
597
- (let ((bounds (haskell-interactive-mode--import-statement-bounds) ))
598
- (delete-region (car bounds) ( cdr bounds) )
599
- ( kill- line 1 ))))
597
+ (goto-char ( line-beginning-position ))
598
+ (delete-region (line-beginning-position )
599
+ ( line-end-position ))))
600
600
(?n
601
601
(message " Ignoring redundant import %s " import))
602
602
(?c
603
603
(haskell-process-find-file session file)
604
604
(save-excursion
605
605
(goto-char (point-min ))
606
606
(forward-line (1- line))
607
- (let ((bounds (haskell-interactive-mode--import-statement-bounds) ))
608
- ( comment-region ( car bounds) ( cdr bounds)) ))))
607
+ (goto-char ( line-beginning-position ))
608
+ ( insert " -- " ))))
609
609
; ; unwind
610
610
(haskell-mode-toggle-interactive-prompt-state t ))))
611
611
612
- (defun haskell-interactive-mode--import-statement-bounds ()
613
- " For internal use in `haskell-process-suggest-remove-import' .
614
- This function supposed to be called having point placed on first
615
- line of import statement, if this is a case it search import
616
- statement bounds relying on layout and returns them as cons cell;
617
- otherwise returns nil."
618
- (save-excursion
619
- (goto-char (line-beginning-position ))
620
- (when (looking-at-p (regexp-quote " import" ))
621
- (let ((a (point ))
622
- (z (line-end-position )))
623
- (forward-line 1 )
624
- (while (looking-at-p (rx (and not-newline (1+ whitespace))))
625
- (setq z (line-end-position ))
626
- (forward-line 1 ))
627
- (cons a z)))))
628
-
629
612
(defun haskell-process-find-file (session file )
630
613
" Find the given file in the project."
631
614
(find-file (cond ((file-exists-p (concat (haskell-session-current-dir session) " /" file))
0 commit comments