فهرست منبع

Re-add kludge for KJV Greek lexemes (temporary I hope)

Fred Gilham 1 ماه پیش
والد
کامیت
03f35aedd8
1فایلهای تغییر یافته به همراه14 افزوده شده و 20 حذف شده
  1. 14 20
      bible.el

+ 14 - 20
bible.el

@@ -1130,24 +1130,19 @@ in buffer)."
       (when (or lemma savlm)
 	(let* ((matched nil)
 	       (lexemes (split-string (or lemma savlm)))
-	       ;; XXX KJV module conflates articles with lemmas. Deal with this.
-	       (lexeme (car (last lexemes))))
-;;	  (message "Lexemes: %s" lexemes)
-	  (when (string-match "strong:.*" lexeme)
-;;	    (message "Matched %s" (match-string 0 lexeme))
-	    (dolist (word (split-string (match-string 0 lexeme)))
-;;	      (message "Word: %s" word)
-	      (cond ((string-match "strong:G.*" word) ; Greek
-		     (setq matched (match-string 0 lexeme))
-		     (put-text-property refstart refend 'keymap bible-greek-keymap))
-		    ((string-match "strong:H.*" lexeme) ; Hebrew
-		     (setq matched (match-string 0 lexeme))
-		     (put-text-property refstart refend 'keymap bible-hebrew-keymap))))
-	    ;; Add help-echo, strongs reference for tooltips if match.
-	    (when matched
-	      (setq bible-has-lexemes t)
-	      (put-text-property refstart refend 'help-echo 'bible--show-lex-morph)
-	      (put-text-property refstart refend 'strong matched)))))
+	       ;; XXX Kludge alert. KJV module conflates articles with lemmas. Deal with this.
+	       (lexeme (if (> (length lexemes) 2) (nth 1 lexemes) (nth 0 lexemes))))
+	  (cond ((string-match "strong:G.*" lexeme) ; Greek
+		 (setq matched (match-string 0 lexeme))
+		 (put-text-property refstart refend 'keymap bible-greek-keymap))
+		((string-match "strong:H.*" lexeme) ; Hebrew
+		 (setq matched (match-string 0 lexeme))
+		 (put-text-property refstart refend 'keymap bible-hebrew-keymap)))
+	  ;; Add help-echo, strongs reference for tooltips if match.
+	  (when matched
+	    (setq bible-has-lexemes t)
+	    (put-text-property refstart refend 'help-echo 'bible--show-lex-morph)
+	    (put-text-property refstart refend 'strong matched))))
 
       ;; morphology
       (when morph
@@ -1275,7 +1270,6 @@ XXX In processing subnodes, each case will prepend a space if it needs it."
     (save-excursion
       ;; Remove the module name from the buffer.
       (while (re-search-forward (concat "^.*" bible-module ".*$") nil t)
-	;;      (message "Replacing %s" (concat "(" bible-module ")"))
 	(replace-match "" nil t)))
 
     ;; Deal with chapter titles (i.e. in Psalms)
@@ -1288,6 +1282,7 @@ XXX In processing subnodes, each case will prepend a space if it needs it."
 	      (refstart (point-min))
 	      refend)
 	  (when (stringp title-text)
+	    ;; Clear out XML stuff.
 	    (setf title-text (replace-regexp-in-string "<.*?>" "" title-text))
 	    (insert title-text "\n")
 	    (setq refend (point))
@@ -1421,7 +1416,6 @@ XXX In processing subnodes, each case will prepend a space if it needs it."
 
     (setq match 0)
     (setq verses (sort verses :key nil :lessp #'(lambda (s1 s2) (string-version-lessp s1 s2))))
-;;    (message "Verses: %s" verses)
     (dolist (verse verses)
       (if query-verses
 	  (setq query-verses (concat query-verses ";" verse))