Fork me on GitHub
#emacs
<
2023-01-21
>
Eric Scott00:01:26

So I have a minimal pair here between the behavior of clj -- repl and cider REPL buffers. I've defined this, for a defrecord of JenaGraph:

(defmethod print-method JenaGraph
  [x writer]
  (.write writer (str "<JenaGraph hash=" (hash x)">")))
Under clj:
(make-jena-graph)
ont-app.igraph-jena.core=> <JenaGraph hash=510170619>
But in my cider REPL:
(make-jena-graph)
{:model
 #object[org.apache.jena.rdf.model.impl.ModelCom 0x5bb69bcb "<ModelCom   {} | >"]}
Thing is, everthing ins <ModelCom {}...> will include the entire contents of the model, which for large data sets will totally choke the REPL buffer. Hence the print-method redefinition. So clearly there is something on the emacs/cider side that is using either the wrong print method, or some stale version of prn. Where do I start to gain visibility into what's going on between pressing 'enter' in the REPL and the invocation of the 'P' in the REPL?

Eric Scott01:01:22

I should add that prn works just as expected in the cider REPL.

iarenaza12:01:35

Hummm, you may be "experiencing" the effects of pretty printing in the REPL: https://docs.cider.mx/cider/repl/configuration.html#pretty-printing-in-the-repl

Eric Scott14:01:51

That did the trick! Thanks!

Eric Scott14:01:05

Looks like setting the value of cider-print-fn to nil defers to nrepl.middleware.print/*print-fn*, which looks like it solves the issue for me. Thanks again.

👍 2
Drew Verlee00:01:57

Emacs just crashed on me because i deleted part of a comment that then left unmatched parens in that comment.

Drew Verlee00:01:27

I understand that functionally isnt core emacs, but why isn't there any supervisor that stops things before they crash the whole program?

alandipert08:01:12

-debug-init is kinda that, depending on the type of error

practicalli-johnny11:01:29

I noticed that I had to select a line either side of line comments that contains Clojure, otherwise something in Emacs got confused Also had issues with line comments within a comment block hanging Emacs until I did C-g I assume it's something trying to parse the code