]> code.delx.au - gnu-emacs/commitdiff
(ispell-looking-at): New function.
authorKenichi Handa <handa@m17n.org>
Tue, 18 Jan 2005 23:20:18 +0000 (23:20 +0000)
committerKenichi Handa <handa@m17n.org>
Tue, 18 Jan 2005 23:20:18 +0000 (23:20 +0000)
(ispell-process-line): Use ispell-looking-at to compare the ispell
output and the buffer contents.

lisp/ChangeLog
lisp/textmodes/ispell.el

index 11485d1925122f32bd6056a9e94136872c1a7814..ed93ba934f60d221417db006dec64c20e5e41c17 100644 (file)
@@ -1,3 +1,9 @@
+2005-01-19  Kenichi Handa  <handa@m17n.org>
+
+       * textmodes/ispell.el (ispell-looking-at): New function.
+       (ispell-process-line): Use ispell-looking-at to compare the ispell
+       output and the buffer contents.
+
 2005-01-18  Jay Belanger  <belanger@truman.edu>
 
        * calc/calc.el (calc-display-raw): Fix docstring.
index 0c4aeb1bd244c0a76ec56349837453ffe7f546d2..2e8b1ab93c602a0c27051688f65b6d076d332f88 100644 (file)
@@ -1091,7 +1091,7 @@ Protects against bogus binding of `enable-multibyte-characters' in XEmacs."
     table))
 
 ;; Return a string decoded from Nth element of the current dictionary
-;; while splice equivalent characters into the string.  This splicing
+;; while splicing equivalent characters into the string.  This splicing
 ;; is done only if the string is a regular expression of the form
 ;; "[...]" because, otherwise, splicing will result in incorrect
 ;; regular expression matching.
@@ -2794,6 +2794,15 @@ Point is placed at end of skipped region."
     string))
 
 
+(defun ispell-looking-at (string)
+  (let ((coding (ispell-get-coding-system))
+       (len (length string)))
+    (and (<= (+ (point) len) (point-max))
+        (equal (encode-coding-string string coding)
+               (encode-coding-string (buffer-substring-no-properties
+                                      (point) (+ (point) len))
+                                     coding)))))
+
 ;;; Avoid error messages when compiling for these dynamic variables.
 (eval-when-compile
   (defvar start)
@@ -2842,12 +2851,7 @@ Returns the sum shift due to changes in word replacements."
 
            ;; Alignment cannot be tracked and this error will occur when
            ;; `query-replace' makes multiple corrections on the starting line.
-           (if (/= (+ word-len (point))
-                   (progn
-                     ;; NB: Search can fail with Mule coding systems that don't
-                     ;;  display properly.  Ignore the error in this case?
-                     (search-forward (car poss) (+ word-len (point)) t)
-                     (point)))
+           (or (ispell-looking-at (car poss))
                ;; This occurs due to filter pipe problems
                (error (concat "Ispell misalignment: word "
                               "`%s' point %d; probably incompatible versions")