Jelajahi Sumber

Misc. cleanup and doc string fixup.

Fred Gilham 1 bulan lalu
induk
melakukan
56537f4c14
1 mengubah file dengan 4 tambahan dan 25 penghapusan
  1. 4 25
      bible.el

+ 4 - 25
bible.el

@@ -319,7 +319,6 @@ See `bible--display-lemma-hebrew'."
 
 (defvar bible-search-range nil)
 
-
 ;;;;; Lexemes / morphemes
 
 (defvar-local bible-has-lexemes nil
@@ -628,7 +627,6 @@ specifies the module to use."
   (interactive)
   (bible--set-location bible--current-book (max 1 (- bible--current-chapter 1))))
 
-
 (defun bible-next-word ()
   "Move forward a word, taking into account the relevant text properties."
   (interactive)
@@ -645,7 +643,6 @@ specifies the module to use."
       (when previous-change
 	(goto-char (prop-match-beginning previous-change))))))
 
-
 (defun bible-select-book ()
   "Ask user for a new book and chapter for the current `bible' buffer."
   (interactive)
@@ -662,7 +659,6 @@ specifies the module to use."
     (setq-local bible--current-chapter chapter)
     (bible--display)))
 
-
 (defun bible-select-chapter ()
   "Ask user for a new chapter for the current `bible' buffer."
   (interactive)
@@ -728,7 +724,6 @@ Create a new `bible' buffer positioned at the selected verse."
          verse)
     (string-match bible--verse-regexp text)
     (setq text (match-string 0 text))
-;;    (message "Following verse result: %s" text)
     (string-match "I?I?I? ?[A-Z]?[a-z]* " text)
     (setq book (match-string 0 text))
     (string-match "[0-9]?[0-9]?[0-9]?:" text)
@@ -763,7 +758,6 @@ Handle abbreviations from lexicon module (AbbottSmith)."
 	  verse (cadr chapter-verse))
     (bible-open (string-trim book) (string-to-number chapter) (string-to-number verse) bible-module)))
 
-
 ;; These can be called interactively if you know the Strong's number
 ;; you want to look up.
 
@@ -800,13 +794,11 @@ Handle abbreviations from lexicon module (AbbottSmith)."
 
 (defconst bible-diatheke-filter-options " avlnmw")
 
-;; XXX
-;; Can we avoid returning (buffer-string) and just use whatever buffer is current?
-;;
 (defun bible--exec-diatheke (query &optional filter format module)
-  "Execute `diatheke' with specified QUERY options, returning buffer.
-FILTER is the Diatheke filter argument. FORMAT is either plain
-or the default of internal. MODULE is the text module to use."
+  "Execute `diatheke' with specified QUERY options.
+FILTER is the Diatheke filter argument. FORMAT is either plain or
+the default of internal. MODULE is the text module to use. Output
+goes to current buffer."
   (let ((module (or module bible-module)))
     (let ((args (list bible-sword-query nil (current-buffer) t "-b" module)))
       (if filter
@@ -818,8 +810,6 @@ or the default of internal. MODULE is the text module to use."
 	(message "%s" args))
       (apply #'call-process args))))
 
-
-
 (defun bible--diatheke-search (query searchtype &optional format module)
   "Execute `diatheke' on QUERY with SEARCHTYPE.
 Optional argument FORMAT is either plain or the default of internal.
@@ -1222,11 +1212,9 @@ in buffer)."
 Inserts resulting text into active buffer with properties specified in
 IPROPERTIES.  If NOTITLE is true, don't render title headings.
 XXX In processing subnodes, each case will prepend a space if it needs it."
-
   (when (and bible-red-letter-enabled (equal (dom-attr node 'who) "Jesus"))
     ;; For red-letter display.
     (setq iproperties (plist-put iproperties 'jesus t)))
-
   (dolist (subnode (dom-children node))
     (cond ((null subnode) nil)
 	  ((stringp subnode)
@@ -1508,7 +1496,6 @@ If optional argument VERSE is supplied, set cursor at verse."
 		 (put-text-property start end 'strong (concat "strong:G" match))
 		 (put-text-property start end 'keymap bible-greek-keymap)
 		 (add-face-text-property start end `(:foreground "blue")))))))
-
     ;; This enables clicking on verse references.
     (save-excursion
       (while (search-forward-regexp bible--verse-regexp nil t)
@@ -1519,12 +1506,10 @@ If optional argument VERSE is supplied, set cursor at verse."
 	  (put-text-property start end 'keymap bible-search-mode-map)
 	  (put-text-property start end 'help-echo (concat "Go to " (substring-no-properties match)))
 	  (add-face-text-property start end '(:foreground "blue")))))
-
     (save-excursion
       (while (search-forward "()" nil t)
 	(replace-match "")))))
 
-
 (defun bible--open-term-hebrew (term)
   "Open a buffer of the Strong's Hebrew TERM's definition."
   (with-current-buffer (get-buffer-create (concat "*bible-term-hebrew-" term "*"))
@@ -1534,7 +1519,6 @@ If optional argument VERSE is supplied, set cursor at verse."
     (pop-to-buffer (current-buffer) nil t)
     (fit-window-to-buffer)))
 
-
 (defun bible--display-lemma-hebrew (lemma)
   "Render the definition of the Strong's Hebrew LEMMA.
 This code is customized for the BDBGlosses_Strongs lexicon."
@@ -1545,7 +1529,6 @@ This code is customized for the BDBGlosses_Strongs lexicon."
 ;;    (insert (substring (bible--cleanup-lex-text (bible--lookup-lemma-hebrew lemma)) 7))
     (bible--fixup-lexicon-display 'hebrew)))
 
-
 (defun bible--open-term-greek (term)
   "Open a buffer of the Strong's Greek TERM definition."
   (with-current-buffer (get-buffer-create (concat "*bible-term-greek-" term "*"))
@@ -1561,11 +1544,8 @@ This code is customized for the BDBGlosses_Strongs lexicon."
     (insert (bible--lookup-lemma-greek lemma))
     (bible--fixup-lexicon-display 'greek)))
 
-
 (defun bible--set-location (book chapter &optional verse)
   "Set the BOOK, CHAPTER and optionally VERSE of the active `bible' buffer."
-  ;;  (setq-local bible-module (default-value 'bible-module))
-;;  (message "set-location %s" book)
   (setq-local bible--current-book book)
   (setq-local bible--current-book-name (car book))
   (setq-local bible--current-chapter chapter)
@@ -1583,7 +1563,6 @@ Used in tandem with `completing-read' for chapter selection."
 	(push (cons (concat prefix (number-to-string num)) num) range-list)))
     (nreverse range-list)))
 
-
 ;;; Provides
 
 (provide 'bible)