Open gab-dev opened 1 month ago
Thanks for the detailed bug report!
The whitespace in front of properties should be ignored so what you're seeing is not the intended behavior. I can replicate the bug but I'm not yet sure what causes it.
This should be fixed with the most recent commit (org-fc version 0.6.2).
The AWK parser already allows properties whitespace in front but the added filter for finding org files with flashcards in them did not allow this whitespace.
Just tested and it works. Thanks.
I've noticed another thing though. I'm trying to put some fc inside my config file in .emacs.d so I added it in org-fc-directories, but there is no way to make it works. I have something like this:
(setq org-fc-directories '("~/org/" "~/.emacs.d")
I've also tried just "/.emacs.d". Nothing.
I think this is also due to how org-fc filters files. Initially I wanted to filter out files whose name starts with a "." but this seems to also filter out directories like .emacs.d
.
In some cases, this behavior is desirable, e.g. to avoid searching .git
directories with many files in them.
Unfortunately, there is currently no easy way of customizing the find
command org-fc uses
(except overwriting the function yourself) and we'll need to be careful when changing the default command
to avoid making it less performant in other use cases.
From a quick test, the following replacement finds cards in my .emacs.d
directory:
(defun org-fc-awk--find (paths)
"Generate shell code to search PATHS for org files.
Matches all .org files ignoring ones with names don't start with
a `.' to exclude temporary / backup files.
With the `-L' option, `find' follows symlinks."
(format
"find -L %s -name \"[^.]*.org\" -type f -exec grep -l --null \"^[ \\t]*:%s:\" {} \\+"
(mapconcat
(lambda (path) (shell-quote-argument (expand-file-name path)))
paths " ")
org-fc-created-property))
I've updated org-fc to the last version but I'm not able to view any cards.
I've noticed this kind of behavior after the tag v0.6.0.
I've reduced my setup to the bare minimum to isolate the problem.
If I try to add a new card, this is what I get![image](https://github.com/l3kn/org-fc/assets/40800750/cb2fb329-5e01-4682-9b53-5b67709b6630)
However if I try to review the cards in the buffer, nothing shows up.![image](https://github.com/l3kn/org-fc/assets/40800750/ee069ac3-cadb-4545-a768-b2227ff91d78)
If I remove the indentation from the properties, it seems to work.![image](https://github.com/l3kn/org-fc/assets/40800750/e984e672-58b9-494d-8933-65c600aefcdb)
Is this the intended behaviour?