Skip to content

Comint pre output filter handling is wrong #136

Open
@arichiardi

Description

@arichiardi

While digging some other issue, I discovered that the way we are using comint-preoutput-filter-functions might be off. An example output:

----CMD->
"(lumo.repl/doc defn)\n"
<-RES----
"-------------------------"
<-RES----
"\ncljs.core/defn\n([name doc-string? attr-map? [params*] prepost-map? body] [name doc-string? attr-map? ([params*] prepost-map? body) + attr-map?])\n  Same as (def name (core/fn [params* ] exprs*)) or (def\n    name (core/fn ([params* ] exprs*)+)) with any doc-string or attrs added\n    to the var metadata. prepost-map defines a map with optional keys\n    :pre and :post that contain collections of pre or post conditions.\nnil\ncljs.user=> cljs.user=> "

It might be for a couple of reasons, and the above might happen in lumo only, but it seems that inf-clojure-preoutput-filter` is called more than once.

More to dig.

Expected behavior

Ideally it should filter the aggregated response from the repl.

Actual behavior

The current split produces two prompts (one per filtered response) like:

-------------------------

cljs.core/defn
([name doc-string? attr-map? [params*] prepost-map? body] [name doc-string? attr-map? ([params*] prepost-map? body) + attr-map?])
  Same as (def name (core/fn [params* ] exprs*)) or (def
    name (core/fn ([params* ] exprs*)+)) with any doc-string or attrs added
    to the var metadata. prepost-map defines a map with optional keys
    :pre and :post that contain collections of pre or post conditions.
nil
cljs.user=> cljs.user=> 

Steps to reproduce the problem

See command.

Environment & Version information

inf-clojure version information

master

Lein/Boot version

Lumo 1.8.0

Emacs version

24.5

Operating system

Ubuntu 16.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions