Skip to content

Incompatibilities with Clojurescript #150

Open
@austinhaas

Description

@austinhaas

inf-clojure included non-portable Clojure code, and it automatically enables an eldoc feature which triggers the non-portable code in a Clojurescript REPL.

https://github.com/clojure-emacs/inf-clojure/blob/master/inf-clojure.el#L859

(defcustom inf-clojure-arglists-form
  "(try
     (:arglists
      (clojure.core/meta
       (clojure.core/resolve
        (clojure.core/read-string \"%s\"))))
     (catch Throwable t nil))"
  "Form to query inferior Clojure for a function's arglists."
  :type 'string
  :safe #'stringp
  :package-version '(inf-clojure . "2.0.0"))

Throwable isn't available in clojurescript. Additionally, when called from clojurescript, this code will throw an error stating that the argument to resolve must be a quoted symbol.

WARNING: Use of undeclared Var cljs.user/Throwable at line 6 <cljs repl>
clojure.lang.ExceptionInfo: Assert failed: Argument to resolve must be a quoted symbol
(core/and (seq? quoted-sym) (= (quote quote) (first quoted-sym))) at line 4 <cljs repl> {:file "<cljs repl>", :line 4, :column 2, :root-source-info {:source-type :fragment, :source-form (try (:arglists (clojure.core/meta (clojure.core/resolve (clojure.core/read-string "ClojureScript")))) (catch Throwable t nil))}, :tag :cljs/analysis-error}

In spite of these issues, I don't think these "eldoc" helper functions should be called if the user doesn't have eldoc-mode enabled. I've resolved the issue by commenting out the call to inf-clojure-eldoc-setup
on Line 182: https://github.com/clojure-emacs/inf-clojure/blob/master/inf-clojure.el#L182

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