Sfoglia il codice sorgente

Fix lossage from previous changes (module stuff again)

Fred Gilham 3 settimane fa
parent
commit
2a81f634f3
1 ha cambiato i file con 14 aggiunte e 13 eliminazioni
  1. 14 13
      bible.el

+ 14 - 13
bible.el

@@ -3,7 +3,7 @@
 ;; Copyright (c) 2025-2026 Fred Gilham
 
 ;; Author: Fred Gilham <fmgilham@gmail.com>
-;; Version: 1.1.0
+;; Version: 1.1.1
 ;; Keywords: files, text, hypermedia
 ;; Package-Requires: ((emacs "29.1") cl-lib dom shr)
 ;; URL: https://gitbot.homedns.org/fred/bible-mode
@@ -448,7 +448,7 @@ See `bible--display-lemma-hebrew'."
   "Toggle XML display."
   (interactive)
   (setq-local bible-debugme (not bible-debugme))
-  (bible--display bible-module))
+  (bible--display))
 
 (defvar-local bible-text-direction 'left-to-right)
 
@@ -648,7 +648,7 @@ specifies the module to use."
     (setq-local bible--current-book book-data)
     (setq-local bible--current-book-name (car book-data))
     (setq-local bible--current-chapter chapter)
-    (bible--display bible-module)))
+    (bible--display)))
 
 (defun bible-select-chapter ()
   "Ask user for a new chapter for the current `bible' buffer."
@@ -678,13 +678,13 @@ specifies the module to use."
   "Toggle the inclusion of word study for the active `bible' buffer."
   (interactive)
   (setq bible-word-study-enabled (not bible-word-study-enabled))
-  (bible--display bible-module))
+  (bible--display))
 
 (defun bible-toggle-red-letter ()
   "Toggle red letter mode for the active `bible' buffer."
   (interactive)
   (setq bible-red-letter-enabled (not bible-red-letter-enabled))
-    (bible--display bible-module))
+    (bible--display))
 
 (defun bible-split-display ()
   "Copy the active `bible' buffer into a new buffer in another window."
@@ -1277,10 +1277,11 @@ In processing subnodes, each case will prepend a space if it needs it."
                     (add-face-text-property (- (point) (length word)) (point) '(:foreground "gray50")))))))))))
 
 
-(defun bible--display (module &optional verse)
-  "Render a page of the text using MODULE as the source of the text.
+(defun bible--display (&optional module verse)
+  "Render a page of Bible text.
+If optional argument MODULE is supplied, use that module for display.
 If optional argument VERSE is supplied, set cursor at verse."
-  (setq-local bible-module module)
+  (when module (setq-local bible-module module))
   (let ((buffer-read-only nil)
         (bible-chapter-title nil)
         (bible-has-lexemes nil)
@@ -1305,7 +1306,7 @@ If optional argument VERSE is supplied, set cursor at verse."
             (add-face-text-property (match-beginning 0) (match-end 0) '(:foreground "purple"))))))
     (save-excursion
       ;; Remove the module name from the buffer.
-      (while (re-search-forward (concat "^.*" module ".*$") nil t)
+      (while (re-search-forward (concat "^.*" bible-module ".*$") nil t)
         (replace-match "" nil t)))
     (save-excursion
       ;; Fix divine name lossage.
@@ -1355,14 +1356,14 @@ If optional argument VERSE is supplied, set cursor at verse."
         (replace-match " ")))
     ;; Set the mode line of the biffer.
     (setq mode-name (concat "Bible (" bible--current-book-name " " (number-to-string bible--current-chapter) ") "
-                            module
+                            bible-module
                             (when bible-has-lexemes " Lex")
                             (when bible-has-morphemes " Morph")
                             ")"))
     (force-mode-line-update))
-  ;; If optional verse specification go to that verse.
-  (when verse
-    (re-search-forward (concat " ?" (number-to-string verse)) nil t)))
+    ;; If optional verse specification go to that verse.
+    (when verse
+      (re-search-forward (concat " ?" (number-to-string verse)) nil t)))
 
 ;;;; Modules (Bible texts)