dtk01 / dtk

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

Showing chapters #9

Closed OrionRandD closed 5 years ago

OrionRandD commented 5 years ago

Hi, This package is really wonderful for studying the Bible. But, when I ask DTK to show a whole chapter up, it shows like that:

Genesis 1:1 εν αρχη εποιησεν ο θεος τον ουρανον και την γην 2 η δε γη ην αορατος και ακατασκευαστος και σκοτος επανω της αβυσσου και πνευμα θεου επεφερετο επανω του υδατος 3 και ειπεν ο θεος γενηθητω φως και εγενετο φως 4 και ειδεν ο θεος το φως οτι καλον και διεχωρισεν ο θεος ανα μεσον του φωτος και ανα μεσον του σκοτους 5 και εκαλεσεν ο θεος το φως ημεραν και το σκοτος εκαλεσεν νυκτα και εγενετο εσπερα και εγενετο πρωι ημερα μια

But, I would like DTK had an option for the text to be shown as diatheke does in terminal or in emacs itself, like so, verses in different lines:

Genesis 1:1: In the beginning God created the heaven and the earth. Genesis 1:2: And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters. Genesis 1:3: And God said, Let there be light: and there was light. Genesis 1:4: And God saw the light, that it was good: and God divided the light from the darkness. Genesis 1:5: And God called the light Day, and the darkness he called Night. And the evening and the morning were the first day.

What do you think?

yiufung commented 5 years ago

Setting dtk-compact-view to nil should give you the results you want.

OrionRandD commented 5 years ago

@yiufung Where do I set that up? In my emacs init.el? Like so: (dtk-compact-view nil)

OrionRandD commented 5 years ago

@yiufung I got that, but some modules it also brings xml configuration. Like so:

Romans 1:1: Paul, a servant of Jesus Christ, called to be an apostle, separated unto the gospel of God, Romans 1:2: (Which he had promised afore by his prophets in the holy scriptures,) Romans 1:3: Concerning his Son Jesus Christ our Lord, which was made of the seed of David according to the flesh; Romans 1:4: And declared to be the Son of God with power, according to the spirit of holiness, by the resurrection from the dead: Romans 1:5: By whom we have received grace and apostleship, for obedience to the faith among all nations, for his name: (KJVA)


diatheke -b KJVA -f plain -k rom 1:1-5 and the result is this:

Romans 1:1: Paul, a servant of Jesus Christ, called to be an apostle, separated unto the gospel of God,

Romans 1:2: (Which he had promised afore by his prophets in the holy scriptures,)

Romans 1:3: Concerning his Son Jesus Christ our Lord, which was made of the seed of David according to the flesh;

Romans 1:4: And declared to be the Son of God with power, according to the spirit of holiness, by the resurrection from the dead:

Romans 1:5: By whom we have received grace and apostleship, for obedience to the faith among all nations, for his name:

(KJVA)


So that, how can I interactively give the format option to dtk? That would be something like

dtk -b KJVA -f plain -k rom 1:1-5

Is there a command to set up dtk options interactively?

Thx a lot

OrionRandD commented 5 years ago

Perhaps a "dtk-set-options" command For setting diatheke options on the fly [-o option_filters] [-m maximum_verses] [-f output_format] [-e output_encoding] [-v variant#(-1=all|0|1)] [-l locale] <-k query_key>

Etc... See diatheke command that you already know well :)

yiufung commented 5 years ago

I believe at this stage we default to osis output and if there's an error, fall back to plain.

@thomp Should we add -f output_format option, or in general, should we provide a separate command that accepts raw diatheke query? My concern is that it may add difficulty towards parsing verses later on

thomp commented 5 years ago

@yiufung I'm having difficulty understanding what exactly is dissatisfying (to OrionRandD) when dtk-compact-view is nil. However, I think your concern regarding parsing is important. Rather than a separate command, why not simply add an option to not parse at all? What do you think about https://github.com/dtk01/dtk/commit/44f30583f55ccbcf556a66e8c17530a865a1d7ee ? It adds two variables -- one which gives the user the option to keep the "raw" diatheke output and a second variable which gives the user the option to specify the desired diatheke output format.

