From: Richard M. Stallman Date: Wed, 26 Jul 2006 17:11:07 +0000 (+0000) Subject: (ispell-word): If we replace the word, move point to the end. X-Git-Tag: emacs-pretest-22.0.90~1238 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=76a47494979a5d169608d2f91eb89233257133e8;p=emacs.git (ispell-word): If we replace the word, move point to the end. Insert before deleting. --- diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index a4d873a543d..a0eb147d9c8 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -1650,9 +1650,15 @@ quit spell session exited." 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