-
-
Notifications
You must be signed in to change notification settings - Fork 44
Avoid throwing an error for frequent operations like completion #125
New issue
Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “No 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? No Sign in to your account
Avoid throwing an error for frequent operations like completion #125
Conversation
I also want to pass |
5811278
to
482826f
Compare
inf-clojure.el
Outdated
(current-buffer) | ||
inf-clojure-buffer))) | ||
|
||
(defun inf-clojure--proc-or-error () |
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 a more common approach is to have just one function and some param controlling wether to raise errors or return nil
. That's what we do in CIDER for instance (and I've seen in many other packages).
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.
Ok will change that
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.
The function won't be pure anymore though
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.
In Emacs that's totally fine. :-)
482826f
to
b13833c
Compare
468d6cd
to
6df610d
Compare
The changes look good, but your branch has to be rebased on top of the current |
I am going to do it now |
This patch introduces an argument to inf-clojure-proc so that client code can decide when to error out return the processs. This is necessary because while it is good to communicate an error on "eval" operations, it is not good to have it on "under the hood" and very frequent ones like completion and get arglists.
6df610d
to
a6da43a
Compare
This patch introduces reduces
inf-clojure-proc
's responsabilities to only one:return the processs. The new
inf-clojure--proc-or-error
will do both returningand erroring.
This is necessary because while it is good to communicate an error on "eval"
operations, it is not good to have it on "under the hood" and very frequent
ones like completion and get arglists.
Before submitting the PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):
M-x checkdoc
warningsThanks!