Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nim-mode breaks cider #1712

Closed
joswik opened this issue Apr 24, 2016 · 4 comments
Closed

Nim-mode breaks cider #1712

joswik opened this issue Apr 24, 2016 · 4 comments

Comments

@joswik
Copy link

joswik commented Apr 24, 2016

My conf. is Emacs 24.5 with bbatsov/prelude (prelude-clojure enabled in prelude-modules.el).

When nim-mode is updated with and BEFORE cider, I get the following error with cider-jack-in:
cider-jack-in: Invalid function: (repl-buff (cider-find-reusable-repl-buffer nil project-dir))

After this cider is broken permanently, restarting Emacs doesn't help.

For example I had these packages to update a few days ago:
Install these 3 packages (nim-mode-20160418.18, magit-20160418.1513, cider-20160418.1513)? (y or n)

As far as I can see packages are installed in reverse (Z-to-A) order, so nim-mode is always installed before cider.
So my workaround is simply to unselect nim-mode, install everything else, then install nim-mode last.

I don't know if it is possible to change package install order.
So I wiped .emacs.d completely; then put in it the latest prelude with just default prelude-modules.el.
Now nim-mode and cider are not installed, so I select one by one from list-packages. This procedure was repeated before each test.

  1. installed nim-mode first, and after it finished selected cider and installed that. Cider didn't work.
  2. installed nim-mode first, and after install restarted Emacs, then selected cider and installed it. Now cider works OK.
  3. installed cider first, didn't restart Emacs, then selected nim-mode and installed it. Cider works OK.

So the only case that breaks cider is installing nim-mode before cider in the SAME Emacs session.

(BTW, I'd like to have nim included in prelude-modules.el in the future.)

project.clj is empty i.e. default created with 'lein new app someapp'

And my profiles.clj is:

{:user {:plugins [[cider/cider-nrepl "0.13.0-snapshot"]]
        :dependencies [ [org.clojure/clojure "1.8.0"]
                       [org.clojure/tools.nrepl "0.2.12"]]}} 

Environment & Version information

CIDER 0.13.0snapshot (package: 20160423.2330), nREPL 0.2.12
Clojure 1.8.0, 1.8.0_66
Leiningen 2.6.1 on Java 1.8.0_66 Java HotSpot(TM) Client VM
Emacs 24.5
Windows 7 SP1 (32-bit)

@bbatsov
Copy link
Member

bbatsov commented Apr 24, 2016

So the only case that breaks cider is installing nim-mode before cider in the SAME Emacs session.

That's very odd. Figuring out what's wrong would probably require analyzing nim-mode's code and I doubt I'll have time for this (if it's really an issue there, that is).

(BTW, I'd like to have nim included in prelude-modules.el in the future.)

PR welcome! :-)

And my profiles.clj is:

If you're only using cider-jack-in, you can remove all this stuff from your profiles.clj.

@Malabarba
Copy link
Member

The first step is to file an issue there politely asking if they know what might be happening. If nim-mode is doing something odd then they'll probably know what it is.

If that doesn't happen, then I can try to look over the code.

@joswik
Copy link
Author

joswik commented Apr 24, 2016

Thank you for your answers.
But before I file the issue to them, can someone confirm this behavior?
Does the same thing happen in Linux or Mac OS?

It's very easy to test - just install nim-mode from list-packages.
But-

  1. make a backup of .emacs.d folder, because if it brekas you can't go back (I think)
  2. to be able to test it, there have to be updates of both nim and cider at the same time.
    But if you already have the latest cider installed the problem won't show up.
    So the only way is clean .emacs.d with default prelude-modules without prelude-clojure enabled,
    and manually install first nim-mode and then cider without restarting Emacs.

@Malabarba
Copy link
Member

No need. I've found the cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants