Commit 75662d96 authored by Juri Linkov's avatar Juri Linkov
Browse files

(ispell-word): Call `ispell-region' on the active region in transient-mark-mode.

(ispell-region): Change messages displayed at the start and end of
the spell-checking to be the same.
parent faa3d27b
......@@ -1594,8 +1594,12 @@ nil word is correct or spelling is accepted.
quit spell session exited."
(interactive (list ispell-following-word ispell-quietly current-prefix-arg))
(if continue
((and transient-mark-mode mark-active
(not (eq (region-beginning) (region-end))))
(ispell-region (region-beginning) (region-end)))
(continue (ispell-continue))
(ispell-accept-buffer-local-defs) ; use the correct dictionary
(let ((cursor-location (point)) ; retain cursor location
......@@ -1690,7 +1694,7 @@ quit spell session exited."
;; NB: Cancels ispell-quit incorrectly if called from ispell-region
(if ispell-quit (setq ispell-quit nil replace 'quit))
(goto-char cursor-location) ; return to original location
(defun ispell-get-word (following &optional extra-otherchars)
......@@ -2683,7 +2687,7 @@ Return nil if spell session is quit,
(rstart (make-marker)))
(message "Spell checking %s using %s with %s dictionary..."
(message "Spell-checking %s using %s with %s dictionary..."
(if (and (= reg-start (point-min)) (= reg-end (point-max)))
(buffer-name) "region")
(file-name-nondirectory ispell-program-name)
......@@ -2782,7 +2786,9 @@ Return nil if spell session is quit,
(if (not recheckp) (set-marker ispell-region-end nil))
;; Only save if successful exit.
(ispell-pdict-save ispell-silently-savep)
(message "Spell-checking using %s with %s dictionary done"
(message "Spell-checking %s using %s with %s dictionary done"
(if (and (= reg-start (point-min)) (= reg-end (point-max)))
(buffer-name) "region")
(file-name-nondirectory ispell-program-name)
(or ispell-current-dictionary "default"))))))
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