changeset 107165:4d9e7dad66a0

* textmodes/flyspell.el (flyspell-word): Obey the offset specified by ispell-parse-output (Bug#5575).
author Chong Yidong <cyd@stupidchicken.com>
date Tue, 16 Feb 2010 09:23:44 -0500
parents 93e81200b4dd
children 87681b1f74ce
files lisp/ChangeLog lisp/textmodes/flyspell.el
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Tue Feb 16 16:41:11 2010 +0900
+++ b/lisp/ChangeLog	Tue Feb 16 09:23:44 2010 -0500
@@ -1,3 +1,8 @@
+2010-02-16  Chong Yidong  <cyd@stupidchicken.com>
+
+	* textmodes/flyspell.el (flyspell-word): Obey the offset specified
+	by ispell-parse-output (Bug#5575).
+
 2010-02-16  Kenichi Handa  <handa@m17n.org>
 
 	* international/ja-dic-cnv.el (iso-2022-7bit-short): Delete it.
--- a/lisp/textmodes/flyspell.el	Tue Feb 16 16:41:11 2010 +0900
+++ b/lisp/textmodes/flyspell.el	Tue Feb 16 09:23:44 2010 -0500
@@ -1155,10 +1155,15 @@
 			      nil)
 			     (t
 			      (setq flyspell-word-cache-result nil)
-			      ;; incorrect highlight the location
+			      ;; Highlight the location as incorrect,
+			      ;; including offset specified in POSS.
 			      (if flyspell-highlight-flag
 				  (flyspell-highlight-incorrect-region
-				   start end poss)
+				   (if (and (consp poss)
+					    (integerp (nth 1 poss)))
+				       (+ start (nth 1 poss) -1)
+				     start)
+				   end poss)
 				(flyspell-notify-misspell word poss))
 			      nil))))
 	      ;; return to original location