dtk01 / dtk

Read the Bible or other diatheke-accessible material in emacs
GNU General Public License v3.0
24 stars 10 forks source link

Suggesting additional documentation/error output #19

Closed citypilgrim closed 2 years ago

citypilgrim commented 2 years ago

Thanks for the wonderful package.

I was struggling to get it up and running, until I realized that I had not set the SWORD_PATH environment variable. The problem was that the error log just printed dtk-module-category: Wrong type argument: number-or-marker-p, nil.

The correct error log is only printed when evaluating (dtk-diatheke-string '("modulelist") "system")

which gives the following output

"SWMgr: Can't find 'mods.conf' or 'mods.d'.  Try setting:
    SWORD_PATH=<directory containing mods.conf>
    Or see the README file for a full description of setup options (<configPath is null>)
SWMgr: Can't find 'mods.conf' or 'mods.d'.  Try setting:
    SWORD_PATH=<directory containing mods.conf>
    Or see the README file for a full description of setup options (<configPath is null>)
Biblical Texts:
Commentaries:
Lexicons / Dictionaries:
Daily Devotional:
Generic Books:
"

Perhaps there could be a way to check the environment variable SWORD_PATH is set correctly first?

thomp commented 2 years ago

Seems like one way to go would be to, when first run, to check the output of (dtk-diatheke-string '("modulelist") "system") and look for lack of installed content in each of the categories -- i.e.,

Biblical Texts:
Commentaries:
Lexicons / Dictionaries:
Daily Devotional:
Generic Books:

If all of the categories appear empty, a warning to check the full output from (dtk-diatheke-string '("modulelist") "system") would then be provided to the end-user.

thomp commented 2 years ago

I've created a branch for addressing this issue:

https://github.com/dtk01/dtk/tree/issue-9-checking-modulelist-output

The only current modification is a check for suspicious-looking lines in the modulelist output. Would this have been helpful?

I'm not sure what the best approach would be for checking SWORD_PATH. For example, I don't believe it is set on Linux systems. Perhaps a check on system-type and then a call to getenv to check the value?

thomp commented 2 years ago

Closing as this is at least partially addressed by https://github.com/dtk01/dtk/commit/c6e14065ca09709db7299189970c044049e2c4b2