|
@@ -78,7 +78,7 @@
|
|
|
"Book module for Diatheke to query."
|
|
|
:type '(choice (const :tag "None" nil)
|
|
|
(string :tag "Module abbreviation (e.g. \"KJV\")"))
|
|
|
- :local t
|
|
|
+;; :local t
|
|
|
:group 'bible-mode)
|
|
|
|
|
|
;;;
|
|
@@ -178,44 +178,69 @@ which are of the form
|
|
|
'(;; Old Testament
|
|
|
("Genesis" . 50) ("Exodus" . 40) ("Leviticus" . 27) ("Numbers" . 36)
|
|
|
("Deuteronomy" . 34) ("Joshua" . 24) ("Judges" . 21) ("Ruth" . 4)
|
|
|
- ("I Samuel" . 31) ("II Samuel" . 24) ("I Kings" . 22) ("II Kings" . 25)
|
|
|
+ ("I Samuel" . 31) ("II Samuel" . 24) ("I Kings" . 22) ("II Kings" . 25)
|
|
|
("I Chronicles" . 29) ("II Chronicles" . 36) ("Ezra" . 10) ("Nehemiah" . 13)
|
|
|
("Esther" . 10) ("Job" . 42) ("Psalms" . 150) ("Proverbs" . 31)
|
|
|
("Ecclesiastes" . 12) ("Song of Solomon" . 8) ("Isaiah" . 66) ("Jeremiah" . 52)
|
|
|
("Lamentations" . 5) ("Ezekiel" . 48) ("Daniel" . 12) ("Hosea" . 14)
|
|
|
- ("Joel" . 3) ("Amos" . 9) ("Obadiah" . 1) ("Jonah" . 4)
|
|
|
+ ("Joel" . 3) ("Amos" . 9) ("Obadiah" . 1) ("Jonah" . 4)
|
|
|
("Micah" . 7) ("Nahum" . 3) ("Habakkuk" . 3) ("Zephaniah" . 3)
|
|
|
("Haggai" . 2) ("Zechariah" . 14) ("Malachi" . 4)
|
|
|
;; New Testament
|
|
|
("Matthew" . 28) ("Mark" . 16) ("Luke" . 24) ("John" . 21)
|
|
|
("Acts" . 28) ("Romans" . 16) ("I Corinthians" . 16) ("II Corinthians" . 13)
|
|
|
- ("Galatians" . 6) ("Ephesians" . 6) ("Philippians" . 4) ("Colossians" . 4)
|
|
|
- ("I Thessalonians" . 5) ("II Thessalonians" . 3) ("I Timothy" . 6) ("II Timothy" . 4)
|
|
|
+ ("Galatians" . 6) ("Ephesians" . 6) ("Philippians" . 4) ("Colossians" . 4)
|
|
|
+ ("I Thessalonians" . 5) ("II Thessalonians" . 3) ("I Timothy" . 6) ("II Timothy" . 4)
|
|
|
("Titus" . 3) ("Philemon" . 1) ("Hebrews" . 13) ("James" . 5)
|
|
|
- ("I Peter" . 5) ("II Peter" . 3) ("I John" . 5) ("II John" . 1)
|
|
|
+ ("I Peter" . 5) ("II Peter" . 3) ("I John" . 5) ("II John" . 1)
|
|
|
("III John" . 1) ("Jude" . 1) ("Revelation of John" . 22))
|
|
|
"A-list of name / chapter count for Bible books.")
|
|
|
|
|
|
-(defvar bible-mode-book-name-abbreviations-alist
|
|
|
+
|
|
|
+(defvar bible-mode-book-name-abbreviations-alist ;; XXX not currently used.
|
|
|
'(;; 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 Ch" . "I Chronicles") ("II Ch" . "II Chronicles") ("Ezr" . "Ezra") ("Ne" . "Nehemiah")
|
|
|
+ ("De" . "Deuteronomy") ("Js" . "Joshua") ("Jg" . "Judges") ("Judg" . "Judges")
|
|
|
+ ("Ru" . "Ruth") ("1 Samuel" . "I Samuel") ("I Sa" . "I Samuel") ("1 Sa" . "I Samuel")
|
|
|
+ ("2 Samuel" . "II Samuel") ("II Sa" . "II Samuel") ("2 Sa" . "II Samuel") ("1 Kings" . "I Kings")
|
|
|
+ ("I Ki" . "I Kings") ("1 Ki" . "I Kings") ("2 Kings" . "II Kings") ("II Ki" . "II Kings")
|
|
|
+ ("2 Ki" . "II Kings") ("1 Chronicles" . "I Chronicles") ("I Ch" . "I Chronicles") ("1 Ch" . "I Chronicles")
|
|
|
+ ("2 Chronicles" . "II Chronicles") ("II Ch" . "II Chronicles") ("2 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")
|
|
|
("La" . "Lamentations") ("Ez" . "Ezekiel") ("Da" . "Daniel") ("Ho" . "Hosea")
|
|
|
("Joe" . "Joel") ("Am" . "Amos") ("Ob" . "Obadiah") ("Jon" . "Jonah")
|
|
|
("Mi" . "Micah") ("Na" . "Nahum") ("Ha" . "Habakkuk") ("Zep" . "Zephaniah")
|
|
|
("Hag" . "Haggai") ("Ze" . "Zechariah") ("Mal" . "Malachi")
|
|
|
+
|
|
|
;; New Testament
|
|
|
- ("Mt" . "Matthew") ("Mk" . "Mark") ("Lk" . "Luke") ("Jo" . "John")
|
|
|
- ("Ac" . "Acts") ("Ro" . "Romans") ("I Co" . "I Corinthians") ("II Co" . "II Corinthians")
|
|
|
- ("Ga" . "Galatians") ("Eph" . "Ephesians") ("Phl" . "Philippians") ("Col" . "Colossians")
|
|
|
- ("I Th" . "I Thessalonians") ("II Th" . "II Thessalonians") ("I Ti" . "I Timothy") ("II Ti" . "II Timothy")
|
|
|
- ("Tit" . "Titus") ("Phm" . "Philemon") ("He" . "Hebrews") ("Ja" . "James")
|
|
|
- ("I Pe" . "I Peter") ("II Pe" . "II Peter") ("I Jo" . "I John") ("II Jo" . "II John")
|
|
|
- ("III Jo" . "III John") ("Ju" . "Jude") ("Re" . "Revelation of John"))
|
|
|
+ ;; Added AbbottSmith lexicon abbreviations to allow proper following of cross references in lexicon buffers.
|
|
|
+ ("Mt" . "Matthew") ("Matt" . "Matthew")
|
|
|
+ ("Mk" . "Mark") ("Lk" . "Luke") ("Jo" . "John") ("Ac" . "Acts")
|
|
|
+ ("Ro" . "Romans") ("Rom" . "Romans")
|
|
|
+ ("1 Corintihans" . "I Corinthians") ("I Co" . "I Corinthians") ("1 Co" . "I Corinthians") ("ICor" . "I Corinthians")
|
|
|
+ ("2 Corinthians" . "II Corinthians") ("II Co" . "II Corinthians") ("2 Co" . "II Corinthians") ("IICor" . "II Corinthians")
|
|
|
+ ("Ga" . "Galatians") ("Gal" . "Galatians")
|
|
|
+ ("Eph" . "Ephesians")
|
|
|
+ ("Phl" . "Philippians") ("Phil" . "Philippians")
|
|
|
+ ("Col" . "Colossians")
|
|
|
+ ("1 Thessalonians" . "I Thessalonians") ("I Th" . "I Thessalonians") ("1 Th" . "I Thessalonians") ("IThess" . "I Thessalonians")
|
|
|
+ ("2 Thessalonians" . "II Thessalonians") ("II Th" . "II Thessalonians") ("2 Th" . "II Thessalonians") ("IIThess" . "II Thessalonians")
|
|
|
+ ("1 Timothy" . "I Timothy") ("I Ti" . "I Timothy") ("1 Ti" . "I Timothy") ("ITim" . "I Timothy")
|
|
|
+ ("2 Timothy" . "II Timothy") ("II Ti" . "II Timothy") ("2 Ti" . "II Timothy") ("IITim" . "II Timothy")
|
|
|
+ ("Tit" . "Titus")
|
|
|
+ ("Phm" . "Philemon") ("Phlm" . "Philemon")
|
|
|
+ ("He" . "Hebrews") ("Heb" . "Hebrews")
|
|
|
+ ("Ja" . "James") ("Jas" . "James")
|
|
|
+ ("1 Peter" . "I Peter") ("I Pe" . "I Peter") ("1 Pe" . "I Peter")
|
|
|
+ ("2 Peter" . "II Peter") ("II Pe" . "II Peter") ("2 Pe" . "II Peter") ("IIPet" . "II Peter")
|
|
|
+ ("1 John" . "I John") ("I Jo" . "I John") ("1 Jo" . "I John") ("IJohn" . "I John")
|
|
|
+ ("2 John" . "II John") ("II Jo" . "II John") ("2 Jo" . "II John") ("IIJohn" . "II John")
|
|
|
+ ("3 John" . "III John") ("III Jo" . "III John") ("3 Jo" . "III John") ("IIIJohn" . "III John")
|
|
|
+ ("Ju" . "Jude")
|
|
|
+ ("Re" . "Revelation of John") ("Rev" . "Revelation of John"))
|
|
|
+
|
|
|
"A-list of abbreviations for Bible books.")
|
|
|
|
|
|
;;;; Book / chapter
|
|
@@ -248,6 +273,9 @@ which are of the form
|
|
|
|
|
|
;;;; Keymaps
|
|
|
|
|
|
+;;;; N.B. Bible Mode menu items appear in reverse order of their
|
|
|
+;;;; definition below
|
|
|
+
|
|
|
(defconst bible-mode-map (make-sparse-keymap)
|
|
|
"Keymap for bible-mode.")
|
|
|
(define-key bible-mode-map [menu-bar bible-mode]
|
|
@@ -257,9 +285,8 @@ which are of the form
|
|
|
[menu-bar bible-mode toggle-debug]
|
|
|
'("Toggle debug-on-error" . toggle-debug-on-error))
|
|
|
|
|
|
-
|
|
|
(defun bible-mode-toggle-display-diatheke ()
|
|
|
- "Toggle XML display."
|
|
|
+ "Toggle diatheke args display."
|
|
|
(interactive)
|
|
|
(setq bible-mode-show-diatheke-exec (not bible-mode-show-diatheke-exec)))
|
|
|
|
|
@@ -282,50 +309,53 @@ which are of the form
|
|
|
[menu-bar bible-mode sep]
|
|
|
'(menu-item '"--"))
|
|
|
|
|
|
+;;;;; Misc
|
|
|
+(define-key bible-mode-map "m" 'bible-mode-select-module)
|
|
|
+(define-key bible-mode-map "w" 'bible-mode-toggle-word-study)
|
|
|
+(define-key bible-mode-map "l" 'bible-mode-toggle-red-letter)
|
|
|
|
|
|
-;;;;; Navigation
|
|
|
-(define-key bible-mode-map "n" 'bible-mode-next-chapter)
|
|
|
+(define-key bible-mode-map "x" 'bible-mode-split-display)
|
|
|
(define-key bible-mode-map
|
|
|
- [menu-bar bible-mode next-chapter]
|
|
|
- '("Next Chapter" . bible-mode-next-chapter))
|
|
|
-
|
|
|
+ [menu-bar bible-mode split-display]
|
|
|
+ '("Split Display" . bible-mode-split-display))
|
|
|
+
|
|
|
+;;;;; Search
|
|
|
+(define-key bible-mode-map "/" 'bible-search)
|
|
|
+(define-key bible-mode-map "s" 'bible-search)
|
|
|
+(define-key bible-mode-map
|
|
|
+ [menu-bar bible-mode search]
|
|
|
+ '("Search" . bible-search))
|
|
|
+
|
|
|
+(define-key bible-mode-map "r" 'bible-mode-set-search-range)
|
|
|
+(define-key bible-mode-map
|
|
|
+ [menu-bar bible-mode range]
|
|
|
+ '("Set Search Range" . bible-mode-set-search-range))
|
|
|
+
|
|
|
+;;;;; Navigation
|
|
|
(define-key bible-mode-map "p" 'bible-mode-previous-chapter)
|
|
|
(define-key bible-mode-map
|
|
|
[menu-bar bible-mode previous-chapter]
|
|
|
'("Previous Chapter" . bible-mode-previous-chapter))
|
|
|
|
|
|
+(define-key bible-mode-map "n" 'bible-mode-next-chapter)
|
|
|
+(define-key bible-mode-map
|
|
|
+ [menu-bar bible-mode next-chapter]
|
|
|
+ '("Next Chapter" . bible-mode-next-chapter))
|
|
|
+
|
|
|
(define-key bible-mode-map (kbd "TAB") 'bible-mode-next-word)
|
|
|
(define-key bible-mode-map (kbd "M-<tab>") 'bible-mode-previous-word)
|
|
|
|
|
|
;;;;; Direct jump
|
|
|
-(define-key bible-mode-map "b" 'bible-mode-select-book)
|
|
|
-(define-key bible-mode-map
|
|
|
- [menu-bar bible-mode select-book]
|
|
|
- '("Select Book" . bible-mode-select-book))
|
|
|
-
|
|
|
(define-key bible-mode-map "c" 'bible-mode-select-chapter)
|
|
|
(define-key bible-mode-map
|
|
|
[menu-bar bible-mode select-chapter]
|
|
|
'("Select Chapter" . bible-mode-select-chapter))
|
|
|
|
|
|
-;;;;; Search
|
|
|
-(define-key bible-mode-map "/" 'bible-search)
|
|
|
-(define-key bible-mode-map "s" 'bible-search)
|
|
|
+(define-key bible-mode-map "b" 'bible-mode-select-book)
|
|
|
(define-key bible-mode-map
|
|
|
- [menu-bar bible-mode search]
|
|
|
- '("Bible Search" . bible-search))
|
|
|
-
|
|
|
-;;;; Not yet
|
|
|
-(define-key bible-mode-map "r" 'bible-mode-set-search-range)
|
|
|
-;;;;; Misc
|
|
|
-(define-key bible-mode-map "m" 'bible-mode-select-module)
|
|
|
-(define-key bible-mode-map "w" 'bible-mode-toggle-word-study)
|
|
|
-(define-key bible-mode-map "l" 'bible-mode-toggle-red-letter)
|
|
|
+ [menu-bar bible-mode select-book]
|
|
|
+ '("Select Book" . bible-mode-select-book))
|
|
|
|
|
|
-(define-key bible-mode-map "x" 'bible-mode-split-display)
|
|
|
-(define-key bible-mode-map
|
|
|
- [menu-bar bible-mode split-display]
|
|
|
- '("Split Display" . bible-mode-split-display))
|
|
|
|
|
|
(define-key bible-mode-map
|
|
|
[menu-bar bible-mode sep]
|
|
@@ -373,6 +403,9 @@ which are of the form
|
|
|
(defvar-local bible-mode-debugme nil
|
|
|
"Make text show up as XML when set.")
|
|
|
|
|
|
+(defvar-local bible-mode-search-query nil
|
|
|
+ "Query used in toggles (word study and red letter).")
|
|
|
+
|
|
|
(defvar use-tooltips t)
|
|
|
|
|
|
(defun bible-mode-toggle-tooltips ()
|
|
@@ -578,25 +611,27 @@ Genesis 1:1 is used."
|
|
|
(defun bible-mode-select-module ()
|
|
|
"Ask user for a new text module for the current `bible-mode' buffer."
|
|
|
(interactive)
|
|
|
- (let ((module (completing-read "Module: " bible-mode-modules)))
|
|
|
- (setq-local bible-mode-module module)
|
|
|
- (bible-mode--display)))
|
|
|
+;; (let* ((bible-mode-module (completing-read "Module: " bible-mode-modules)))
|
|
|
+;; (bible-mode--display))
|
|
|
+
|
|
|
+ (setq-default bible-mode-module (completing-read "Module: " bible-mode-modules))
|
|
|
+ (bible-mode--display))
|
|
|
|
|
|
;;;###autoload
|
|
|
-(defun bible-mode-toggle-word-study()
|
|
|
+(defun bible-mode-toggle-word-study ()
|
|
|
"Toggle the inclusion of word study for the active `bible-mode' buffer."
|
|
|
(interactive)
|
|
|
(setq bible-mode-word-study-enabled (not bible-mode-word-study-enabled))
|
|
|
(if (equal major-mode 'bible-search-mode)
|
|
|
- (bible-mode--display-search bible-mode-search-query bible-mode-search-mode bible-mode-module)
|
|
|
+ (bible-mode--display-search bible-mode-search-query bible-mode-search-mode)
|
|
|
(bible-mode--display)))
|
|
|
|
|
|
-(defun bible-mode-toggle-red-letter()
|
|
|
+(defun bible-mode-toggle-red-letter ()
|
|
|
"Toggle red letter mode for the active `bible-mode' buffer."
|
|
|
(interactive)
|
|
|
(setq bible-mode-red-letter-enabled (not bible-mode-red-letter-enabled))
|
|
|
(if (equal major-mode 'bible-search-mode)
|
|
|
- (bible-mode--display-search bible-mode-search-query bible-mode-search-mode bible-mode-module)
|
|
|
+ (bible-mode--display-search bible-mode-search-query bible-mode-search-mode)
|
|
|
(bible-mode--display)))
|
|
|
|
|
|
;;;###autoload
|
|
@@ -616,8 +651,9 @@ requires an index to be built using the `mkfastmod' program. `lucene' is
|
|
|
the default search."
|
|
|
(interactive "sBible Search: ")
|
|
|
(when (> (length query) 0)
|
|
|
- (let* ((searchmode (completing-read "Search Mode: " '("lucene" "phrase" "regex" "multiword") nil t "lucene")))
|
|
|
- (bible-mode--open-search query searchmode bible-mode-module))))
|
|
|
+ (let* ((bible-mode-module (buffer-local-value 'bible-mode-module (current-buffer)))
|
|
|
+ (searchmode (completing-read "Search Mode: " '("lucene" "phrase" "regex" "multiword") nil t "lucene")))
|
|
|
+ (bible-mode--open-search query searchmode))))
|
|
|
|
|
|
;;;###autoload
|
|
|
(defun bible-search-mode-follow-verse ()
|
|
@@ -641,7 +677,8 @@ Create a new `bible-mode' buffer positioned at the selected verse."
|
|
|
"Follow the hovered verse in a bible term buffer.
|
|
|
Create a new `bible-mode' buffer positioned at the specified verse.
|
|
|
XXX We use the current module to avoid opening cans of worms regarding
|
|
|
-OT/NT etc. If that module doesn't have that verse...???"
|
|
|
+OT/NT etc. If that module doesn't have that verse...???
|
|
|
+Handle abbreviations from lexicon module (AbbottSmith)."
|
|
|
(interactive)
|
|
|
(let* ((xref (get-text-property (point) 'xref))
|
|
|
(verse-ref (string-split xref))
|
|
@@ -650,17 +687,18 @@ OT/NT etc. If that module doesn't have that verse...???"
|
|
|
chapter-verse
|
|
|
chapter
|
|
|
verse)
|
|
|
+
|
|
|
(if (= (length verse-ref) 3) ; II Cor 3:17 or the like
|
|
|
- (progn
|
|
|
- (setq book-abbrev (concat (car verse-ref) " " (cadr verse-ref)))
|
|
|
- (setq chapter-verse (split-string (caddr verse-ref) ":")))
|
|
|
- (progn ; Mat 5 or the like
|
|
|
- (setq book-abbrev (car verse-ref))
|
|
|
- (setq chapter-verse (split-string (cadr verse-ref) ":"))))
|
|
|
-
|
|
|
- (setq book (car verse-ref))
|
|
|
+ (setq book-abbrev (concat (car verse-ref) (cadr verse-ref))
|
|
|
+ chapter-verse (split-string (caddr verse-ref) ":"))
|
|
|
+ ;; Mat 5 or the like
|
|
|
+ (setq book-abbrev (car verse-ref)
|
|
|
+ chapter-verse (split-string (cadr verse-ref) ":")))
|
|
|
+
|
|
|
+ (setq book (cdr (assoc book-abbrev bible-mode-book-name-abbreviations-alist)))
|
|
|
+ (unless book (setq book (car verse-ref))) ; Didn't find abbreviation
|
|
|
(setq chapter (car chapter-verse)
|
|
|
- verse (cadr chapter-verse))
|
|
|
+ verse (cadr chapter-verse))
|
|
|
(bible-open (string-trim book) (string-to-number chapter) (string-to-number verse))))
|
|
|
|
|
|
;;;###autoload
|
|
@@ -705,7 +743,11 @@ OT/NT etc. If that module doesn't have that verse...???"
|
|
|
(if searchtype
|
|
|
(progn
|
|
|
(setq filter nil) ; search is not compatible with filters XXX
|
|
|
- (setq args (append args (list "-s" (pcase searchtype ("lucene" "lucene") ("phrase" "phrase") ("regex" "regex") ("multiword" "multiword")))))
|
|
|
+ (setq args (append args (list "-s" (pcase searchtype
|
|
|
+ ("lucene" "lucene")
|
|
|
+ ("phrase" "phrase")
|
|
|
+ ("regex" "regex")
|
|
|
+ ("multiword" "multiword")))))
|
|
|
(when bible-mode-search-range (setq args (append args (list "-r" bible-mode-search-range)))))
|
|
|
(progn
|
|
|
(if filter
|
|
@@ -868,21 +910,19 @@ lexical definition is set for a particular lexicon."
|
|
|
(bible-mode--lookup-greek-def key))
|
|
|
greek-hash)))
|
|
|
|
|
|
-(defun bible-mode--lookup-strongs-greek (window object pos)
|
|
|
+(defun bible-mode--lookup-strongs-greek (_window object pos)
|
|
|
"Look up Greek lexical entry of OBJECT clicked on in WINDOW at POS.
|
|
|
If not found in hash table, get it from sword database. stash in hash
|
|
|
-table, and return string.
|
|
|
-Note: compiler warns about unused `WINDOW' argument."
|
|
|
+table, and return string."
|
|
|
(let ((query (get-text-property pos 'strong object))) ; Get Strong's number from text property
|
|
|
(when (string-match "[0-9]+" query)
|
|
|
(bible-mode--lookup-lex-greek (match-string 0 query)))))
|
|
|
|
|
|
|
|
|
-(defun bible-mode--lookup-strongs-greek-short (window object pos)
|
|
|
+(defun bible-mode--lookup-strongs-greek-short (_window object pos)
|
|
|
"Look up shorter Greek lexical entry of OBJECT clicked on in WINDOW at POS.
|
|
|
If not found in hash table, get it from sword database, stash in hash table,
|
|
|
-and return string.
|
|
|
-Note: compiler warns about unused `window' argument."
|
|
|
+and return string."
|
|
|
(let ((query (get-text-property pos 'strong object))) ; Get Strong's number from text property
|
|
|
(when (string-match "[0-9]+" query)
|
|
|
(let ((lookup-key (match-string 0 query)))
|
|
@@ -891,11 +931,10 @@ Note: compiler warns about unused `window' argument."
|
|
|
(puthash lookup-key raw-text greek-hash-short)))))))
|
|
|
|
|
|
|
|
|
-(defun bible-mode--lookup-strongs-hebrew (window object pos)
|
|
|
+(defun bible-mode--lookup-strongs-hebrew (_window object pos)
|
|
|
"Look up Hebrew lexical string for object at point.
|
|
|
If not found in hash table, get it from sword database,
|
|
|
-stash in hash table, and return string.
|
|
|
-Note: compiler warns about unused `window' argument."
|
|
|
+stash in hash table, and return string."
|
|
|
(let ((query (get-text-property pos 'strong object)))
|
|
|
(when (string-match "[0-9]+" query)
|
|
|
(let ((lookup-key (concat "H" (match-string 0 query))))
|
|
@@ -903,7 +942,7 @@ Note: compiler warns about unused `window' argument."
|
|
|
(let ((raw-text (bible-mode--lex-query lookup-key bible-mode-hebrew-lexicon)))
|
|
|
(puthash lookup-key raw-text hebrew-hash)))))))
|
|
|
|
|
|
-(defun bible-mode--lookup-strongs-hebrew-short (window object pos)
|
|
|
+(defun bible-mode--lookup-strongs-hebrew-short (_window object pos)
|
|
|
"Look up Hebrew lexical string from short Hebrew lexicon for object
|
|
|
at point. If not found in hash table, get it from sword database,
|
|
|
stash in hash table, and return string.
|
|
@@ -920,13 +959,23 @@ Note: compiler warns about unused `window' argument."
|
|
|
(puthash query (bible-mode--morph-query query database) hash)))
|
|
|
|
|
|
(defvar bible-mode-outline-strings
|
|
|
- '((" I." . "\n I.")
|
|
|
- (" 1." . "\n 1.")
|
|
|
- (" 2." . "\n 2.")
|
|
|
- (" 3." . "\n 3.")
|
|
|
- (" a." . "\n a.")
|
|
|
- (" b." . "\n b.")
|
|
|
- (" c." . "\n c.")
|
|
|
+ '((" I." . "\n I.")
|
|
|
+ (" II." . "\n II.")
|
|
|
+ (" III." . "\n III.")
|
|
|
+ (" IV." . "\n IV.")
|
|
|
+ (" V." . "\n V.")
|
|
|
+ (" 1." . "\n 1.")
|
|
|
+ (" 2." . "\n 2.")
|
|
|
+ (" 3." . "\n 3.")
|
|
|
+ (" 4." . "\n 4.")
|
|
|
+ (" 5." . "\n 5.")
|
|
|
+ (" 6." . "\n 6.")
|
|
|
+ (" 7." . "\n 7.")
|
|
|
+ (" 8." . "\n 8.")
|
|
|
+ (" 9." . "\n 9.")
|
|
|
+ (" a." . "\n a.")
|
|
|
+ (" b." . "\n b.")
|
|
|
+ (" c." . "\n c.")
|
|
|
(". ." . ".")
|
|
|
(" . " . ". ")))
|
|
|
|
|
@@ -1123,12 +1172,15 @@ XXX In processing subnodes, each case will prepend a space if it needs it."
|
|
|
(add-face-text-property (- (point) (length word)) (point) '(:foreground "gray50"))))))))
|
|
|
|
|
|
|
|
|
-(defvar bible-mode-debugme nil)
|
|
|
+;;(defvar bible-mode-debugme nil)
|
|
|
|
|
|
(defun bible-mode--display (&optional verse)
|
|
|
"Render text for `bible-mode'.
|
|
|
If VERSE is supplied, set cursor at verse."
|
|
|
|
|
|
+ ;; Display buffers can have different modules.
|
|
|
+ (setq-local bible-mode-module (default-value 'bible-mode-module))
|
|
|
+
|
|
|
;; Clear buffer and insert the result of calling bible-mode--exec-diatheke.
|
|
|
(setq buffer-read-only nil)
|
|
|
(erase-buffer)
|
|
@@ -1220,7 +1272,7 @@ If VERSE is supplied, set cursor at verse."
|
|
|
"Keymap action function---select module user chooses."
|
|
|
(interactive)
|
|
|
(let ((item (get-text-property (point) 'module)))
|
|
|
- (setq-default bible-mode-module item)
|
|
|
+ (setq-default bible-mode-module item)
|
|
|
(bible-open)))
|
|
|
|
|
|
|
|
@@ -1257,29 +1309,28 @@ If VERSE is supplied, set cursor at verse."
|
|
|
|
|
|
;;;;; Bible Searching
|
|
|
|
|
|
-(defun bible-mode--open-search (query searchmode mod)
|
|
|
+(defun bible-mode--open-search (query searchmode)
|
|
|
"Open a search buffer of QUERY using SEARCHMODE in module MOD."
|
|
|
- (let ((buf (get-buffer-create (concat "*bible-search-" (downcase mod) "-" query "*"))))
|
|
|
+ (let ((buf (get-buffer-create (concat "*bible-search-" (downcase bible-mode-module) "-" query "*"))))
|
|
|
(set-buffer buf)
|
|
|
(bible-search-mode)
|
|
|
- (bible-mode--display-search query searchmode mod)
|
|
|
+ (bible-mode--display-search query searchmode)
|
|
|
(pop-to-buffer buf nil t)))
|
|
|
|
|
|
-(defun bible-mode--display-search (query searchmode mod)
|
|
|
- "Render results of search QUERY from SEARCHMODE.
|
|
|
-Module MOD is used for the query."
|
|
|
+(defun bible-mode--display-search (query searchmode)
|
|
|
+ "Render results of search QUERY from SEARCHMODE."
|
|
|
(setq buffer-read-only nil)
|
|
|
(erase-buffer)
|
|
|
|
|
|
(let* ((result (string-trim (replace-regexp-in-string
|
|
|
"Entries .+?--" ""
|
|
|
- (bible-mode--exec-diatheke query nil "plain" searchmode mod))))
|
|
|
+ (bible-mode--exec-diatheke query nil "plain" searchmode bible-mode-module))))
|
|
|
(match 0)
|
|
|
(matchstr "")
|
|
|
(verses nil)
|
|
|
(query-verses "")
|
|
|
fullverses)
|
|
|
- (if (equal result (concat "none (" mod ")"))
|
|
|
+ (if (equal result (concat "none (" bible-mode-module ")"))
|
|
|
(insert "No results found."
|
|
|
(if (equal searchmode "lucene")
|
|
|
" Verify index has been build with mkfastmod."
|
|
@@ -1307,7 +1358,8 @@ Module MOD is used for the query."
|
|
|
(if query-verses
|
|
|
(setq query-verses (concat query-verses ";" verse))
|
|
|
(setq query-verses verse)))
|
|
|
- (setq fullverses (let ((bible-mode-show-diatheke-exec nil)) (bible-mode--exec-diatheke query-verses nil nil nil mod)))
|
|
|
+ (setq fullverses (let ((bible-mode-show-diatheke-exec nil))
|
|
|
+ (bible-mode--exec-diatheke query-verses nil nil nil bible-mode-module)))
|
|
|
|
|
|
(insert fullverses)
|
|
|
|
|
@@ -1315,10 +1367,10 @@ Module MOD is used for the query."
|
|
|
(erase-buffer)
|
|
|
(bible-mode--insert-domnode-recursive (dom-by-tag html-dom-tree 'body) nil nil)
|
|
|
(goto-char (point-min))
|
|
|
- (while (search-forward (concat "(" mod ")") nil t)
|
|
|
+ (while (search-forward (concat "(" bible-mode-module ")") nil t)
|
|
|
(replace-match "")))))
|
|
|
|
|
|
- (setq mode-name (concat "Bible Search (" mod))
|
|
|
+ (setq mode-name (concat "Bible Search (" bible-mode-module))
|
|
|
(when bible-mode-search-range
|
|
|
(setq mode-name (concat mode-name " [" bible-mode-search-range "]")))
|
|
|
(setq mode-name (concat mode-name ")"))
|
|
@@ -1416,6 +1468,7 @@ left-to-right. XXX Why doesn't this work for the tooltips?"
|
|
|
|
|
|
(defun bible-mode--set-location (book chapter &optional verse)
|
|
|
"Set the BOOK, CHAPTER and optionally VERSE of the active `bible-mode' buffer."
|
|
|
+ (setq-local bible-mode-module (default-value 'bible-mode-module))
|
|
|
(setq-local bible-mode-current-book book)
|
|
|
(setq-local bible-mode-current-book-name (car book))
|
|
|
(setq-local bible-mode-current-chapter chapter)
|