From: Richard M. Stallman Date: Fri, 16 Dec 2005 02:02:42 +0000 (+0000) Subject: (flyspell-external-point-words): Use save-excursion to ensure we don't X-Git-Tag: emacs-pretest-22.0.90~5260 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=324d09a608b38bf46b1aedea3e29d0c717d86dfe;p=emacs.git (flyspell-external-point-words): Use save-excursion to ensure we don't move backward in the search loop, not even one character. (flyspell-delete-all-overlays): Use remove-overlays directly. --- diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 402a3995795..4bea438bf2b 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -1332,10 +1332,9 @@ The buffer to mark them in is `flyspell-large-region-buffer'." (while keep (if (search-forward word flyspell-large-region-end t) - (progn + (save-excursion (goto-char (- (point) 1)) - (let* ((match-point (point)) ; flyspell-get-word might move it - (flyword-prev-l (flyspell-get-word nil)) + (let* ((flyword-prev-l (flyspell-get-word nil)) (flyword-prev (car flyword-prev-l)) (size-match (= (length flyword-prev) (length word)))) (when (or @@ -1362,7 +1361,7 @@ The buffer to mark them in is `flyspell-large-region-buffer'." (setq keep nil) (flyspell-word) ;; Next search will begin from end of last match - (setq flyspell-large-region-beg match-point)))) + ))) ;; Record if misspelling is not found and try new one (add-to-list 'words-not-found (concat " -> " word " - " @@ -1558,7 +1557,7 @@ FLYSPELL-BUFFER." (defun flyspell-delete-all-overlays () "Delete all the overlays used by flyspell." - (flyspell-delete-region-overlays (point-min) (point-max))) + (remove-overlays (point-min) (point-max) 'flyspell-overlay t)) ;;*---------------------------------------------------------------------*/ ;;* flyspell-unhighlight-at ... */