diff --git a/haskell-interactive-mode.el b/haskell-interactive-mode.el index bda412127..86935304d 100644 --- a/haskell-interactive-mode.el +++ b/haskell-interactive-mode.el @@ -412,13 +412,15 @@ SESSION, otherwise operate on the current buffer. (defun haskell-mode-message-line (str) "Message only one line, multiple lines just disturbs the programmer." - (let ((lines (split-string str "\n" t))) - (when (and (car lines) (stringp (car lines))) - (message "%s" - (concat (car lines) - (if (and (cdr lines) (stringp (cadr lines))) - (format " [ %s .. ]" (haskell-string-take (haskell-string-trim (cadr lines)) 10)) - "")))))) + (message (haskell-mode-one-line str (frame-width)))) + +(defun haskell-mode-one-line (str width) + "Try to fit as much as possible on one line." + (let* + ((long-line (replace-regexp-in-string "\n" " " str)) + (condensed (replace-regexp-in-string " +" " " + (haskell-string-trim long-line)))) + (truncate-string-to-width condensed width nil nil "…"))) (defun haskell-interactive-mode-tab () "Do completion if at prompt or else try collapse/expand."