-
-
Notifications
You must be signed in to change notification settings - Fork 247
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
clojure-find-ns
: never raise errors
#654
Conversation
I'm not opposed to the change, but it is a breaking change regardless. Might be better to either introduce some extra param (e.g. |
fc260f3
to
4bf10fc
Compare
4bf10fc
to
b89e378
Compare
I find unintentional errors to not quite be an API (they can be considered bugs that are subject to be fixed at any point), however I've applied the feedback 👍 It's green again |
clojure-mode.el
Outdated
@@ -2142,23 +2142,30 @@ DIRECTION is `forward' or `backward'." | |||
(setq candidate (string-remove-prefix "'" (thing-at-point 'symbol)))))))) | |||
candidate)) | |||
|
|||
(defun clojure-find-ns () | |||
"Return the namespace of the current Clojure buffer. | |||
(defun clojure-find-ns (&optional favor-nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think suppress-errors
is a better name for this.
Done! |
clojure-mode.el
Outdated
@@ -2142,23 +2142,30 @@ DIRECTION is `forward' or `backward'." | |||
(setq candidate (string-remove-prefix "'" (thing-at-point 'symbol)))))))) | |||
candidate)) | |||
|
|||
(defun clojure-find-ns () | |||
"Return the namespace of the current Clojure buffer. | |||
(defun clojure-find-ns (&optional supress-errors) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actually "suppress" (double p). Btw, on second thought "ignore-errors" might be an even better name, but I'm fine with both options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arrgh :)
Amended. I left it at suppress because there's already a construct named ignore-errors
(probably Elisp would have been fine with it. Humans not so much?)
f928de5
to
0d79a6f
Compare
See also clojure-emacs/cider#2849 for a use case and discussion.
One can see quite a few usages of
clojure-find-ns
in CIDER. Those assume a possible nil value, e.g.:https://github.com/clojure-emacs/cider/blob/0e76b141054f091fa1a21fea7f2a5604b2f7f8d4/cider-client.el#L129-L130
...so the proposed change would be aligned with the existing usage.
Cheers - V