Giter VIP home page Giter VIP logo

org-anki's Introduction

org-anki

Non-invasive minor mode to synchronize your org-mode notes to Anki.

Works via AnkiConnect add-on to Anki.[fn:via]

Features deck import via org-anki-import-deck (requires pandoc for converting html to org).

How

Creates “Basic” or “Cloze” type notes.

By default “Basic” cards are created where org entry’s heading is the card front and content is the back.[fn:how] If the heading has Cloze syntax ({{...}}) then the heading is used to create both the question and the answer, and content of the org entry is not used.

Tags are also synchronized.

See example.org and the resulting screenshots for how the cards look after being synced to Anki.

Commands

org-anki-sync-entry
adds or updates the current org-entry under cursor.
org-anki-update-all
updates all entries in buffer. “All” means all entries that have ANKI_NOTE_ID property set.
org-anki-sync-all
adds or updates all entries in buffer. Use #+ANKI_MATCH: some_property=”some value” at top-of-file to selectively sync matched entries. Syntax is same as the MATCH argument for org-map-entries.
org-anki-delete-entry
deletes entry from Anki. Entry must have ANKI_NOTE_ID property.
org-anki-delete-all
delete all entries with ANKI_NOTE_ID property set from Anki.
org-anki-cloze-dwim
converts a region or word under cursor to Cloze syntax, i.e {{c1::hidden text::hint text}}. This should be used in org entry’s title.
org-anki-browse-entry
Browse entry at point on anki’s browser dialog with searching nid
org-anki-import-deck
Prompts for deck name and imports it. Requires pandoc for converting html to org.
org-anki-update-dir
Updates all entries having ANKI_NOTE_ID property in every .org file in your specified directory.

