l3kn / org-fc

Spaced Repetition System for Emacs org-mode
https://www.leonrische.me/fc/index.html
GNU General Public License v3.0
262 stars 31 forks source link

Support symbolic link directories #26

Closed yogsototh closed 4 years ago

yogsototh commented 4 years ago

EDIT 2: this is because my ~/.org is a symbolic link and not a directory. I use a link to use iCloud sync for free. I've proposed a fix in #27

I configured org-fc-directories with "~/.org" instead of "~/.org/". And the org-fc-awk-index-paths returned nil.

A simple quick fix would certainly be to simply add the trailing /. Before that a straightforward solution would be to state directories should contain the trailing / in the README.

Edit this is even more misleading as by default this does not contain this trailing /

(defcustom org-fc-directories '("~/org")
  "Directories to search for flashcards."
  :type 'string
  :group 'org-fc)

The problem comes from the find command:

find ~/.org .... does not return any file, while find ~/.org/ ... returns a list of files.

> find --version
find (GNU findutils) 4.7.0
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Eric B. Decker, James Youngman, and Kevin Dalley.
Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION FTS(FTS_CWDFD) CBO(level=2)
> find ~/.org
/Users/yaesposi/.org

Instead of returning all files in the ~/.org directory.

l3kn commented 4 years ago

I think even with your new -L flag, all directories should have a trailing "/".

I've added these to the readme a few commits ago but missed the one in defcustom