Commit 76a47494 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(ispell-word): If we replace the word, move point to the end.

Insert before deleting.
parent 1cf87ac6
......@@ -1650,9 +1650,15 @@ quit spell session exited."
(if (not (equal new-word (car poss)))
(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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment