Closed Randy1Burrell closed 1 year ago
Thank you -- the README has been neglected. dtk-default-module
and dtk-default-module-category
are no longer used.
If you set dtk-module-category
and dtk-module
, does the situation improve when you invoke dtk
?
Example:
M-x ielm and then
(setq dtk-module-category "Biblical Texts")
(setq dtk-module "KJV")
and then try M-x dtk.
No that doesn't to work either. Here are the documentation for the variables when I run C-h v
dtk-module’s value is "KJV"
Documentation:
Not documented as a variable.
dtk-module-category’s value is "Biblical Text"
Documentation:
Not documented as a variable.
Something has definitely gone awry. The Help buffer content should indicate where the variable is defined and should show the docstring for each variable. For example, the text for dtk-module
should end with
…
Documentation:
Module currently in use.
I recognize that the "Content is not installed" messages suggest that dtk.el
was loaded. However, the lack of docstrings for the variables suggest that dtk.el
was not loaded. Would you be willing to reload dtk.el
? (open the dtk.el file; then M-x load-file). What is the C-h v output for the variables once dtk.el
is loaded?
It seems something did go awry so I restarted emacs and I am still having the same problems. I'm using the use-package plugin so that have loaded the file for me. Here's new configuration and the current output when I run the C-h v
.
(use-package dtk
:bind (("C-c B" . dtk-bible))
:init
(setq dtk-module "KJV")
(setq dtk-module-category "Biblical Text")
(setq dtk-word-wrap t))
dtk-module is a variable defined in ‘dtk.el’.
Its value is "KJV"
Original value was nil
You can customize this variable.
Documentation:
Module currently in use.
[forward]
dtk-module-category is a variable defined in ‘dtk.el’.
Its value is "Biblical Text"
Original value was nil
You can customize this variable.
Documentation:
Module category last selected by the user.
[back]
I don't believe "Biblical Text" is used by diatheke. Try
(setq dtk-module-category "Biblical Texts")
(note the plural)(dtk-biblical-texts)
What is the output when dtk-biblical-texts
is executed? It should be a list of string specifying the various texts available, e.g.
> (dtk-biblical-texts)
("ESV2001" "ESV2011" "KJV" "SpaRV" "WEB" "YLT")
Changing dtk-module-category
to "Biblical Texts" does not make a difference. Invoking dtk-biblical-texts
outputs nil.
Makes me wonder if there is some quirk with MacOS and either executing diatheke or with diatheke output. Would you be willing to try out (dtk-diatheke-string "John 3:16" "KJV")
and post the output?
Sure
Invoking dtk-diatheke
should signal an error if the diatheke executable is not found. Since this isn't occurring, let's continue to check possibilities:
dtk-program
is set to "diatheke"call-process
output is what we expectdiatheke
output is what we expectExpected:
ELISP> dtk-program
"diatheke"
ELISP> (call-process "diatheke" nil t nil "-b" "KJV" "-k" "Ps 39:1")
0 (#o0, #x0, ?\C-@)
ELISP> Psalms 39:1: <w savlm="strong:H0559">I said</w>, <w savlm="strong:H08104">I will take heed</w> <w savlm="strong:H01870">to my ways</w>, <w savlm="strong:H02398">that I sin</w> <w savlm="strong:H03956">not with my tongue</w>: <w savlm="strong:H08104">I will keep</w> <w savlm="strong:H06310">my mouth</w> <w savlm="strong:H04269">with a bridle</w>, <w savlm="strong:H07563">while the wicked</w> is before me.
(KJV)
$ diatheke -b KJV -k Ps 39:1
Psalms 39:1: <w savlm="strong:H0559">I said</w>, <w savlm="strong:H08104">I will take heed</w> <w savlm="strong:H01870">to my ways</w>, <w savlm="strong:H02398">that I sin</w> <w savlm="strong:H03956">not with my tongue</w>: <w savlm="strong:H08104">I will keep</w> <w savlm="strong:H06310">my mouth</w> <w savlm="strong:H04269">with a bridle</w>, <w savlm="strong:H07563">while the wicked</w> is before me.
(KJV)
Here goes:
The CALL-PROCESS output looks sane. I'm not familiar with the behavior of Emacs with MacOS and am wondering if you're experiencing a Mac-specific quirk. If you're up for it, let's try to troubleshoot a bit more. What is the output, return value, or value of each of the following? (# 2 is intended just to verify that the behavior you described earlier remains unchanged. # 6 is intended as a generic check of CALL-PROCESS behavior on planet Mac.)
diatheke-output-format
(dtk-diatheke-string "John 3:16" "KJV")
(apply 'call-process '("diatheke" nil t t "-b" "KJV" "-k" "John 3:16"))
(apply 'call-process '("diatheke" nil t t "-b" "KJV" "-o" "nfmslx" "-f" "OSIS" "-k" "John 3:16"))
(apply 'call-process '("diatheke" nil t t "-b" "KJV" "-o" "n" "-f" "plain" "-k" "John 3:16"))
(with-temp-buffer (apply 'call-process '("echo" nil t nil "123")) (buffer-string))
Here goes:
Interesting that
(call-process "diatheke" nil t nil "-b" "KJV" "-k" "Ps 39:1")
yields output but
(apply 'call-process '("diatheke" nil t t "-b" "KJV" "-k" "John 3:16"))
does not yield output, although it completes without error. The DISPLAY argument is NIL in the former but T in the latter. Is it possible that this is the underlying issue? Would you be willing to post the output of the two forms below?
(with-temp-buffer (apply 'call-process '("diatheke" nil t nil "-b" "KJV" "-k" "John 3:16")) (buffer-string))
(with-temp-buffer (apply 'call-process '("diatheke" nil t t "-b" "KJV" "-k" "John 3:16")) (buffer-string))
Here goes:
@Randy1Burrell Can you check value of (executable-find "diatheke")
? It should return full path of your diatheke executable. It should match that output by which diatheke
in Mac terminal.
If (executable-find "diatheke")
returns nil
, then Emacs cannot find it. Please add it to path with (add-to-list 'exec-path "/path/to/diatheke/")
.
This seems a Mac-specific problem, where PATH
environment variable set by ~/.bashrc
etc is NOT inherited in Emacs. Check this related SO thread, the first answer gives some hints.
(executable-find "diatheke")
which diatheke
I use this plugin to get my path from bash https://github.com/purcell/exec-path-from-shell
Apologies, I overlooked some previous discussion and led you in the wrong way.
Here goes:
I noticed unusual error output for (dtk-diatheke-string "John 3:16" "KJV")
. If the package is correctly loaded, at lease the function name should already be defined.
Can you try add :demand t
keyword to both dtk
AND exec-path-from-shell
? I wonder whether some of the empty output is due to the fact that either package is defer-loaded, so they're not in effect. If possible, please delete and fetch the latest version of dtk
and exec-path-from-shell
too.
(use-package dtk
:bind (("C-c B" . dtk-bible))
:demand t ;; do the same to exec-path-from-shell
:custom
(dtk-module "KJV")
(dtk-module-category "Biblical Texts")
(dtk-word-wrap t))
If that still doesn't work, please post output of these commands at the moment when you don't see output:
(exec-path)
(emacs-version)
dtk
and exec-path-from-shell
@yiufung thanks for your help and sorry for the late reply. These past few weeks have been really busy and tiresome for me.
Here are the output you asked for:
(exec-path)
(emacs-version)
dtk
exec-path-from-shell
I notice that you write dtk configuration as
:custom
(setq dtk-module "KJV")
instead of
:custom
(dtk-module "KJV")
From my understanding, it's not needed to use setq
within :custom
keyword. They are only needed in :config
or :init
. One suggestion is to retry with this fixed.
I observe that:
/usr/local/bin
exec-path
Usually this should work, but now dtk.el
still cannot give you output. I would suggest that you:
dtk.el
. Try delete local copy under your machine, and download the latest versiondtk-module
, dtk-output-format
, dtk-module-category
when you run dtk-*
commands. Inactive for > 1 y. The underlying issue remains unclear.
I have been trying to set up this plugin to work with Emacs on MacOS. However, I get the following errors:
Content is not installed for the selected module category, Biblical Texts. Install content or change the module category.
Specify parser, retriever, and inserter for the module
Content is not installed for the selected module category, Biblical Texts. Install content or change the module category.
Specify parser, retriever, and inserter for the module
Testing for installed modules:
I get:
Testing diatheke via the terminal:
Yields:
Here's my configuration:
Here is my environment variable for SWORD_PATH
Am I missing something?