aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorRichard M. Stallman2005-12-16 02:02:42 +0000
committerRichard M. Stallman2005-12-16 02:02:42 +0000
commit324d09a608b38bf46b1aedea3e29d0c717d86dfe (patch)
tree80f18cd374574bdb5a6db5961fd472682b9195c7 /lisp/textmodes
parent09b2eb5e8c2a529279cdee5d8fb6c554f54d5538 (diff)
downloademacs-324d09a608b38bf46b1aedea3e29d0c717d86dfe.tar.gz
emacs-324d09a608b38bf46b1aedea3e29d0c717d86dfe.zip
(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.
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/flyspell.el9
1 files changed, 4 insertions, 5 deletions
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'."
1332 (while keep 1332 (while keep
1333 (if (search-forward word 1333 (if (search-forward word
1334 flyspell-large-region-end t) 1334 flyspell-large-region-end t)
1335 (progn 1335 (save-excursion
1336 (goto-char (- (point) 1)) 1336 (goto-char (- (point) 1))
1337 (let* ((match-point (point)) ; flyspell-get-word might move it 1337 (let* ((flyword-prev-l (flyspell-get-word nil))
1338 (flyword-prev-l (flyspell-get-word nil))
1339 (flyword-prev (car flyword-prev-l)) 1338 (flyword-prev (car flyword-prev-l))
1340 (size-match (= (length flyword-prev) (length word)))) 1339 (size-match (= (length flyword-prev) (length word))))
1341 (when (or 1340 (when (or
@@ -1362,7 +1361,7 @@ The buffer to mark them in is `flyspell-large-region-buffer'."
1362 (setq keep nil) 1361 (setq keep nil)
1363 (flyspell-word) 1362 (flyspell-word)
1364 ;; Next search will begin from end of last match 1363 ;; Next search will begin from end of last match
1365 (setq flyspell-large-region-beg match-point)))) 1364 )))
1366 ;; Record if misspelling is not found and try new one 1365 ;; Record if misspelling is not found and try new one
1367 (add-to-list 'words-not-found 1366 (add-to-list 'words-not-found
1368 (concat " -> " word " - " 1367 (concat " -> " word " - "
@@ -1558,7 +1557,7 @@ FLYSPELL-BUFFER."
1558 1557
1559(defun flyspell-delete-all-overlays () 1558(defun flyspell-delete-all-overlays ()
1560 "Delete all the overlays used by flyspell." 1559 "Delete all the overlays used by flyspell."
1561 (flyspell-delete-region-overlays (point-min) (point-max))) 1560 (remove-overlays (point-min) (point-max) 'flyspell-overlay t))
1562 1561
1563;;*---------------------------------------------------------------------*/ 1562;;*---------------------------------------------------------------------*/
1564;;* flyspell-unhighlight-at ... */ 1563;;* flyspell-unhighlight-at ... */