Open Honeypot95 opened 4 years ago
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. I'm gonna try and roll back the request package and see if that works too.
EDIT: Previous workaround may still work for you. My configuration had other issues
@sprajagopal
The above method just add first parameter "localhost"
to request--curl-callback
.
If it doesn't work for you, you can try to modify the source file directly.
Just change https://github.com/louietan/anki-editor/blob/master/anki-editor.el#L161
(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!
Everything's smooth now. Even the ANKI_NOTE_ID
is updated properly now.
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.