-
Notifications
You must be signed in to change notification settings - Fork 87
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
Wrong number of arguments: request--curl-callback, 2 #76
Comments
workaround: (defun anki-editor--anki-connect-invoke! (orig-fun &rest args)
(let ((request--curl-callback
(lambda (proc event) (request--curl-callback "localhost" proc event))))
(apply orig-fun args)))
(advice-add 'anki-editor--anki-connect-invoke :around #'anki-editor--anki-connect-invoke!) |
@BlindingDark tried this, didn't work for me. I also opened an issue #78 which may be related to this. EDIT: |
@sprajagopal (request--curl-callback (get-buffer-process (request-response--buffer response)) "finished\n"))) to (request--curl-callback "localhost" (get-buffer-process (request-response--buffer response)) "finished\n"))) I did not encounter the second error(about ANKI_NOTE_ID), so your problem may be related to it. |
@BlindingDark That worked! |
…est--curl-callback' 'request.el' commit '8ccbae1b5e5e2ae68112dd46a6bee67d318b0deb' changed the function signature ("arity") from 2 to 3 arguments. The current stable version of that package still uses the old number of args. The rolling-release master branch of 'request.el' uses the new number of args. This function handles both cases for the time being. (It is generally frowned upon to use provate functions from other packages since they are not considered a stable interface. However, for now, it is unavoidable since there is no "stable" interface to forec 'request.el' to run the callback.)
…f `request--curl-callback'
…f `request--curl-callback' Check for the new 3-arg arity. By default, expect the stable, 2-arg arity from 'request.el'
This patch: - updates the local deps - adds an advice from: louietan/anki-editor#76 to address the problem when pushing notes to Anki (notes were successfully pushed, however we didn't get the id of the note, which is necessary to be able to later update the note
I started getting this error after a fresh recompilation of emacs from the latest
feature/native-comp
. Despite the error, the cards get pushed toanki
. The problem is the echo message and the fact that instead of writing the ANKI_NOTE_ID field, I get an error field.After some investigation, I discovered that the
request.el
package has changed the signature of therequest--curl-callback
function, about 10 months ago, from(proc event)
(url proc event)
. It passes the extraurl
argument to another functionrequest--curl-preprocess
, for which theurl
argument is optional.Adding a
url
such as"localhost"
to the functionanki-editor--anki-connect-invoke
which is the function that callsrequest--curl-callback
gets rid of the error field and brings back the ANKI_NOTE_ID field. But this still keeps a different error in the message buffer.The text was updated successfully, but these errors were encountered: