Skip to content

Use clojure-find-ns safely #3428

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

Merged
merged 3 commits into from
Aug 25, 2023
Merged

Use clojure-find-ns safely #3428

merged 3 commits into from
Aug 25, 2023

Conversation

vemv
Copy link
Member

@vemv vemv commented Aug 23, 2023

Fixes #2849

Bumps clojure-mode, introducing a cider-get-ns-name wrapper and using it everywhere.

Callsites handle nil when due.

@vemv vemv requested a review from bbatsov August 23, 2023 21:27
cider-util.el Outdated
@@ -114,9 +114,15 @@ instead."
(clojure-backward-logical-sexp 1)
(cider--text-or-limits bounds (point) end)))))

(defun cider--clojure-find-ns ()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or just cider--find-ns. I guess this one can even be considered public.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There happens to be a defun cider--find-ns already, which does something else

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes - the one that goes to the ns. I'm guessing it'd still be confusing to have cider--find-ns and cider--clojure-find-ns, as it's confusing for me even knowing how we ended up here. :-) Let's name the new function cider-get-ns, cider-current-ns or something like this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cider-get-ns-name?

Aligned with clojure.core/ns-name

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine by me.

@bbatsov bbatsov merged commit 3952734 into master Aug 25, 2023
@bbatsov bbatsov deleted the clojure-mode-5162 branch August 25, 2023 06:54
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

Successfully merging this pull request may close these issues.

repl stays in pending state after clojurescript jack in if there's some buffer with an invalid ns declaration
2 participants