~kindablue


#23 Native compilation errors 1 year, 10 months ago

Comment by ~kindablue on ~l3kn/org-fc

I have just tested it and I too am not seeing any significant errors when compiling. Only some surrounding obsolete functions with Org 9.4, but the functionality seems to be okay.

#9 Cached Card Index 2 years ago

Comment by ~kindablue on ~l3kn/org-fc

I have started using the cache mode and began getting the error org-fc-review-next-card: Symbol’s value as variable is void: cur.

I think it is because the macro org-fc-review-with-current-item expects the current card to be setup/session to be setup in order to read from the org-fc--session variable. However, the function org-fc-cache-coherence-check is added to the org-fc-before-setup-hook upon activation of org-fc-cache-mode.

Would there be any significant affect if that is changed to org-fc-after-setup-hook?

(defun org-fc-cache-coherence-check ()
  "Check if the entry at point is coherent with its cache representation.
This is especially relevant w.r.t a card's due date / suspension state before review."
  (org-fc-review-with-current-item cur
    (if (org-fc-suspended-entry-p)
        (error "Trying to review a suspended card"))
    (let* ((position (plist-get cur :position))
           (review-data (org-fc-get-review-data))
           (row (assoc position review-data #'string=))
           (due (parse-iso8601-time-string (nth 4 row))))
      (unless (time-less-p due (current-time))
        (error "Trying to review a non-due card")))))

#28 Performance Issues 2 years ago

Comment by ~kindablue on ~l3kn/org-fc

Leon Rische outgoing@sr.ht writes:

Indexing the directory mentioned in the docs still takes ~600ms, for your set of files it takes around 1.5s.

I'm glad it wasn't just me but that is unfortunate.

There might be some room for optimization in index.awk, beyond that we'd need to write an optimized indexer in a faster language.

Caching would also help but if you are using few files with lots of flashcards, most of them will be invalidated during each review.

Is the better strategy to have multiple smaller files? Is there any possibility to cache headlines instead of files?

How long does it take set up a card in one of those large files for review? I've had to disable some of the org fontification to make reviewing large files reasonably fast.

Reviewing the cards isn't terrible actually. The initial setup is a slog, but flipping through cards is okay.

Btw, did you automatically create those flashcards? I've written some code to convert the "Petit Robert" french dictionary into a format usable with org-fc but I've not found a way to get audio files for the cards yet.

They are decks from Anki. There's a plugin (https://github.com/Stvad/CrowdAnki) that exports the media into a folder as well as a json output that I initially tried to parse to create the files. However that proved to be too complicated. So I ended up using a python script (https://0x0.st/inwf.py) and importing the 'Notes in Plain Text'. It's not too bad.

In case you didn't know, if the "front" of the card is in the heading, you don't need a "Back" heading, the text under the main heading will be used as the back side of the card.

Ah, I think the "back" heading was a leftover from a previous import. Thanks for the heads up.

-- Trey Peacock

#27 Excluded Directories and/or Depth 2 years ago

Comment by ~kindablue on ~l3kn/org-fc

Leon Rische outgoing@sr.ht writes:

Org-fc uses find to get a list of files in the org-fc-directories,

instead of just passing a list of strings to the indexing function, we could allow something like (:path "~/org/" :maxdepth 1) that limits

the recursion depth but from the find manpage it seems like the

maxdepth setting is applied to all paths.

Yeah, I was thinking this but it would result in needing find multiple times. I'm not sure it's with it..I've settled on using symlinks into the org-fc directory and just using that one.

Seems like there is also a way to exclude directories in find by using -prune or -not -path, this way review contexts could get an optional :exclude property with a list of files that should be excluded.

I have a prototype of a org-fc indexer that stores the indices in (Emacs) memory and uses sha1sum (much faster than processing each file with awk) to determine which files changed but there are still some bugs in it that I haven't figured out.

This would be great! Let me, or the list know if there's anything we can do to help.

On 11/11/20 3:40 PM, ~kindablue wrote:

I currently have my org directory structured something like the below:


~/org/.org (agenda-files) ~/org/bibliography/notes/.org (bibliography notes) ~/org/calendars/*.org (caldav synced calendars)

~/org/etc/org-fc/*.org (french/spanish vocab cards)

~/org/etc/rss/*.org (rss/podcast feeds)


Ideally I would
like to include just the first level of files in `~/org` and the
`~/org/org-fc` directory. Currently org-fc is slowed down by the fact it
 needs to scan the rather large org files in my bibliography. Can there
be an option to exclude directories, or restrict the depth in the org-fc
 directories?


-- Trey Peacock

#28 Performance Issues 2 years ago

Ticket created by ~kindablue on ~l3kn/org-fc

When I restrict my org-fc-directories to 3 files with around 150k total lines split equally, org-fc-awk-index-paths takes around 1.6 seconds to complete. I'm running a Thinkpad 460s with SSD, so I expect it to be slower than your example in the docs; However, this seems to be a bit exaggerated.

File 1 File 2 File 3

#27 Excluded Directories and/or Depth 2 years ago

Ticket created by ~kindablue on ~l3kn/org-fc

I currently have my org directory structured something like the below:

~/org/*.org (agenda-files)
~/org/bibliography/notes/*.org (bibliography notes)
~/org/calendars/*.org (caldav synced calendars)
~/org/etc/org-fc/*.org (french/spanish vocab cards)
~/org/etc/rss/*.org (rss/podcast feeds)

Ideally I would like to include just the first level of files in ~/org and the ~/org/org-fc directory. Currently org-fc is slowed down by the fact it needs to scan the rather large org files in my bibliography. Can there be an option to exclude directories, or restrict the depth in the org-fc directories?

#25 Title of org file not shown when reviewing files in org-roam directory 2 years ago

Comment by ~kindablue on ~l3kn/org-fc

Check if the #+TITLE: property is all caps. The index.awk file does not account for downcase keywords. You can edit the file to the following:

## File Tags

match($0, /^#\+(FILETAGS|filetags):[ \t]+(.*)/, a) {
    # Combine tags to handle multiple FILETAGS lines
    parent_tags[0] = combine_tags(a[2], parent_tags[0]);
    next;
}

## File Title

match($0, /^#\+(TITLE|title):[ \t]+(.*)/, a) {
    # Combine tags to handle multiple FILETAGS lines
    file_title = a[2]
    next;
}

#23 Native compilation errors 2 years ago

Comment by ~kindablue on ~l3kn/org-fc

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256

I've tested more and I also needed to wrap all the calls to org-fc-register-type like below:

(eval-and-compile (org-fc-register-type
                   'cloze
                   'org-fc-type-cloze-setup
                   'org-fc-type-cloze-flip
                   'org-fc-type-cloze-update))

I'd like to check with another who uses native-comp but am unsure how to go about finding them.

-----BEGIN PGP SIGNATURE----- Version: ProtonMail

wsFmBAEBCAAQBQJflKnBCRAh41uws20QlAAKCRAh41uws20QlFhND/9gmnkK iFAnnBwxoOWj4JGwPXV6Of6MiRYrBpyczgsP12kTHz+ara0tbNcJ1MhrBWH2 7R3U5jDoYDMWlpLT4/aCOtrIN69Knq7KU2cvF/U2KPkNKzFt6MMcxUL+0UWH jUkCyVakpwOwWWruws6+FM7zwuRPOCmoToJ8Z0mKfLOZx4Ak7gxz+KFbDoWg lRD3ZI7qLlfiqE6qI73C6orNURLtgKYA5qOql6u0qQozQAhq7XRiZ8akSKWk O2FBhCUhA+2h+N3apzV/F46zo93Pc0Vt0M+yB95f4Q5StKSOL51jEJ82r3vA /Fahihl28QNCtVDDc4WP2+nTBQcj1GKK9WJyJxUzigTFA9ddeHwqTC3kVF2a /MuIu+NMpvEQP93d64o02TqP2uNShPor18Plw0ESlIP813qJLRzpmnaklyAR 9yYeM1hRF5FWM05XzVqGQgTsfF9gGJG23f0zHF8/pe9hPXfEbGkjTJgeHkT5 PKwVJHnTKekp9igJpRxO3fOufgNMsKPo1Ofx3+ynH7Nc1brzhZDLgKP27HJ/ F77hNGKsGSgdY/DWQECttoXI6bCuW4mlXNXULPmxQkkYncGWV1Bh1aUnHgDf 5A1UDT/ln2k2UmaHyZ2Yln63sXUWZBsZMsO2JScWFq6LOepWqjV7dna1pMlZ BLBWUzQi9X3FHCqkMg== =cEdb -----END PGP SIGNATURE-----

#23 Native compilation errors 2 years ago

Ticket created by ~kindablue on ~l3kn/org-fc

In case anyone using the native-comp branch here is a fix for some errors.

The first of which has to do with the macro org-fc-with-point-at-back-heading when called it throws an invalid function error. This is because the function called in the macro, org-fc-back-heading-position needs a (require 'org) in order to be compiled correctly.

Secondly, in order for org-fc-register-type to be used outside the file it, and the variable org-fc-types need to be wrapped in eval-and-compile.

#14 undefined content-position function 2 years ago

Comment by ~kindablue on ~l3kn/org-fc

It works as expected. Thanks for getting to this.