Prechádzať zdrojové kódy

Fix broken search

Change in display format caused displaying passage referenced by verse lookup to fail because the regexp string no longer reflected the verse format in the *bible* buffer.

That is, instead of

genesis 1:12:

it would be

12:

Since the regexp was looking for ":<number>:" it would not find anything and error out.

The fix was to change the regexp to "<number>:".

This was also broken in looking up lexicon xrefs and fixed in the same way.
Fred Gilham 1 mesiac pred
rodič
commit
b126694f5d
1 zmenil súbory, kde vykonal 8 pridanie a 4 odobranie
  1. 8 4
      bible-mode.el

+ 8 - 4
bible-mode.el

@@ -205,7 +205,7 @@ which are of the form
   '(;; Old Testament
     ("Ge"     . "Genesis")         ("Ex"    . "Exodus")           ("Le"   . "Leviticus")     ("Nu"    . "Numbers")
     ("De"     . "Deuteronomy")     ("Js"    . "Joshua")           ("Jg"   . "Judges")        ("Ru"    . "Ruth")
-    ("I Sa"   . "I Samuel")        ("II Sa" . "II Samuel")        ("I Ki" . "I Kings")       ("II Ki" . "II Kings") 
+    ("I Sa"   . "I Samuel")	   ("II Sa" . "II Samuel")        ("I Ki" . "I Kings")       ("II Ki" . "II Kings") 
     ("I Ch"   . "I Chronicles")    ("II Ch" . "II Chronicles")    ("Ezr"  . "Ezra")          ("Ne"    . "Nehemiah")
     ("Es"     . "Esther")          ("Jb"    . "Job")              ("Ps"   . "Psalms")        ("Pr"    . "Proverbs")
     ("Ec"     . "Ecclesiastes")    ("So"    . "Song of Solomon")  ("Is"   . "Isaiah")        ("Je"    . "Jeremiah")
@@ -505,7 +505,10 @@ Genesis 1:1 is used."
   (let ((buf (get-buffer-create (generate-new-buffer-name (concat "*bible*")))))
     (set-buffer buf)
     (bible-mode)
-    (bm--set-location (or (assoc (or book-name "Genesis") bm-books) (list book-name)) (or chapter 1) verse)
+    (bm--set-location
+     (or (assoc (or book-name "Genesis") bm-books) (list book-name))
+     (or chapter 1)
+     verse)
     (set-window-buffer (get-buffer-window (current-buffer)) buf)))
 
 ;;;###autoload
@@ -1186,8 +1189,9 @@ If VERSE is supplied, set cursor at verse."
 
   ;; If optional verse specification go to that verse.
   (when verse
-    (goto-char (string-match (regexp-opt `(,(concat ":" (number-to-string verse) ":"))) (buffer-string)))
-    (beginning-of-line)))
+    (goto-char (+ 1 (string-match (regexp-opt `(,(concat (number-to-string verse) ":"))) (buffer-string))))
+;;    (beginning-of-line)
+))
 
 
 (defun bm--list-biblical-modules ()