dtk01 / dtk

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

Error after selecting a book/chapter/verse: "Symbol's function definition is void: :osis" #10

Closed rhodium88 closed 4 years ago

rhodium88 commented 5 years ago

I am getting an error when trying to use dtk, which I installed today via melpa. I am prompted to select a book, chapter, and verse. Immediately following the selection of the verse, I get the error "Symbol's function definition is void: :osis" in the echo area. Nothing else happens, i.e. no text is displayed.

I've tried with multiple bibles, books, and chapter-verse combos. I've tried (setq diatheke-output-format :plain) to no avail.

This happens regardless of whether I choose (dtk) or (dtk-bible).

diatheke is installed and working.

yiufung commented 5 years ago

Can you print the stack trace with toggle-debug-on-error?

On Sun, Jul 7, 2019, at 1:17 PM, rhodium88 wrote:

I am getting an error when trying to use dtk, which I installed today via melpa. I am prompted to select a book, chapter, and verse. Immediately following the selection of the verse, I get the error "Symbol's function definition is void: :osis" in the echo area. Nothing else happens, i.e. no text is displayed.

I've tried with multiple bibles, books, and chapter-verse combos. I've tried (setq diatheke-output-format :plain) to no avail.

This happens regardless of whether I choose (dtk) or (dtk-bible).

diatheke is installed and working.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dtk01/dtk/issues/10?email_source=notifications&email_token=AAHZ3D4EPBBYGU3DKPYOFB3P6F35ZA5CNFSM4H6U3DF2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G5WBYJQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHZ3D2X4WPRDPWZLH2I6U3P6F35ZANCNFSM4H6U3DFQ.

-- Yiufung

dtk01 commented 5 years ago

@rhodium88 Would you be willing to try the following to see if it resolves the problem?

  1. Open IELM (M-x ielm)
  2. Redefine dtk-bible--insert-using-diatheke:
(defun dtk-bible--insert-using-diatheke (book chapter-verse &optional module diatheke-output-format)
  (unless diatheke-output-format
    (setq diatheke-output-format :plain))
  (let ((module (or module dtk-module)))
    (insert
     (with-temp-buffer
       (call-process dtk-program nil t
                     t     ; redisplay buffer as output is inserted
                     "-o" (cond ((eq diatheke-output-format :osis)
                 "nfmslx")
                ((eq diatheke-output-format :plain)
                 "n"))
             "-f" (cond ((eq diatheke-output-format :osis)
                 "OSIS")
                ((eq diatheke-output-format :plain)
                 "plain"))
                     "-b" module "-k" book chapter-verse)
       (unless dtk-preserve-diatheke-output-p
     (let ((end-point (point)))
           (re-search-backward "^(.*)" nil t 1)
           (delete-region (point) end-point))
     (let ((end-point (point)))
           (re-search-backward "^:" nil t 1)
           (delete-region (point) end-point))
     (let ((raw-diatheke-text (buffer-substring (point-min) (point-max))))
       (let ((parsed-lines (case diatheke-output-format
                 (:osis (dtk--parse-osis-xml-lines raw-diatheke-text))
                 (:plain (dtk-sto--diatheke-parse-text raw-diatheke-text)))))
         (delete-region (point-min) (point-max))
         (dtk-insert-verses parsed-lines))))
       (buffer-string)
       )))
  t)
  1. Try dtk or dtk-bible
dtk01 commented 4 years ago

Closing due to lack of response to maintainer's request for information