clojure-emacs / cider

The Clojure Interactive Development Environment that Rocks for Emacs
https://cider.mx
GNU General Public License v3.0
3.54k stars 645 forks source link

`*cider-error*` does not display single newline when printing Exception message #2109

Closed bhb closed 5 years ago

bhb commented 6 years ago

Expected behavior

I expect that evaluating (throw (ex-info "foo\nbar" {})) would print the following output to the *cider-error* buffer:

1. Unhandled clojure.lang.ExceptionInfo
   foo
   bar
   {}

Note that if I evaluate (throw (ex-info "foo\n\nbar" {})) (two newlines instead of one) the newlines are shown in *cider-error*:

1. Unhandled clojure.lang.ExceptionInfo
   foo

   bar
   {}

so the problem appears to only occur for a single newline.

Actual behavior

In the first case above (evaluating (throw (ex-info "foo\nbar" {}))), the output in *cider-error* is:

1. Unhandled clojure.lang.ExceptionInfo
   foo bar
   {}

Steps to reproduce the problem

  1. lein new cider-bug-report
  2. Make project.clj look like code below
  3. lein repl
  4. In emacs cider-connect
  5. connect to REPL
  6. In cider REPL buffer, eval (throw (ex-info "foo\nbar" {}))
;; project.clj
(defproject cider-bug-report "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :plugins [[cider/cider-nrepl "0.15.1"]]
  :dependencies [[org.clojure/clojure "1.9.0-RC1"]])

Environment & Version information

CIDER version information

;; CIDER 0.15.1 (London), nREPL 0.2.12
;; Clojure 1.9.0-RC1, Java 1.8.0_151

Lein/Boot version

Leiningen 2.8.0 on Java 1.8.0_151 Java HotSpot(TM) 64-Bit Server VM

Emacs version

GNU Emacs 24.4.1 (x86_64-apple-darwin14.1.0) of 2015-03-19 on miniyosemite.local

Operating system

OS X 10.11.6 "El Capitan"

vspinu commented 6 years ago

The message is "filled" on the emacs side. I guess this was done to save space, but in my experience most of the time this harms the experience (see output from core.spec for instance). Author of the message formats it for readability, and I don't think a tool should mess with that.

bbatsov commented 6 years ago

I'm guess we should either remove the filling or make it configurable.

stathissideris commented 5 years ago

That would be nice!

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!

stale[bot] commented 5 years ago

This issues been automatically closed due to lack of activity. Feel free to re-open it if you ever come back to it.