yiufung commented 5 years ago

@thomp Thanks for the patch. @OrionRandD Can you try @thomp 's patch and see if that's your expected result? Otherwise it'd be great if you may elaborate further on expected output

OrionRandD commented 5 years ago

On Tue, Jun 18, 2019 at 09:19:22AM -0700, Yiufung Cheong wrote:

Thanks for trying to help me. I will try that whenever I am in a machine with Xorg. I am using only a non-X machine now locked in a terminal with elinks and such... Anyway, what is the command to apply the patch and where should I apply the command?


@thomp Thanks for the patch. @OrionRandD Can you try @thomp 's patch and see if that's your expected result? Otherwise it'd be great if you may elaborate further on expected output

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/dtk01/dtk/issues/9#issuecomment-503208152

thomp commented 5 years ago

@OrionRandD I'm assuming you're not using git. In that case, one way to test out the proposed changes is:

  1. Go to https://github.com/dtk01/dtk
  2. Click the 'branch' pull-down (LHS near the top of the page); select the "preserve-raw" branch
  3. Click "clone or download" (green button) and download the zip file; uncompress it
  4. In emacs, M-x ielm
  5. In the ielm buffer, (load "/your/path/to/preserve-raw-branch/dtk.el")
  6. Try varying the values of dtk-diatheke-output-format and dtk-preserve-diatheke-output-p. This can be done from the ielm buffer: e.g., (setq dtk-preserve-diatheke-output-p t).
  7. Does setting dtk-diatheke-output-format to :plain and dtk-preserve-diatheke-output-p yield satisfactory results?
OrionRandD commented 5 years ago

Setting (setq dtk-preserve-diatheke-output-p t) and (setq dtk-diatheke-output-format :plain) yieds the same output here:

ELISP> (load "~/.emacs.d/elpa/dtk/dtk.el") t ELISP> (setq dtk-preserve-diatheke-output-p t) t ELISP> Acts 1:1 The former treatise have I made, O Theophilus, of all that Jesus began both to do and teach, 2 Until the day in which he was taken up, after that he through the Holy Ghost had given commandments unto the apostles whom he had chosen: 3 To whom also he shewed himself alive after his passion by many infallible proofs, being seen of them forty days, and speaking of the things pertaining to the kingdom of God: 4 And, being assembled together with them, commanded them that they should not depart from Jerusalem, but wait for the promise of the Father, which, saith he, ye have heard of me. 5 For John truly baptized with water; but ye shall be baptized with the Holy Ghost not many days hence. IELM error More than one sexp in input ELISP> (load "~/.emacs.d/elpa/dtk/dtk.el") t ELISP> (setq dtk-diatheke-output-format :plain) :plain ELISP> Acts 1:1 The former treatise have I made, O Theophilus, of all that Jesus began both to do and teach, 2 Until the day in which he was taken up, after that he through the Holy Ghost had given commandments unto the apostles whom he had chosen: 3 To whom also he shewed himself alive after his passion by many infallible proofs, being seen of them forty days, and speaking of the things pertaining to the kingdom of God: 4 And, being assembled together with them, commanded them that they should not depart from Jerusalem, but wait for the promise of the Father, which, saith he, ye have heard of me. 5 For John truly baptized with water; but ye shall be baptized with the Holy Ghost not many days hence.

The text is plain in, e.g., KJV, but still is shown not as in diatheke, meaning each verse in different lines. Using my config with use-package does the same thing:

;; (add-to-list 'load-path "~/.emacs.d/elpa/dtk") ;; (require 'dtk)

(use-package dtk
  :bind (("C-c B" . dtk-bible))
  :custom
  (dtk-default-module "KJVA")
  (dtk-default-module-category "Biblical Texts")
  (dtk-word-wrap t)
  )

  --> $HOME/.emacs.d/elpa/dtk-20190601.426
thomp commented 5 years ago

@OrionRandD It looks like you are not using the dtk version with the proposed changes. The date on your version in the elpa directory, 2019-06-01, predates the proposed changes. Try downloading the version of dtk with the proposed changes and test it out. From the terminal, downloading should be straightforward: wget https://github.com/dtk01/dtk/archive/preserve-raw.zip. Then uncompress (use unzip) and follow steps 4-7 (above).