Setup

  • Start Anki with AnkiConnect installed
  • Set destination deck name, either as:
    • (customize-set-variable 'org-anki-default-deck "my-target-deck") in your .emacs
    • #+ANKI_DECK: my-target-deck on top of an .org file
    • :ANKI_DECK: my-target-deck in the properties’ drawer of the item
    • Note that deck mentioned in the above ways must pre-exist (it has to be separately created in the Anki app)
  • Run org-anki-sync-entry to sync org entry under cursor Note: the card browser must be closed while synchronizing, as it won’t update the note otherwise (issue).
  • Run org-anki-delete-entry to delete entry under cursor

You probably want to bind org-anki-sync-entry to a key sequence, but not org-anki-delete-entry – as accidentally deleting notes will become too easy.

In any case, don’t forget to create backups, as deleting notes will lose their scheduling information.

Customize

org-anki-ankiconnnect-listen-address
set AnkiConnect’s listen address. Default is http://127.0.0.1:8765.
org-anki-inherit-tags
tag inheritance is on by default. Set this to nil to turn it off.
org-anki-default-note-type
set note type. By default this is "Basic".
org-anki-api-key
API key to authenticate to AnkiConnect. See https://foosoft.net/projects/anki-connect/#authentication for more.

Why

.. as there are anki-editor, pamparam, org-drill, org-fc?

Anki-editor requires subheadings for card front and card back, thus existing .org notes need to be modified to be ankified. This package takes the heading as card front and content as card back.

The other three are emacs or org-mode only[fn:others], so no spaced repetition from your phone or web.

Footnotes

[fn:via] AnkiConnect starts a HTTP server on localhost:8765 which the current package talks to.

[fn:how] It does this even if the next heading is a sub-heading (you probably don’t want subheadings in card contents anyway).

[fn:others] I mean, do you really want to use this just to use Anki?? :p

org-anki's People

Contributors

bard avatar basaran avatar elilif avatar eyeinsky avatar gsingh93 avatar hector-chauran avatar mslxl avatar peng051410 avatar skissue avatar syohex avatar theottm avatar whatacold avatar ywnico avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

org-anki's Issues

how to add note with Cloze?

When I enter the following example in the org file, then M+x org-anki-sync-entry.
#+ANKI_DECK: org-anki-test-deck

hande
** * Q: Kaleida was funded to the tune of {{c1::$40 million::…amount}} by Apple Computer and IBM in 1991
there is a question: org-anki error: Couldn’t add note, received error: (model was not found: Cloze) ?

Add ability to add file-global tags

.. so one could specify a tag once and for all for every note in a file, e.g ANKI_TAGS: russian for an org file only for Russian vocabulary.

Creating cards with sub-tags

Is it possible to add cards with subtags?
for example:

#+ANKI_DECK: Biology::Genetics  
#+ANKI_TAGS: Genetics::DNA_RNA

* Nucleic acids consist of {{c1::nitrogenous base, a pentose and at least one phosphate group::3}}  
:PROPERTIES:  
:ANKI_NOTE_ID: 1666361854696  
:END:  

Creates a card in the subdeck Genetics, but will add both Genetics and DNA_RNA tags, instead of 'Genetics' with subtag 'DNA_RNA'

  • visual example of anki subtags with this add-on here

Nested decks support

Hi! I use nested anki decks extensively (achived by dragging and dropping a deck onto another in the anki desktop app). But when I do, unless a ANKI_NOTE_ID is present, the :ANKI_DECK: name can't be found by org-anki when I use the top level name of the deck. It works again if I un-nest the deck in anki. Does anyone know a solution to this? Maybe I need to prepend the parent deck to the name in some way? Thanks for any help! Happy New Year!

Unable to create a card because it's a duplicate (not no ANKI_NOTE_ID is inserted)

Hello folks,

I created a small helper function to ankify a subtree of cards. I noticed after running it that some of the headings did not acquired the ANKI_NOTE_ID property but they did show up in the Anki database. Obviously when I tried reinserting them they failed with the duplicate error.

Has anyone else observed this? I'm basically running org-anki-sync-entry on a subtree. Nothing complicated.

Improve documentation

I think it would be helpful to document a few things and give some examples, either in the README or in some other location (CHANGELOG.org mentions some of these, but not in enough detail):

  • All of the custom properties, i.e. ANKI_NOTE_TYPE
  • Creating notes where the subheadings are the field names (from #48)
  • Adding new note types in org-anki-model-fields

There's probably some other features that aren't documented, but these are the few that I went looking for and didn't find.

Complicated error message when org-anki can't connect to Anki

In the case that org-anki can't connect to Anki, an error message should be displayed stating that.

Currently, it displays the message below:

Debugger entered: ("Error response in variable '_args'")
  #f(compiled-function (&rest args) #<bytecode 0x1d767cdf49f5f846>)(:data nil :symbol-status parse-error :error-thrown (error . "exited abnormally with code 7\n") :response #s(request-response :status-code nil :history nil :data nil :error-thrown (error . "exited abnormally with code 7\n") :symbol-status parse-error :url "http://127.0.0.1:8765" :done-p nil :settings (:type "GET" :data "{\"version\":6,\"action\":\"notesInfo\",\"params\":{\"notes..." :headers (("Content-Type" . "application/json")) :parser json-read :error #f(compiled-function (&rest args) #<bytecode 0x1d767cdf49f5f846>) :success #f(compiled-function (&rest rest) #<bytecode 0x97e6d34cb91904>) :url "http://127.0.0.1:8765" :response #8 :encoding utf-8) :-buffer #<killed buffer> :-raw-header "" :-timer nil :-backend curl))
  apply(#f(compiled-function (&rest args) #<bytecode 0x1d767cdf49f5f846>) (:data nil :symbol-status parse-error :error-thrown (error . "exited abnormally with code 7\n") :response #s(request-response :status-code nil :history nil :data nil :error-thrown (error . "exited abnormally with code 7\n") :symbol-status parse-error :url "http://127.0.0.1:8765" :done-p nil :settings (:type "GET" :data "{\"version\":6,\"action\":\"notesInfo\",\"params\":{\"notes..." :headers (("Content-Type" . "application/json")) :parser json-read :error #f(compiled-function (&rest args) #<bytecode 0x1d767cdf49f5f846>) :success #f(compiled-function (&rest rest) #<bytecode 0x97e6d34cb91904>) :url "http://127.0.0.1:8765" :response #10 :encoding utf-8) :-buffer #<killed buffer> :-raw-header "" :-timer nil :-backend curl)))
  request--callback(#<killed buffer> :type "GET" :data "{\"version\":6,\"action\":\"notesInfo\",\"params\":{\"notes..." :headers (("Content-Type" . "application/json")) :parser json-read :error #f(compiled-function (&rest args) #<bytecode 0x1d767cdf49f5f846>) :success #f(compiled-function (&rest rest) #<bytecode 0x97e6d34cb91904>) :url "http://127.0.0.1:8765" :response #s(request-response :status-code nil :history nil :data nil :error-thrown (error . "exited abnormally with code 7\n") :symbol-status parse-error :url "http://127.0.0.1:8765" :done-p nil :settings (:type "GET" :data "{\"version\":6,\"action\":\"notesInfo\",\"params\":{\"notes..." :headers (("Content-Type" . "application/json")) :parser json-read :error #f(compiled-function (&rest args) #<bytecode 0x1d767cdf49f5f846>) :success #f(compiled-function (&rest rest) #<bytecode 0x97e6d34cb91904>) :url "http://127.0.0.1:8765" :response #17 :encoding utf-8) :-buffer #<killed buffer> :-raw-header "" :-timer nil :-backend curl) :encoding utf-8)
  apply(request--callback #<killed buffer> (:type "GET" :data "{\"version\":6,\"action\":\"notesInfo\",\"params\":{\"notes..." :headers (("Content-Type" . "application/json")) :parser json-read :error #f(compiled-function (&rest args) #<bytecode 0x1d767cdf49f5f846>) :success #f(compiled-function (&rest rest) #<bytecode 0x97e6d34cb91904>) :url "http://127.0.0.1:8765" :response #s(request-response :status-code nil :history nil :data nil :error-thrown (error . "exited abnormally with code 7\n") :symbol-status parse-error :url "http://127.0.0.1:8765" :done-p nil :settings #3 :-buffer #<killed buffer> :-raw-header "" :-timer nil :-backend curl) :encoding utf-8))
  request--curl-callback("http://127.0.0.1:8765" #<process request curl> "exited abnormally with code 7\n")
  apply(request--curl-callback ("http://127.0.0.1:8765" #<process request curl> "exited abnormally with code 7\n"))
  #f(compiled-function (&rest args2) #<bytecode -0x19fc2eaede291339>)(#<process request curl> "exited abnormally with code 7\n")

This would save a lot of people time debugging a common problem.

Same-level headings are added to the back of the card

When calling org-anki-sync-all while headings are in folded mode, same-level headings are added to the back of the card.

org-anki version: 1.0.1
Can be reproduced with this org file:

#+ANKI_DECK: test
#+ANKI_MATCH: -ANKI_IGNORE="true"
* heading 1
:PROPERTIES:
:ANKI_IGNORE: true
:END:
** heading 2
:PROPERTIES:
:ANKI_IGNORE: true
:END:
*** heading 3
:PROPERTIES:
:ANKI_IGNORE: true
:END:
**** anki item 1
back
**** anki item 2
back
**** anki item 3
back

cloze card with Extra at the back

Hello,

Could you elaborate please if creating such a card is possible?

* {{c1::mkinitcpio::x}} is a bash script
** Extra
    Indeed, it is a bash script and not a perl script.

It ends up creating two notes. I also tried making a custom model with 'org-anki-model-fields but couldn't get far. I also tried like this:

* {{c1::mkinitcpio::x}} is a bash script
Indeed, it is a bash script and not a perl script.

and it creates one card, but the Extra is ignored. It doesn't reach Anki.

Allow HTML tags in notes

I'm trying to create a note with some line breaks: * Questions:<br>- {{c1::Item 1}}<br>- {{c2::Item 2}}<br>- {{c3::Item 3}}

But when I export this, the HTML tags are escaped. Is there an option to add the note without escaping HTML characters so I can have Anki parse my own HTML?

Anki cards resulting from the org file

@eyeinsky Thank you for sharing this interesting project. I saw that you added a sample file, but it could be useful if you would include some pictures of the resulting anki cards. In particular, exemplifying the role of the different org structures in the resulting cards.

Discover note fields without needing to edit `org-anki-model-fields`

I'm not sure how difficult this would be, but if there's a way to get the fields of a note type without needing to add them to org-anki-model-fields, that would be very convenient. We could add the ANKI_NOTE_TYPE property or change the default note type and create new notes without any additional customization.

Add setting to force the use of multi-line cards

Multiline cards were added in #48. It seems like the code attempts to figure out itself whether the fields of a card should come from the headings. One problem I've come across is that this doesn't work well with org-anki-sync-all, which will sync all of the subheadings as new cards.

To fix this, there could be a setting to configure forcing multi-line cards. Or alternatively, maybe an org-anki-sync-all-multiline could be written to handle this case. I'm not sure what's a better solution.

Add destination deck configuration sequence

Look for it in this sequence:

  1. entry property
  2. global property
  3. customized variable (i.e in the .emacs file)
  4. library default as last resort (or perhaps just give an error?)

Display name of the deck also in the echo area to make it clear where the note went.

Special symbols throw error using org-anki-sync-entry

When using org-anki-sync-entry with an entry with a special character (for example an accented vowel), I get a the following message:

error in process sentinel: url-http-create-request: Multibyte text in HTTP request

Is there a workaround for this to sync entries with special characters?

org-anki-skip-function isn't being picked up

I might not be doing this right, but setting org-anki-skip-function doesn't seem to change the result of org-anki-sync-all. All entries get synchronized regardless.

The function I'm trying to use is this:

 (lambda ()
   (if (nth 2 (org-heading-components))
       (forward-line 1)
     nil)))

This is meant to skip headers with a TODO tag.

org-anki-skip-function looks like this:

(closure
 (t)
 nil
 (if
     (nth 2
          (org-heading-components))
     (forward-line 1)
   nil))

So it seems to be set correctly.

I test my skip function like this:

(defun test ()
  (let ((entries nil))
    (org-map-entries
     (lambda ()
       (push (org-heading-components) entries)
       (push "\n" entries))
     nil
     nil
     (lambda ()
       (if (nth 2 (org-heading-components))
           (forward-line 1)
         nil)))
    (print entries)))

And it does work as expected, printing only the entries I want.

The org file I tested this with looks like this:

* TODO not a card
* TODO also not a card
** an actual card
     content

All three headers end up being turned into cards.

Is it possible to add a backlink to current org-mode file in the generated Anki card?

I think this kind of backlink would be very helpful. Is there any idea? My elisp is poor, however, if you have any idea but do not have time to implement, I may have a try and creat a pull request.

Generating a backlink to the org-exported html instead may also be helpful, but I have tried and found that anki does not support link to local html files for security concern. So I don't know how to solve this.

Thank you very much for this package. I think it is more suitable in my working flow than the existing anki-editor package.

Adding support for Cloze Overlapping cards

It would be very useful to have support for cloze overlapping cards.

Card type can be defined in the property drawer. Perhaps by prompting the user to chose a card type when the heading have mutable items.

Here is an example based on this issue in a similar project

* title
:PROPERTIES:
:ANKI_NOTE_ID: 1675532440856
:ANKI_DECK: example_deck
:ANKI_CARDTYPE: cloze (overlapping)
:END:
- item 1
- item 1
- item 1

example jason for anki-connect:

{
    "action": "addNote",
    "version": 6,
    "params": {
        "note": {
            "deckName": "example_deck",
            "modelName": "Cloze (overlapping)",
            "tags": [],
            "fields": {
                "Title": "title",
                "Full": "<div>{{c21::Item 1}}</div><div>{{c21::Item 1}}</div><div>{{c21::Item 1}}</div>",
                "Text2": "<div>Item 1</div><div>{{c2::Item 1}}</div><div>...</div>",
                "Text3": "<div>...</div><div>Item 1</div><div>{{c3::Item 1}}</div>",
                "Text1": "<div>{{c1::Item 1}}</div><div>...</div><div>...</div>",
                "Settings": "1,1,0 | n,n,n,n",
                "Original": "Item 1<div>Item 1</div><div>Item 1</div>",
                "Sources": ""
            }
        }
    }
}

Add a command that increments the Cloze number

org-anki-cloze-dwim always starts at c1, which is fine. I see it takes a prefix argument to specify an alternative number. But it slows me down to add this prefix argument every time I want to set the number.

In Anki, pressing ctrl+shift+c converts the highlighted text to the next cloze number, while ctrl+shift+alt+c uses the last cloze number. Can we have something similar in org-anki? For example, org-anki-cloze-dwim could always start at 1 without a prefix argument, but a command like org-anki-cloze-dwim-auto-incr could increment to the next number, and org-anki-cloze-dwim-dont-incr could reuse the last number.

This post has something similar, although not exactly the same: https://yiufung.net/post/anki-org/

Error when trying to push note to anki - "Cannot create note because it is empty"

All settings are default ones. Anki-editor works fine.
Error reproduced with file like

#+ANKI_DECK: attestation-2021

* Test
  lalala

There is debugger output:

Debugger entered--Lisp error: (wrong-type-argument numberp ((result) (error . "cannot create note because it is empty")))
  number-to-string(((result) (error . "cannot create note because it is empty")))
  (org-set-property org-anki-prop-note-id (number-to-string result))
  (save-excursion (goto-char (progn (or (progn (and (memq (type-of note) cl-struct-org-anki--note-tags) t)) (signal 'wrong-type-argument (list 'org-anki--note note))) (aref note 6))) (org-set-property org-anki-prop-note-id (number-to-string result)))
  (cond ((equal "addNote" (assoc-default "action" action)) (save-excursion (goto-char (progn (or (progn (and (memq (type-of note) cl-struct-org-anki--note-tags) t)) (signal 'wrong-type-argument (list 'org-anki--note note))) (aref note 6))) (org-set-property org-anki-prop-note-id (number-to-string result)))) ((equal "updateNoteFields" (assoc-default "action" action)) (message "org-anki: note succesfully updated: %s" (progn (or (progn (and (memq (type-of note) cl-struct-org-anki--note-tags) t)) (signal 'wrong-type-argument (list 'org-anki--note note))) (aref note 1)))))
  (let* ((note-with-action (car pair)) (note (car note-with-action)) (action (cdr note-with-action)) (result (car (cdr pair)))) (cond ((equal "addNote" (assoc-default "action" action)) (save-excursion (goto-char (progn (or (progn ...) (signal ... ...)) (aref note 6))) (org-set-property org-anki-prop-note-id (number-to-string result)))) ((equal "updateNoteFields" (assoc-default "action" action)) (message "org-anki: note succesfully updated: %s" (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... note))) (aref note 1))))))
  org-anki--handle-pair(((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))) ((result) (error . "cannot create note because it is empty"))))
  -map(org-anki--handle-pair (((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))) ((result) (error . "cannot create note because it is empty")))))
  (let* ((result-list (append the-result nil)) (pairs (-zip-lists note-action-pairs result-list)) (sorted (-sort #'(lambda (a b) (> (org-anki--get-point a) (org-anki--get-point b))) pairs))) (-map 'org-anki--handle-pair sorted))
  (closure ((actions (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (note-action-pairs (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-tag-actions2) (notes-and-tag-actions) (updates) (adds (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-actions ((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))))) (existing-tags) (promise . #<promise-class promise-class-15912d977270>) (notes #s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32)) cl-struct-org-anki--note-tags t) (the-result) (let* ((result-list (append the-result nil)) (pairs (-zip-lists note-action-pairs result-list)) (sorted (-sort #'(lambda (a b) (> (org-anki--get-point a) (org-anki--get-point b))) pairs))) (-map 'org-anki--handle-pair sorted)))([((result) (error . "cannot create note because it is empty"))])
  funcall((closure ((actions (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (note-action-pairs (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-tag-actions2) (notes-and-tag-actions) (updates) (adds (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-actions ((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))))) (existing-tags) (promise . #<promise-class promise-class-15912d977270>) (notes #s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32)) cl-struct-org-anki--note-tags t) (the-result) (let* ((result-list (append the-result nil)) (pairs (-zip-lists note-action-pairs result-list)) (sorted (-sort #'(lambda (a b) (> (org-anki--get-point a) (org-anki--get-point b))) pairs))) (-map 'org-anki--handle-pair sorted))) [((result) (error . "cannot create note because it is empty"))])
  (if the-error (if on-error (funcall on-error the-error) (error "Unhandled error: %s" the-error)) (funcall on-result the-result))
  (let ((the-error (assoc-default 'error data)) (the-result (assoc-default 'result data))) (if the-error (if on-error (funcall on-error the-error) (error "Unhandled error: %s" the-error)) (funcall on-result the-result)))
  (let* ((data (car (cdr (plist-member --cl-rest-- ':data))))) (let ((the-error (assoc-default 'error data)) (the-result (assoc-default 'result data))) (if the-error (if on-error (funcall on-error the-error) (error "Unhandled error: %s" the-error)) (funcall on-result the-result))))
  (closure ((json . "{\"version\":6,\"action\":\"multi\",\"params\":{\"actions\":[{\"action\":\"addNote\",\"params\":{\"note\":{\"deckName\":\"attestation-2021\",\"modelName\":\"Basic\",\"fields\":{\"Front\":\"<p>\\nTest</p>\\n\",\"Back\":\"<p>\\nlalala</p>\\n\"},\"tags\":\"\",\"options\":{\"allowDuplicate\":false,\"duplicateScope\":\"deck\"}}}}]}}") (on-error closure ((actions (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (note-action-pairs (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-tag-actions2) (notes-and-tag-actions) (updates) (adds (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-actions ((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))))) (existing-tags) (promise . #<promise-class promise-class-15912d977270>) (notes #s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32)) cl-struct-org-anki--note-tags t) (the-error) (org-anki--report-error "Couldn't update note, received: %s" the-error)) (on-result closure ((actions (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (note-action-pairs (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-tag-actions2) (notes-and-tag-actions) (updates) (adds (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-actions ((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))))) (existing-tags) (promise . #<promise-class promise-class-15912d977270>) (notes #s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32)) cl-struct-org-anki--note-tags t) (the-result) (let* ((result-list (append the-result nil)) (pairs (-zip-lists note-action-pairs result-list)) (sorted (-sort #'(lambda (a b) (> (org-anki--get-point a) (org-anki--get-point b))) pairs))) (-map 'org-anki--handle-pair sorted))) (body ("action" . "multi") ("params" ("actions" (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))))) t) (&rest --cl-rest--) "\n\n(fn &key DATA &allow-other-keys)" (let* ((data (car (cdr (plist-member --cl-rest-- ':data))))) (let ((the-error (assoc-default 'error data)) (the-result (assoc-default 'result data))) (if the-error (if on-error (funcall on-error the-error) (error "Unhandled error: %s" the-error)) (funcall on-result the-result)))))(:data ((result . [((result) (error . "cannot create note because it is empty"))]) (error)) :symbol-status success :error-thrown nil :response #s(request-response :status-code 200 :history nil :data ((result . [((result) (error . "cannot create note because it is empty"))]) (error)) :error-thrown nil :symbol-status success :url "http://localhost:8765/" :done-p nil :settings (:type "GET" :data "{\"version\":6,\"action\":\"multi\",\"params\":{\"actions\":[{\"action\":\"addNote\",\"params\":{\"note\":{\"deckName\":\"attestation-2021\",\"modelName\":\"Basic\",\"fields\":{\"Front\":\"<p>\\nTest</p>\\n\",\"Back\":\"<p>\\nlalala</p>\\n\"},\"tags\":\"\",\"options\":{\"allowDuplicate\":false,\"duplicateScope\":\"deck\"}}}}]}}" :headers (("Content-Type" . "application/json")) :parser json-read :error (closure ((json . "{\"version\":6,\"action\":\"multi\",\"params\":{\"actions\":[{\"action\":\"addNote\",\"params\":{\"note\":{\"deckName\":\"attestation-2021\",\"modelName\":\"Basic\",\"fields\":{\"Front\":\"<p>\\nTest</p>\\n\",\"Back\":\"<p>\\nlalala</p>\\n\"},\"tags\":\"\",\"options\":{\"allowDuplicate\":false,\"duplicateScope\":\"deck\"}}}}]}}") (on-error closure ((actions (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (note-action-pairs (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-tag-actions2) (notes-and-tag-actions) (updates) (adds (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-actions ((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))))) (existing-tags) (promise . #<promise-class promise-class-15912d977270>) (notes #s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32)) cl-struct-org-anki--note-tags t) (the-error) (org-anki--report-error "Couldn't update note, received: %s" the-error)) (on-result closure ((actions (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (note-action-pairs (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-tag-actions2) (notes-and-tag-actions) (updates) (adds (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-actions ((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))))) (existing-tags) (promise . #<promise-class promise-class-15912d977270>) (notes #s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32)) cl-struct-org-anki--note-tags t) (the-result) (let* ((result-list (append the-result nil)) (pairs (-zip-lists note-action-pairs result-list)) (sorted (-sort #'(lambda (a b) (> (org-anki--get-point a) (org-anki--get-point b))) pairs))) (-map 'org-anki--handle-pair sorted))) (body ("action" . "multi") ("params" ("actions" (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))))) t) (&rest _args) "\n\n(fn &rest ARGS)" (debug "Error response in variable '_args'")) :success (closure ((json . "{\"version\":6,\"action\":\"multi\",\"params\":{\"actions\":[{\"action\":\"addNote\",\"params\":{\"note\":{\"deckName\":\"attestation-2021\",\"modelName\":\"Basic\",\"fields\":{\"Front\":\"<p>\\nTest</p>\\n\",\"Back\":\"<p>\\nlalala</p>\\n\"},\"tags\":\"\",\"options\":{\"allowDuplicate\":false,\"duplicateScope\":\"deck\"}}}}]}}") (on-error closure ((actions (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (note-action-pairs (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-tag-actions2) (notes-and-tag-actions) (updates) (adds (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-actions ((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))))) (existing-tags) (promise . #<promise-class promise-class-15912d977270>) (notes #s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32)) cl-struct-org-anki--note-tags t) (the-error) (org-anki--report-error "Couldn't update note, received: %s" the-error)) (on-result closure ((actions (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (note-action-pairs (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-tag-actions2) (notes-and-tag-actions) (updates) (adds (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-actions ((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))))) (existing-tags) (promise . #<promise-class promise-class-15912d977270>) (notes #s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32)) cl-struct-org-anki--note-tags t) (the-result) (let* ((result-list (append the-result nil)) (pairs (-zip-lists note-action-pairs result-list)) (sorted (-sort #'(lambda (a b) (> (org-anki--get-point a) (org-anki--get-point b))) pairs))) (-map 'org-anki--handle-pair sorted))) (body ("action" . "multi") ("params" ("actions" (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))))) t) (&rest --cl-rest--) "\n\n(fn &key DATA &allow-other-keys)" (let* ((data (car (cdr (plist-member --cl-rest-- ':data))))) (let ((the-error (assoc-default 'error data)) (the-result (assoc-default 'result data))) (if the-error (if on-error (funcall on-error the-error) (error "Unhandled error: %s" the-error)) (funcall on-result the-result))))) :url "http://localhost:8765" :response #8 :encoding utf-8) :-buffer #<killed buffer> :-raw-header "HTTP/1.1 200 OK\nContent-Type: text/json\nAccess-Control-Allow-Origin: http://localhost\nAccess-Control-Allow-Headers: *\nContent-Length: 96\n" :-timer nil :-backend curl))
  apply((closure ((json . "{\"version\":6,\"action\":\"multi\",\"params\":{\"actions\":[{\"action\":\"addNote\",\"params\":{\"note\":{\"deckName\":\"attestation-2021\",\"modelName\":\"Basic\",\"fields\":{\"Front\":\"<p>\\nTest</p>\\n\",\"Back\":\"<p>\\nlalala</p>\\n\"},\"tags\":\"\",\"options\":{\"allowDuplicate\":false,\"du...") (on-error closure ((actions (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (note-action-pairs (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-tag-actions2) (notes-and-tag-actions) (updates) (adds (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-actions ((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))))) (existing-tags) (promise . #<promise-class promise-class-15912d977270>) (notes #s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32)) cl-struct-org-anki--note-tags t) (the-error) (org-anki--report-error "Couldn't update note, received: %s" the-error)) (on-result closure ((actions (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (note-action-pairs (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-tag-actions2) (notes-and-tag-actions) (updates) (adds (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-actions ((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))))) (existing-tags) (promise . #<promise-class promise-class-15912d977270>) (notes #s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32)) cl-struct-org-anki--note-tags t) (the-result) (let* ((result-list (append the-result nil)) (pairs (-zip-lists note-action-pairs result-list)) (sorted (-sort #'(lambda (a b) (> (org-anki--get-point a) (org-anki--get-point b))) pairs))) (-map 'org-anki--handle-pair sorted))) (body ("action" . "multi") ("params" ("actions" (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))))) t) (&rest --cl-rest--) "\n\n(fn &key DATA &allow-other-keys)" (let* ((data (car (cdr (plist-member --cl-rest-- ':data))))) (let ((the-error (assoc-default 'error data)) (the-result (assoc-default 'result data))) (if the-error (if on-error (funcall on-error the-error) (error "Unhandled error: %s" the-error)) (funcall on-result the-result))))) (:data ((result . [((result) (error . "cannot create note because it is empty"))]) (error)) :symbol-status success :error-thrown nil :response #s(request-response :status-code 200 :history nil :data ((result . [((result) (error . "cannot create note because it is empty"))]) (error)) :error-thrown nil :symbol-status success :url "http://localhost:8765/" :done-p nil :settings (:type "GET" :data "{\"version\":6,\"action\":\"multi\",\"params\":{\"actions\":[{\"action\":\"addNote\",\"params\":{\"note\":{\"deckName\":\"attestation-2021\",\"modelName\":\"Basic\",\"fields\":{\"Front\":\"<p>\\nTest</p>\\n\",\"Back\":\"<p>\\nlalala</p>\\n\"},\"tags\":\"\",\"options\":{\"allowDuplicate\":false,\"du..." :headers (("Content-Type" . "application/json")) :parser json-read :error (closure ((json . "{\"version\":6,\"action\":\"multi\",\"params\":{\"actions\":[{\"action\":\"addNote\",\"params\":{\"note\":{\"deckName\":\"attestation-2021\",\"modelName\":\"Basic\",\"fields\":{\"Front\":\"<p>\\nTest</p>\\n\",\"Back\":\"<p>\\nlalala</p>\\n\"},\"tags\":\"\",\"options\":{\"allowDuplicate\":false,\"du...") (on-error closure ((actions (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (note-action-pairs (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-tag-actions2) (notes-and-tag-actions) (updates) (adds (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-actions ((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))))) (existing-tags) (promise . #<promise-class promise-class-15912d977270>) (notes #s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32)) cl-struct-org-anki--note-tags t) (the-error) (org-anki--report-error "Couldn't update note, received: %s" the-error)) (on-result closure ((actions (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (note-action-pairs (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-tag-actions2) (notes-and-tag-actions) (updates) (adds (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-actions ((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))))) (existing-tags) (promise . #<promise-class promise-class-15912d977270>) (notes #s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32)) cl-struct-org-anki--note-tags t) (the-result) (let* ((result-list (append the-result nil)) (pairs (-zip-lists note-action-pairs result-list)) (sorted (-sort #'(lambda (a b) (> (org-anki--get-point a) (org-anki--get-point b))) pairs))) (-map 'org-anki--handle-pair sorted))) (body ("action" . "multi") ("params" ("actions" (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))))) t) (&rest _args) "\n\n(fn &rest ARGS)" (debug "Error response in variable '_args'")) :success (closure ((json . "{\"version\":6,\"action\":\"multi\",\"params\":{\"actions\":[{\"action\":\"addNote\",\"params\":{\"note\":{\"deckName\":\"attestation-2021\",\"modelName\":\"Basic\",\"fields\":{\"Front\":\"<p>\\nTest</p>\\n\",\"Back\":\"<p>\\nlalala</p>\\n\"},\"tags\":\"\",\"options\":{\"allowDuplicate\":false,\"du...") (on-error closure ((actions (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (note-action-pairs (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-tag-actions2) (notes-and-tag-actions) (updates) (adds (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-actions ((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))))) (existing-tags) (promise . #<promise-class promise-class-15912d977270>) (notes #s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32)) cl-struct-org-anki--note-tags t) (the-error) (org-anki--report-error "Couldn't update note, received: %s" the-error)) (on-result closure ((actions (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (note-action-pairs (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-tag-actions2) (notes-and-tag-actions) (updates) (adds (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-actions ((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))))) (existing-tags) (promise . #<promise-class promise-class-15912d977270>) (notes #s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32)) cl-struct-org-anki--note-tags t) (the-result) (let* ((result-list (append the-result nil)) (pairs (-zip-lists note-action-pairs result-list)) (sorted (-sort #'(lambda (a b) (> (org-anki--get-point a) (org-anki--get-point b))) pairs))) (-map 'org-anki--handle-pair sorted))) (body ("action" . "multi") ("params" ("actions" (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))))) t) (&rest --cl-rest--) "\n\n(fn &key DATA &allow-other-keys)" (let* ((data (car (cdr (plist-member --cl-rest-- ':data))))) (let ((the-error (assoc-default 'error data)) (the-result (assoc-default 'result data))) (if the-error (if on-error (funcall on-error the-error) (error "Unhandled error: %s" the-error)) (funcall on-result the-result))))) :url "http://localhost:8765" :response #10 :encoding utf-8) :-buffer #<killed buffer> :-raw-header "HTTP/1.1 200 OK\nContent-Type: text/json\nAccess-Control-Allow-Origin: http://localhost\nAccess-Control-Allow-Headers: *\nContent-Length: 96\n" :-timer nil :-backend curl)))
  request--callback(#<killed buffer> :type "GET" :data "{\"version\":6,\"action\":\"multi\",\"params\":{\"actions\":[{\"action\":\"addNote\",\"params\":{\"note\":{\"deck..." :headers (("Content-Type" . "application/json")) :parser json-read :error (closure ((json . "{\"version\":6,\"action\":\"multi\",\"params\":{\"actions\":[{\"action\":\"addNote\",\"params\":{\"note\":{\"deck...") (on-error closure ((actions (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (note-action-pairs (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-tag-actions2) (notes-and-tag-actions) (updates) (adds (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-actions ((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))))) (existing-tags) (promise . #<promise-class promise-class-15912d977270>) (notes #s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32)) cl-struct-org-anki--note-tags t) (the-error) (org-anki--report-error "Couldn't update note, received: %s" the-error)) (on-result closure ((actions (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (note-action-pairs (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-tag-actions2) (notes-and-tag-actions) (updates) (adds (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-actions ((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))))) (existing-tags) (promise . #<promise-class promise-class-15912d977270>) (notes #s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32)) cl-struct-org-anki--note-tags t) (the-result) (let* ((result-list (append the-result nil)) (pairs (-zip-lists note-action-pairs result-list)) (sorted (-sort #'(lambda (a b) (> (org-anki--get-point a) (org-anki--get-point b))) pairs))) (-map 'org-anki--handle-pair sorted))) (body ("action" . "multi") ("params" ("actions" (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))))) t) (&rest _args) "\n\n(fn &rest ARGS)" (debug "Error response in variable '_args'")) :success (closure ((json . "{\"version\":6,\"action\":\"multi\",\"params\":{\"actions\":[{\"action\":\"addNote\",\"params\":{\"note\":{\"deck...") (on-error closure ((actions (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (note-action-pairs (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-tag-actions2) (notes-and-tag-actions) (updates) (adds (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-actions ((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))))) (existing-tags) (promise . #<promise-class promise-class-15912d977270>) (notes #s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32)) cl-struct-org-anki--note-tags t) (the-error) (org-anki--report-error "Couldn't update note, received: %s" the-error)) (on-result closure ((actions (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (note-action-pairs (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-tag-actions2) (notes-and-tag-actions) (updates) (adds (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-actions ((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))))) (existing-tags) (promise . #<promise-class promise-class-15912d977270>) (notes #s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32)) cl-struct-org-anki--note-tags t) (the-result) (let* ((result-list (append the-result nil)) (pairs (-zip-lists note-action-pairs result-list)) (sorted (-sort #'(lambda (a b) (> (org-anki--get-point a) (org-anki--get-point b))) pairs))) (-map 'org-anki--handle-pair sorted))) (body ("action" . "multi") ("params" ("actions" (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))))) t) (&rest --cl-rest--) "\n\n(fn &key DATA &allow-other-keys)" (let* ((data (car (cdr (plist-member --cl-rest-- ':data))))) (let ((the-error (assoc-default 'error data)) (the-result (assoc-default 'result data))) (if the-error (if on-error (funcall on-error the-error) (error "Unhandled error: %s" the-error)) (funcall on-result the-result))))) :url "http://localhost:8765" :response #s(request-response :status-code 200 :history nil :data ((result . [((result) (error . "cannot create note because it is empty"))]) (error)) :error-thrown nil :symbol-status success :url "http://localhost:8765/" :done-p nil :settings (:type "GET" :data "{\"version\":6,\"action\":\"multi\",\"params\":{\"actions\":[{\"action\":\"addNote\",\"params\":{\"note\":{\"deck..." :headers (("Content-Type" . "application/json")) :parser json-read :error (closure ((json . "{\"version\":6,\"action\":\"multi\",\"params\":{\"actions\":[{\"action\":\"addNote\",\"params\":{\"note\":{\"deck...") (on-error closure ((actions (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (note-action-pairs (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-tag-actions2) (notes-and-tag-actions) (updates) (adds (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-actions ((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))))) (existing-tags) (promise . #<promise-class promise-class-15912d977270>) (notes #s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32)) cl-struct-org-anki--note-tags t) (the-error) (org-anki--report-error "Couldn't update note, received: %s" the-error)) (on-result closure ((actions (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (note-action-pairs (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-tag-actions2) (notes-and-tag-actions) (updates) (adds (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-actions ((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))))) (existing-tags) (promise . #<promise-class promise-class-15912d977270>) (notes #s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32)) cl-struct-org-anki--note-tags t) (the-result) (let* ((result-list (append the-result nil)) (pairs (-zip-lists note-action-pairs result-list)) (sorted (-sort #'(lambda (a b) (> (org-anki--get-point a) (org-anki--get-point b))) pairs))) (-map 'org-anki--handle-pair sorted))) (body ("action" . "multi") ("params" ("actions" (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))))) t) (&rest _args) "\n\n(fn &rest ARGS)" (debug "Error response in variable '_args'")) :success (closure ((json . "{\"version\":6,\"action\":\"multi\",\"params\":{\"actions\":[{\"action\":\"addNote\",\"params\":{\"note\":{\"deck...") (on-error closure ((actions (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (note-action-pairs (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-tag-actions2) (notes-and-tag-actions) (updates) (adds (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-actions ((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))))) (existing-tags) (promise . #<promise-class promise-class-15912d977270>) (notes #s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32)) cl-struct-org-anki--note-tags t) (the-error) (org-anki--report-error "Couldn't update note, received: %s" the-error)) (on-result closure ((actions (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (note-action-pairs (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-tag-actions2) (notes-and-tag-actions) (updates) (adds (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-actions ((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))))) (existing-tags) (promise . #<promise-class promise-class-15912d977270>) (notes #s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32)) cl-struct-org-anki--note-tags t) (the-result) (let* ((result-list (append the-result nil)) (pairs (-zip-lists note-action-pairs result-list)) (sorted (-sort #'(lambda (a b) (> (org-anki--get-point a) (org-anki--get-point b))) pairs))) (-map 'org-anki--handle-pair sorted))) (body ("action" . "multi") ("params" ("actions" (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))))) t) (&rest --cl-rest--) "\n\n(fn &key DATA &allow-other-keys)" (let* ((data (car (cdr (plist-member --cl-rest-- ':data))))) (let ((the-error (assoc-default 'error data)) (the-result (assoc-default 'result data))) (if the-error (if on-error (funcall on-error the-error) (error "Unhandled error: %s" the-error)) (funcall on-result the-result))))) :url "http://localhost:8765" :response #17 :encoding utf-8) :-buffer #<killed buffer> :-raw-header "HTTP/1.1 200 OK\nContent-Type: text/json\nAccess-Control-Allow-Origin: http://localhost\nAccess-C..." :-timer nil :-backend curl) :encoding utf-8)
  apply(request--callback #<killed buffer> (:type "GET" :data "{\"version\":6,\"action\":\"multi\",\"params\":{\"actions\":[{\"action\":\"addNote\",\"params\":{\"note\":{\"deckName\":\"attestation-2021\",\"modelName\":\"Basic\",\"fields\":{\"..." :headers (("Content-Type" . "application/json")) :parser json-read :error (closure ((json . "{\"version\":6,\"action\":\"multi\",\"params\":{\"actions\":[{\"action\":\"addNote\",\"params\":{\"note\":{\"deckName\":\"attestation-2021\",\"modelName\":\"Basic\",\"fields\":{\"...") (on-error closure ((actions (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (note-action-pairs (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-tag-actions2) (notes-and-tag-actions) (updates) (adds (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-actions ((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))))) (existing-tags) (promise . #<promise-class promise-class-15912d977270>) (notes #s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32)) cl-struct-org-anki--note-tags t) (the-error) (org-anki--report-error "Couldn't update note, received: %s" the-error)) (on-result closure ((actions (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (note-action-pairs (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-tag-actions2) (notes-and-tag-actions) (updates) (adds (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-actions ((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))))) (existing-tags) (promise . #<promise-class promise-class-15912d977270>) (notes #s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32)) cl-struct-org-anki--note-tags t) (the-result) (let* ((result-list (append the-result nil)) (pairs (-zip-lists note-action-pairs result-list)) (sorted (-sort #'(lambda (a b) (> (org-anki--get-point a) (org-anki--get-point b))) pairs))) (-map 'org-anki--handle-pair sorted))) (body ("action" . "multi") ("params" ("actions" (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))))) t) (&rest _args) "\n\n(fn &rest ARGS)" (debug "Error response in variable '_args'")) :success (closure ((json . "{\"version\":6,\"action\":\"multi\",\"params\":{\"actions\":[{\"action\":\"addNote\",\"params\":{\"note\":{\"deckName\":\"attestation-2021\",\"modelName\":\"Basic\",\"fields\":{\"...") (on-error closure ((actions (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (note-action-pairs (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-tag-actions2) (notes-and-tag-actions) (updates) (adds (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-actions ((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))))) (existing-tags) (promise . #<promise-class promise-class-15912d977270>) (notes #s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32)) cl-struct-org-anki--note-tags t) (the-error) (org-anki--report-error "Couldn't update note, received: %s" the-error)) (on-result closure ((actions (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (note-action-pairs (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-tag-actions2) (notes-and-tag-actions) (updates) (adds (#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))) (notes-and-actions ((#s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32) ("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck"))))))) (existing-tags) (promise . #<promise-class promise-class-15912d977270>) (notes #s(org-anki--note :maybe-id nil :front "<p>\nTest</p>\n" :back "<p>\nlalala</p>\n" :tags nil :deck "attestation-2021" :point 32)) cl-struct-org-anki--note-tags t) (the-result) (let* ((result-list (append the-result nil)) (pairs (-zip-lists note-action-pairs result-list)) (sorted (-sort #'(lambda (a b) (> (org-anki--get-point a) (org-anki--get-point b))) pairs))) (-map 'org-anki--handle-pair sorted))) (body ("action" . "multi") ("params" ("actions" (("action" . "addNote") ("params" ("note" ("deckName" . "attestation-2021") ("modelName" . "Basic") ("fields" ("Front" . "<p>\nTest</p>\n") ("Back" . "<p>\nlalala</p>\n")) ("tags" . "") ("options" ("allowDuplicate" . :json-false) ("duplicateScope" . "deck")))))))) t) (&rest --cl-rest--) "\n\n(fn &key DATA &allow-other-keys)" (let* ((data (car (cdr (plist-member --cl-rest-- ':data))))) (let ((the-error (assoc-default 'error data)) (the-result (assoc-default 'result data))) (if the-error (if on-error (funcall on-error the-error) (error "Unhandled error: %s" the-error)) (funcall on-result the-result))))) :url "http://localhost:8765" :response #s(request-response :status-code 200 :history nil :data ((result . [((result) (error . "cannot create note because it is empty"))]) (error)) :error-thrown nil :symbol-status success :url "http://localhost:8765/" :done-p nil :settings #3 :-buffer #<killed buffer> :-raw-header "HTTP/1.1 200 OK\nContent-Type: text/json\nAccess-Control-Allow-Origin: http://localhost\nAccess-Control-Allow-Headers: *\nContent-Length: 96\n" :-timer nil :-backend curl) :encoding utf-8))
  request--curl-callback("http://localhost:8765" #<process request curl> "finished\n")
  apply(request--curl-callback ("http://localhost:8765" #<process request curl> "finished\n"))
  #f(compiled-function (&rest args2) #<bytecode 0xb6dd103294c196f>)(#<process request curl> "finished\n")

Allow duplicates

Looks like we hardcode allowDuplicate to false. It would be useful to make this configurable so we can set it to true.

Add configurable "end tag" to delimit entry content that gets set as card back

* Card front

Card back

--

Random text continues

In the previous org entry set title as card front, and everything up to the double-dash as card-back, leaving the rest alone. This allows to have org entries with long content without having all of it as card back. Otherwise one would need to create ad hoc subheading for anki.

Can images be included in content?

Can images be included in content? As follow:

  • Test
    :PROPERTIES:
    :ANKI_NOTE_ID: 1690354020562
    :END:
    [[./img.png]]
    Photos are not displayed in anki.

Support subheadings as content for Back of a card

Hi,

Thanks for this nice package!

I noticed that currently it doesn't support to include subheadings as content for Back. For example, Back content for test only contains "aaa", without content of the sub subheading:

** test
aaa
*** sub
bbb

Do you think it's a good idea to support this? Thanks.

add custom variable for org-export-string-as

Hello,

I made some other adjustments to your package, to allow displaying org-babel blocks wrapped around some additional html markup. Would you consider a pull request?

We can add a defcustom and patch in your --org-to-html.

(defcustom org-anki-html-export-backend 'html
  "Backend used for transcoding HTML. See org-export-string-as for
more information"
  :type '(function)
  :group 'org-anki)

(defun org-anki--org-to-html (string)
  "Convert STRING (org element heading or content) to html."
  (save-excursion
    (org-anki--string-to-anki-mathjax
     (org-export-string-as string org-anki-html-export-backend t '(:with-toc nil)))))

This is the end result:
image

This is the source from emacs:
image

org-anki can't make `ANKI_NOTE_ID` property correctly with `with-current-buffer`

  • Emacs version: 28.2
  • org version: Org mode version 9.6 (9.6-??-bed47b437)
  • org-anki version: 1.0.4 and latest (1.0.5)

test.org

#+ANKI_DECK: TestDeck
org-anki Batch Test

* Front
Back

Test code

(with-current-buffer (find-file-noselect "~/test.org")
  (org-mode)
  (save-excursion
    (goto-char (point-max))
    (org-anki-sync-entry))
  (save-buffer))

The code makes an anki card but can't make ANKI_NOTE_ID property at the heading. Emacs shows the org-fold-region: Calling ‘org-fold-core-region’ with missing SPEC error. And :PROPERTY:\n:END: is printed in the beginning of scratch buffer. I'm not sure. But My guess is that the message is that org seems to try parsing Users' current buffer which is scratch-buffer.

Still depends on archived ox-slimhtml

org-anki still depends on ox-slimhtml whose repository has been archived with this comment:

slimhtml is now part of Org, included in GNU Emacs, future bug reports or contributions should be sent to Org directly.

I am not sure what that means. No file named ox-slimhtml.el appeared inside the Org or Emacs repositories, so I am guessing it means the functionality that ox-slimhtml.el used to provide has now been integrated into the ox-html.el that is part of Org. If that is so, then you should stop requiring ox-slimhtml and make other adjustments.

@balddotcat could you please provide some clarification. Preferably here and at the top of the readme file.

Basic+Reversed cards

Hey, what about supporting basic+reversed cards? I like your approach of adding the less possible metadata to org nodes, since that way my notes are the same than my cards. basic+reversed only requires an extra boolean annotation, but no special headings.

Can't update card. ID has type str

Hi!

Thanks for org-anki, it has allowed to use all the power of emacs to edit ANY org file (unlike anki-editor) & send it to Anki.

But I tend to refine/edit my cards while using them so I've tried to update them to no avail. I get this message:

"org-anki error: Couldn’t update note, received: '1628261282716' has type str, but expected one of: int, long"

Is there a way to edit already created cards & not just create them?

Thanks!

Unused lexical variables

There are some compiler warnings:

In org-anki--string-to-anki-mathjax:
org-anki.el:183:10: Warning: Unused lexical variable ‘matched’

In org-anki--handle-pair:
org-anki.el:447:33: Warning: Unused lexical variable ‘&rest’

In org-anki--sync-notes:
org-anki.el:547:21: Warning: ‘message’ called with 1 args to fill 0 format field(s)
org-anki.el:550:30: Warning: Unused lexical argument ‘the-result’

In org-anki-browse-entry:
org-anki.el:677:17: Warning: Unused lexical argument ‘the-result’

In org-anki-import-deck:
org-anki.el:760:45: Warning: Unused lexical argument ‘buffer’

Maybe we need to add an underscore before these arguments or somether else?

implement fake decorators to refer to Anki fields

At the moment, we are able to refer to the Anki fields as nested org headings. But this approach ends up creating individual cards when you do a sync all. This could be desired for some use cases however. Perhaps, it would be more standard to use org-headings, when we want cards and use fake decorators when we want to refer to anki fields. It could provide a more predictable implementation.

Given that we have a new note defined in Anki, such as:

(use-package! org-anki
   :config
   (add-to-list 'org-anki-model-fields '("Typewriter" "Front" "Back", "Explain")))

image

--

But Why?

I understand this may seem unnecessary, but the issue I ran into was with Anki's {{FrontSide}} field, which is used with the {{type:Back}}. It allows you to do something like this:

image

If I had a note such as this:

image

Then the answer would look like this:

image

But, it would be preferable to have it look like this:

image

It could also be helpful to come up with a few additional conditions inside the --get-fields function, so we don't need to populate full structures like you would do with anki-editor. It is also possible this could be unnecessary. I was able to wrap the sync-all function as Ken did in his #66, for my use case to only sync a specific level of headings.

Add an `org-anki-update-all` command

As mentioned in #24 (comment), it could be useful to have an org-anki-update-all command that only updated existing notes without adding new ones. This would allow users to selectively sync notes instead of syncing everything in a file.

Support for multiple lines in card front

Is it possible to have the front of the card contain multiple lines?

Since the front is generated from the header, this seems to be limited to one line only. Is multi-line support for the front something that's been thought about before?
I saw that this was briefly touched upon in issue 32.

Not sure how this could best be implemented syntax-wise. Something like what anki-editor does might make the tree a lot messier.
Maybe using a block or a drawer for the extra lines? For example:

* front - first line
  #+BEGIN_FRONT
  front - second line
  more front
  #+END_FRONT
  back content

Emacs 28 get error (wrong-number-of-arguments (3 . 4) 2)

I have upgrade my emacs to 28, when i run "org-anki-*', it's broken. error message:

Debugger entered--Lisp error: (wrong-number-of-arguments (3 . 4) 2) #f(compiled-function (obsolete-name current-name when &optional docstring) "Set OBSOLETE-NAME's function definition to CURRENT-NAME and mark it obsolete.\n\n(define-obsolete-function-alias \\='old-fun \\='new-fun \"28.1\" \"old-fun's doc.\")\n\nis equivalent to the following two lines of code:\n\n(defalias \\='old-fun \\='new-fun \"old-fun's doc.\")\n(make-obsolete \\='old-fun \\='new-fun \"28.1\")\n\nWHEN should be a string indicating when the function was first\nmade obsolete, for example a date or a release number.\n\nSee the docstrings of defalias' and make-obsolete' for more details." #<bytecode 0x155f9ad256226c95>)('promise:make-process-with-buffer-string 'promise:make-process-send-buffer) (define-obsolete-function-alias 'promise:make-process-with-buffer-string 'promise:make-process-send-buffer) #<subr eval-buffer>(#<buffer *load*-40468> nil "/Users/tomyli/.emacs.d/elpa/promise-1.1/promise.el" nil t) apply(#<subr eval-buffer> (#<buffer *load*-40468> nil "/Users/tomyli/.emacs.d/elpa/promise-1.1/promise.el" nil t)) eval-buffer(#<buffer *load*-40468> nil "/Users/tomyli/.emacs.d/elpa/promise-1.1/promise.el" nil t) ; Reading at buffer position 9061 load-with-code-conversion("/Users/tomyli/.emacs.d/elpa/promise-1.1/promise.el" "/Users/tomyli/.emacs.d/elpa/promise-1.1/promise.el" nil t) require(promise) #<subr eval-buffer>(#<buffer *load*> nil "/Users/tomyli/.emacs.d/elpa/org-anki-1.0.5/org-ank..." nil t) apply(#<subr eval-buffer> (#<buffer *load*> nil "/Users/tomyli/.emacs.d/elpa/org-anki-1.0.5/org-ank..." nil t)) eval-buffer(#<buffer *load*> nil "/Users/tomyli/.emacs.d/elpa/org-anki-1.0.5/org-ank..." nil t) ; Reading at buffer position 1287 load-with-code-conversion("/Users/tomyli/.emacs.d/elpa/org-anki-1.0.5/org-ank..." "/Users/tomyli/.emacs.d/elpa/org-anki-1.0.5/org-ank..." nil t) #<subr autoload-do-load>((autoload "org-anki" "Syncronize all entries in optional BUFFER.\n\n(fn &o..." t nil) org-anki-sync-all nil) apply(#<subr autoload-do-load> ((autoload "org-anki" "Syncronize all entries in optional BUFFER.\n\n(fn &o..." t nil) org-anki-sync-all nil)) autoload-do-load((autoload "org-anki" "Syncronize all entries in optional BUFFER.\n\n(fn &o..." t nil) org-anki-sync-all nil) command-execute(org-anki-sync-all record) counsel-M-x-action("org-anki-sync-all") ivy-call() #<subr ivy-read>("M-x " ("org-anki-sync-all" "org-anki-sync-entry" "toggle-debug-on-error" "org-id-get-create" "deadgrep" "org-mime-org-subtree-htmlize" "menu-set-font" "restart-emacs" "text-scale-adjust" "describe-font" "lsp-bridge-popup-complete" "lsp-bridge-mode" "org-roam-db-sync" "package-quickstart-refresh" "yt-set-time" "package-install" "text-scale-decrease" "lsp-bridge-ref-popup" "lsp-bridge-code-action" "blink-search" "org-babel-tangle" "yas-insert-snippet" "global-lsp-bridge-mode" "org-roam-buffer-toggle" "tomyli/new-daily-review" "lsp-bridge-popup-complete-menu" "ox-hugo" "flush-lines" "delete-frame" "erase-buffer" "org-add-note" "company-ctags" "company-gtags" "counsel-fonts" "org-clock-goto" "org-roam-buffer" "lsp-bridge-rename" "counsel-gtags-dwim" "link-hint-copy-link" "cfw:open-org-calendar" "color-rg-search-input" "lsp-bridge-code-format" "lsp-bridge-ref-open-file" "my/org-add-ids-to-headlines-in-file" "cd" "wc" "5x5" "amx" "arp" "dbx" ...) :predicate counsel--M-x-externs-predicate :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (11 . kill-line) (27 keymap (121 . paste-from-x-clipboard)) (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x) ivy-posframe--read(#<subr ivy-read> "M-x " ("org-anki-sync-all" "org-anki-sync-entry" "toggle-debug-on-error" "org-id-get-create" "deadgrep" "org-mime-org-subtree-htmlize" "menu-set-font" "restart-emacs" "text-scale-adjust" "describe-font" "lsp-bridge-popup-complete" "lsp-bridge-mode" "org-roam-db-sync" "package-quickstart-refresh" "yt-set-time" "package-install" "text-scale-decrease" "lsp-bridge-ref-popup" "lsp-bridge-code-action" "blink-search" "org-babel-tangle" "yas-insert-snippet" "global-lsp-bridge-mode" "org-roam-buffer-toggle" "tomyli/new-daily-review" "lsp-bridge-popup-complete-menu" "ox-hugo" "flush-lines" "delete-frame" "erase-buffer" "org-add-note" "company-ctags" "company-gtags" "counsel-fonts" "org-clock-goto" "org-roam-buffer" "lsp-bridge-rename" "counsel-gtags-dwim" "link-hint-copy-link" "cfw:open-org-calendar" "color-rg-search-input" "lsp-bridge-code-format" "lsp-bridge-ref-open-file" "my/org-add-ids-to-headlines-in-file" "cd" "wc" "5x5" "amx" "arp" "dbx" ...) :predicate counsel--M-x-externs-predicate :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (11 . kill-line) (27 keymap (121 . paste-from-x-clipboard)) (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x) apply(ivy-posframe--read #<subr ivy-read> ("M-x " ("org-anki-sync-all" "org-anki-sync-entry" "toggle-debug-on-error" "org-id-get-create" "deadgrep" "org-mime-org-subtree-htmlize" "menu-set-font" "restart-emacs" "text-scale-adjust" "describe-font" "lsp-bridge-popup-complete" "lsp-bridge-mode" "org-roam-db-sync" "package-quickstart-refresh" "yt-set-time" "package-install" "text-scale-decrease" "lsp-bridge-ref-popup" "lsp-bridge-code-action" "blink-search" "org-babel-tangle" "yas-insert-snippet" "global-lsp-bridge-mode" "org-roam-buffer-toggle" "tomyli/new-daily-review" "lsp-bridge-popup-complete-menu" "ox-hugo" "flush-lines" "delete-frame" "erase-buffer" "org-add-note" "company-ctags" "company-gtags" "counsel-fonts" "org-clock-goto" "org-roam-buffer" "lsp-bridge-rename" "counsel-gtags-dwim" "link-hint-copy-link" "cfw:open-org-calendar" "color-rg-search-input" "lsp-bridge-code-format" "lsp-bridge-ref-open-file" "my/org-add-ids-to-headlines-in-file" "cd" "wc" "5x5" "amx" "arp" "dbx" ...) :predicate counsel--M-x-externs-predicate :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (11 . kill-line) (27 keymap (121 . paste-from-x-clipboard)) (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)) ivy-read("M-x " ("org-anki-sync-all" "org-anki-sync-entry" "toggle-debug-on-error" "org-id-get-create" "deadgrep" "org-mime-org-subtree-htmlize" "menu-set-font" "restart-emacs" "text-scale-adjust" "describe-font" "lsp-bridge-popup-complete" "lsp-bridge-mode" "org-roam-db-sync" "package-quickstart-refresh" "yt-set-time" "package-install" "text-scale-decrease" "lsp-bridge-ref-popup" "lsp-bridge-code-action" "blink-search" "org-babel-tangle" "yas-insert-snippet" "global-lsp-bridge-mode" "org-roam-buffer-toggle" "tomyli/new-daily-review" "lsp-bridge-popup-complete-menu" "ox-hugo" "flush-lines" "delete-frame" "erase-buffer" "org-add-note" "company-ctags" "company-gtags" "counsel-fonts" "org-clock-goto" "org-roam-buffer" "lsp-bridge-rename" "counsel-gtags-dwim" "link-hint-copy-link" "cfw:open-org-calendar" "color-rg-search-input" "lsp-bridge-code-format" "lsp-bridge-ref-open-file" "my/org-add-ids-to-headlines-in-file" "cd" "wc" "5x5" "amx" "arp" "dbx" ...) :predicate counsel--M-x-externs-predicate :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (11 . kill-line) (27 keymap (121 . paste-from-x-clipboard)) (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x) counsel-M-x() funcall-interactively(counsel-M-x) command-execute(counsel-M-x)

Looks like it's another package named promise issue. How to solve this?

Wrong type argument: proper-list-p, ("fields required" . fields)

the following code in the function org-anki--get-fields:

(t (org-anki--report-error
           "org-anki--get-fields: %s"
           ,("fields required" . fields)
           ,("fields found" . found-fields)))

will cause a compiler error, and it seems that org-anki--report-error only accepts two arguments but there are three.

How to export sub-headlines?

Hi
I love your idea, it is perfect to study org-mode notes and it works with no problems. Thanks

How could I export a collection of exams?
I have added this to my .init file, but it doesn't seem to work:

(customize-set-variable 'org-anki-default-match "tree")
(customize-set-variable 'org-anki-match "tree")
  • Exams
    ** Question 1
    Answer 1
    ** Question 2
    Answer 2
    ** ...
    ...

Is there a way to copy the included picture to anki?

Sometimes, we hope to synchronize some org-mode entries which have included a picture. For example:

[[XXX.png]]

And we hope this picture could copy to the anki media folder and after =org-anki-sync-entry= is executed, we could see this picture in Anki. Is there any way to do this ?

Weird issue with org-anki-sync-entry

When I try to use org-anki-sync-entry, I get the following message:

error in process filter: Calling 'org-fold-core-region' with missing SPEC

It looks like the process might be trying to write text on buffers that are not the org-mode notebook that I have open?

Support the "Extra" field for Cloze cards

The default Cloze have an "Extra" field that is usually used to provide some additional information when viewing the answer. Can we support this using the content of the org entry?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.