# HG changeset patch # User Richard M. Stallman # Date 1153933867 0 # Node ID c7889d24e9d77a1565125fb8f894b863db522caf # Parent b5439b7a1ef19dcffd389d404624424a7c3539b8 (ispell-word): If we replace the word, move point to the end. Insert before deleting. diff -r b5439b7a1ef1 -r c7889d24e9d7 lisp/textmodes/ispell.el --- a/lisp/textmodes/ispell.el Wed Jul 26 09:55:10 2006 +0000 +++ b/lisp/textmodes/ispell.el Wed Jul 26 17:11:07 2006 +0000 @@ -1650,9 +1650,15 @@ cursor-location)) (if (not (equal new-word (car poss))) (progn - (delete-region start end) - (setq start (point)) + (goto-char start) + ;; Insert first and then delete, + ;; to avoid collapsing markers before and after + ;; into a single place. (ispell-insert-word new-word) + (delete-region (point) (+ (point) (- end start))) + ;; It is meaningless to preserve the cursor position + ;; inside a word that has changed. + (setq cursor-location (point)) (setq end (point)))) (if (not (atom replace)) ;recheck spelling of replacement (progn