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

Cider error: cider-get-ns-name: Wrong number of arguments #3566

Closed
WorldsEndless opened this issue Nov 1, 2023 · 9 comments
Closed

Cider error: cider-get-ns-name: Wrong number of arguments #3566

WorldsEndless opened this issue Nov 1, 2023 · 9 comments

Comments

@WorldsEndless
Copy link

Expected behavior

cider starts/operates without issue

Actual behavior

Upon trying to access a Clojure file after cider-jack-in, I cannot proceed past the following error.

Steps to reproduce the problem

  1. cider-jack-in-clj
  2. cider-load-buffer (C-c C-k)

Error:

cider-get-ns-name: Wrong number of arguments: ((clojure-mode-abbrev-table paredit-mode paredit-version paredit-space-for-delimiter-predicates font-lock-end font-lock-beg calculate-lisp-indent-last-sexp t) nil "Return the namespace of the current Clojure buffer.
Return the namespace closest to point and above it.  If there are
no namespaces above point, return the first one in the buffer.

Environment & Version information

  • GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, cairo version 1.16.0)

CIDER version information

  • CIDER 1.10.0 (Sant Cugat), but also tried the latest git pull
;; Connected to nREPL server - nrepl://localhost:44983
;; CIDER 1.10.0 (Sant Cugat), nREPL 1.0.0
;; Clojure 1.10.1, Java 19.0.2
;;     Docs: (doc function-name)
;;           (find-doc part-of-name)
;;   Source: (source function-name)
;;  Javadoc: (javadoc java-object-or-class)
;;     Exit: <C-c C-q>
;;  Results: Stored in vars *1, *2, *3, an exception in *e;
;;  Startup: /home/torysa/.guix-profile/bin/lein update-in :dependencies conj \[nrepl/nrepl\ \"1.0.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.42.1\"\] -- repl :headless :host localhost

Lein / Clojure CLI version

Leiningen 2.10.0 on Java 19.0.2 OpenJDK 64-Bit Server VM

Emacs version

GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, cairo version 1.16.0)

Operating system

Linux GUIX

JDK distribution

openjdk version "19.0.2" 2023-01-17
OpenJDK Runtime Environment (build 19.0.2+-adhoc..source)
OpenJDK 64-Bit Server VM (build 19.0.2+-adhoc..source, mixed mode, sharing)

@vemv
Copy link
Member

vemv commented Nov 1, 2023

Please try upgrading clojure-mode as well

Thanks - V

@WorldsEndless
Copy link
Author

I actually did two tgings. Before I saw @vemv comment I tried a lein clean. Then I also upgraded clojure mode. Now, sure enough, the error is gone! Thanks!

@vemv
Copy link
Member

vemv commented Nov 1, 2023

🍻!

@rnadler
Copy link

rnadler commented Nov 7, 2023

FWIW: If you're using Doom emacs and :lang clojure and want the latest Cider, add the following to your package.el:

(unpin! cider)
(unpin! clojure-mode)

@adrech
Copy link
Contributor

adrech commented Nov 7, 2023

^ consider (unpin! :lang clojure) (unpin! (:lang clojure)) as an alternative, described here:
https://github.com/doomemacs/doomemacs/blob/986398504d09e585c7d1a8d73a6394024fe6f164/lisp/doom-packages.el#L616
In theory, that would ensure that all involved packages are compatible (I haven't tried, not using Doom).

@vemv vemv changed the title BREAKING Cider error: cider-get-ns-name: Wrong number of arguments Cider error: cider-get-ns-name: Wrong number of arguments Nov 7, 2023
@rnadler
Copy link

rnadler commented Nov 7, 2023

@adrech Nice. Need to use (unpin! (:lang clojure)) for just the clojure lang though.

@adrech
Copy link
Contributor

adrech commented Nov 8, 2023

Ups, yeah, my suggestion would have unpinnend all langs 💥.

@vxe
Copy link

vxe commented Dec 7, 2023

Hi can someone elaborate on the coupling between cider and clojure-mode, I've wasted a lot of time chasing this down this bug and if the two projects are going to be out of sync with each other I intend to pin both package versions to avoid break on update scenarios.

@vemv
Copy link
Member

vemv commented Dec 7, 2023

I'd constructively invite you to not consider the time 'wasted'. What can be learned:

  • some errors are quite easily findable on Github / Clojurians Slack
  • certain habits have to be performed when upgrading deps, especially if using Git instead of MELPA
    • we always assume that depending on library x.y.z guarantees that that minimum version will be used, and not a lower one.
    • Everything else is the job of your package manager of choice - if it's not working, report a bug there.

Thanks - V

@clojure-emacs clojure-emacs locked as resolved and limited conversation to collaborators Dec 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants