louietan / anki-editor

Emacs minor mode for making Anki cards with Org
699 stars 87 forks source link

Wrong type argument: integer-or-marker-p, nil (develop branch) #89

Open bitozoid opened 3 years ago

bitozoid commented 3 years ago

I was getting an error until I upgraded anki-editor to https://github.com/leoc/anki-editor/commit/c68beb4439105e1b2ddb10ae7f9b27c2614f1594.

Then, I got a new error imho motivated from commit b2cbf48911556a33809cc4211bfc5f9a89cd797e (develop branch of this repo):

ANKI_FAILURE_REASON: Wrong type argument: integer-or-marker-p, nil

After some debugging, it looks that the new code from b2cbf48911556a33809cc4211bfc5f9a89cd797e (refactor of anki-editor--build-fields) can not handle empty fields.

As a workaround, I have set just a dash (-) as field value, but I think this should be fixed.

bitozoid commented 3 years ago

As a matter of fact, I've realized that I cannot push cards with a "reverse" empty field.

bitozoid commented 3 years ago

As a new workaround, I decided to remove headers of empty fields so I get no error. However, that does not empty the field in Anki, but preserves its current Anki value.

EDIT: [...] However, that does not empty the field in Anki. Indeed, it may set the value of the field to the upper org header.