Browse Source

Minor code, documentation cleanups

Fred Gilham 3 weeks ago
parent
commit
e5eb7b33a7
1 changed files with 24 additions and 23 deletions
  1. 24 23
      bible.el

+ 24 - 23
bible.el

@@ -46,12 +46,12 @@
 
 
 ;;;; Design
 ;;;; Design
 
 
-;; The idea here is to use the diatheke program to insert text from
-;; modules into buffers. The main bible display uses an "internal" XML
-;; format. The whole buffer gets parsed by libxml-parse-html-region to
-;; create a dom tree. This gets parsed by
-;; bible--insert-domnode-recursive to render the text into
-;; reading format.
+;; The idea here is to use the diatheke program to lookup text from
+;; modules (biblical texts), then insert this text into buffers. The
+;; main bible display uses diatheke's internal XML format. The whole
+;; buffer gets parsed by `libxml-parse-html-region' to create a dom
+;; tree. This gets parsed by `bible--insert-domnode-recursive' to render
+;; the text into reading format.
 
 
 ;; The text is then decorated using information from the dom format as
 ;; The text is then decorated using information from the dom format as
 ;; necessary along with regular expressions to identify the verse
 ;; necessary along with regular expressions to identify the verse
@@ -60,9 +60,9 @@
 
 
 ;; If Strongs tags and/or morphological tags are present, they are
 ;; If Strongs tags and/or morphological tags are present, they are
 ;; looked up in appropriate lexical and morphological modules and used
 ;; looked up in appropriate lexical and morphological modules and used
-;; to add tooltips to the text so that mousing over words will bring
+;; to add tooltips to the text so that hovering over words will bring
 ;; up a tooltip with information about the word. Clicking on a word
 ;; up a tooltip with information about the word. Clicking on a word
-;; with lexical information will display that informatio in a "term"
+;; with lexical information will display that information in a "term"
 ;; buffer.
 ;; buffer.
 
 
 ;;; Code:
 ;;; Code:
@@ -71,32 +71,27 @@
 
 
 ;; Turn off tool bar mode because we are greedy for pixels....
 ;; Turn off tool bar mode because we are greedy for pixels....
 (tool-bar-mode -1)
 (tool-bar-mode -1)
+
 ;; eldoc isn't meaningful in this program, and this saves space in the
 ;; eldoc isn't meaningful in this program, and this saves space in the
 ;; mode line.
 ;; mode line.
 (global-eldoc-mode -1)
 (global-eldoc-mode -1)
 
 
 ;;;; Requirements
 ;;;; Requirements
 
 
-(require 'cl-lib) ; Just used for cl-search in two places.
+;; REVIEW: CL-LIB is just used in this code for cl-search in two
+;; places. But since it is required by DOM and SHR, might as well take
+;; advantage of it. Maybe re-do some of the code below with CL-LIB
+;; constructs? (FMG 10-Mar-2026)
+(require 'cl-lib)
 (require 'dom)
 (require 'dom)
 (require 'shr)
 (require 'shr)
 
 
-
 ;;;; Aliases for obsolete functions
 ;;;; Aliases for obsolete functions
 
 
 ;; dom-text and dom-texts declared obsolescent in Emacs 31. Check for
 ;; dom-text and dom-texts declared obsolescent in Emacs 31. Check for
 ;; new function, retain backward compatibility.
 ;; new function, retain backward compatibility.
-(defalias 'bible-dom-text
-  (if (fboundp 'dom-inner-text)
-      'dom-inner-text
-    (with-no-warnings
-      'dom-text)))
-
-(defalias 'bible-dom-texts
-  (if (fboundp 'dom-inner-text)
-      'dom-inner-text
-    (with-no-warnings
-      'dom-texts)))
+(defalias 'bible-dom-text (if (fboundp 'dom-inner-text) 'dom-inner-text 'dom-text))
+(defalias 'bible-dom-texts (if (fboundp 'dom-inner-text) 'dom-inner-text 'dom-texts))
 
 
 ;;;; Configuration Variables
 ;;;; Configuration Variables
 
 
@@ -640,7 +635,10 @@ specifies the module to use."
   (let* ((completion-ignore-case t)
   (let* ((completion-ignore-case t)
          (book-data (assoc (completing-read "Book: " bible--books nil t) bible--books))
          (book-data (assoc (completing-read "Book: " bible--books nil t) bible--books))
          (book-data-string (car book-data))
          (book-data-string (car book-data))
-         (chapter (string-to-number (completing-read "Chapter [1]: " (bible--list-number-range 1 (cdr book-data)) nil t nil nil "1"))))
+         (chapter (string-to-number 
+		   (completing-read 
+		    "Chapter [1]: " 
+		    (bible--list-number-range 1 (cdr book-data)) nil t nil nil "1"))))
     (pcase (aref book-data-string 0)
     (pcase (aref book-data-string 0)
       (?1 (setq book-data (cons (concat "I" (substring book-data-string 1)) (cdr book-data))))
       (?1 (setq book-data (cons (concat "I" (substring book-data-string 1)) (cdr book-data))))
       (?2 (setq book-data (cons (concat "II" (substring book-data-string 1)) (cdr book-data))))
       (?2 (setq book-data (cons (concat "II" (substring book-data-string 1)) (cdr book-data))))
@@ -654,7 +652,10 @@ specifies the module to use."
   "Ask user for a new chapter for the current `bible' buffer."
   "Ask user for a new chapter for the current `bible' buffer."
   (interactive)
   (interactive)
   (let* ((book-chapters (cdr bible--current-book))
   (let* ((book-chapters (cdr bible--current-book))
-         (chapter (string-to-number (completing-read "Chapter [1]: " (bible--list-number-range 1 book-chapters) nil t nil nil "1"))))
+         (chapter (string-to-number 
+		   (completing-read 
+		    "Chapter [1]: " 
+		    (bible--list-number-range 1 book-chapters) nil t nil nil "1"))))
     (when chapter
     (when chapter
       (bible--set-location bible--current-book chapter))))
       (bible--set-location bible--current-book chapter))))