Here's what it looks like for me:

*** Welcome to IELM ***  Type (describe-mode) for help.
ELISP> (load "/home/thomp/src/dtk/dtk.el")
t
ELISP> (setq dtk-preserve-diatheke-output-p t)
t
ELISP> (setq dtk-diatheke-output-format :plain)
:plain
ELISP> 

Executing M-x dtk-bible in an empty buffer using Acts 1 yields

Acts 1:1: In the first book, O Theophilus, I have dealt with all that Jesus began to do and teach,
Acts 1:2: until the day when he was taken up, after he had given commands through the Holy Spirit to the apostles whom he had chosen.
Acts 1:3: To them he presented himself alive after his suffering by many proofs, appearing to them during forty days and speaking about the kingdom of God. 

Acts 1:4: And while staying with them he ordered them not to depart from Jerusalem, but to wait for the promise of the Father, which, he said, you heard from me;
Acts 1:5: for John baptized with water, but you will be baptized with the Holy Spirit not many days from now. 
OrionRandD commented 5 years ago

On Fri, Jun 21, 2019 at 08:50:23AM -0700, thomp wrote:

How can this version with the proposed changes can be in MELPA repo. So that, I can use "use-package" for easily upgrading my dtk.el? Thx a lot for the help

@OrionRandD It looks like you are not using the dtk version with the proposed changes. The date on your version in the elpa directory, 2019-06-01, predates the proposed changes. Try downloading the version of dtk with the proposed changes and test it out. From the terminal, downloading should be straightforward: wget https://github.com/dtk01/dtk/archive/preserve-raw.zip. Then uncompress (use unzip) and follow steps 4-7 (above).

Here's what it looks like for me:

*** Welcome to IELM ***  Type (describe-mode) for help.
ELISP> (load "/home/thomp/src/dtk/dtk.el")
t
ELISP> (setq dtk-preserve-diatheke-output-p t)
t
ELISP> (setq dtk-diatheke-output-format :plain)
:plain
ELISP> 

Executing M-x dtk-bible in an empty buffer using Acts 1 yields

Acts 1:1: In the first book, O Theophilus, I have dealt with all that Jesus began to do and teach,
Acts 1:2: until the day when he was taken up, after he had given commands through the Holy Spirit to the apostles whom he had chosen.
Acts 1:3: To them he presented himself alive after his suffering by many proofs, appearing to them during forty days and speaking about the kingdom of God. 

Acts 1:4: And while staying with them he ordered them not to depart from Jerusalem, but to wait for the promise of the Father, which, he said, you heard from me;
Acts 1:5: for John baptized with water, but you will be baptized with the Holy Spirit not many days from now. 

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/dtk01/dtk/issues/9#issuecomment-504475359

thomp commented 5 years ago

The changes should show up in MELPA soon (https://github.com/dtk01/dtk/commit/347c5539bb216849f88999acd04b2eec136244f1). Please reopen this issue if this doesn't resolve the issue.

OrionRandD commented 5 years ago

Thx a lot Thomp, I will be waiting for the changes to show up in MELPA. So that, I can upgrade my dtk pacakge through -> M-x package-reinstall or M-x package-list-packages :)


On Tue, Jun 25, 2019 at 01:02:03PM -0700, thomp wrote:

The changes should show up in MELPA soon ([1]347c553). Please reopen this issue if this doesn't resolve the issue.

— You are receiving this because you were mentioned. Reply to this email directly, [2]view it on GitHub, or [3]mute the thread.[4][IMG]

References

Visible links

  1. https://github.com/dtk01/dtk/commit/347c5539bb216849f88999acd04b2eec136244f1
  2. https://github.com/dtk01/dtk/issues/9?email_source=notifications&email_token=AKLPRKNX2SHMGR3GCCS5GPTP4J2TXA5CNFSM4HSQ37Q2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYRNT2A#issuecomment-505600488
  3. https://github.com/notifications/unsubscribe-auth/AKLPRKKWHW5X3FN5KD5IFQDP4J2TXANCNFSM4HSQ37QQ