Преглед изворни кода

Misc. cleanup and doc string fixup.

Fred Gilham пре 1 месец
родитељ
комит
56537f4c14
1 измењених фајлова са 4 додато и 25 уклоњено
  1. 4 25
      bible.el

+ 4 - 25
bible.el

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