1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-17 03:10:58 -08:00

(ispell-get-word): No error if can't find a word to check.

(ispell-word): Don't fuss about a word if not adjacent to it.
(ispell-minor-check): Use save-excursion.
This commit is contained in:
Richard M. Stallman 1998-04-17 03:37:10 +00:00
parent 0de86efccd
commit 909f0455e0

View file

@ -882,8 +882,11 @@ or \\[ispell-region] to update the Ispell process."
quietly ispell-quietly))
(ispell-accept-buffer-local-defs) ; use the correct dictionary
(let ((cursor-location (point)) ; retain cursor location
(opoint (point))
(word (ispell-get-word following))
start end poss replace)
(unless (or (equal (car word) "")
(< (nth 2 word) opoint))
;; destructure return word info list.
(setq start (car (cdr word))
end (car (cdr (cdr word)))
@ -939,7 +942,7 @@ or \\[ispell-region] to update the Ispell process."
(kill-buffer ispell-choices-buffer))))
(goto-char cursor-location) ; return to original location
(ispell-pdict-save ispell-silently-savep)
(if ispell-quit (setq ispell-quit nil)))))
(if ispell-quit (setq ispell-quit nil))))))
(defun ispell-get-word (following &optional extra-otherchars)
@ -991,12 +994,14 @@ Word syntax described by `ispell-dictionary-alist' (which see)."
(re-search-backward ispell-not-casechars (point-min) 'move)
(backward-char -1))))
;; Now mark the word and save to string.
(or (re-search-forward word-regexp (point-max) t)
(if (not (re-search-forward word-regexp (point-max) t))
(if ispell-check-only
(list "" (point) (point))
(error "No word found to check!"))
(setq start (match-beginning 0)
end (point)
word (buffer-substring-no-properties start end))
(list word start end)))
(list word start end))))
;;; Global ispell-pdict-modified-p is set by ispell-command-loop and
@ -2141,9 +2146,10 @@ warns you if the previous word is incorrectly spelled."
(interactive "*")
(let ((ispell-minor-mode nil)
(ispell-check-only t))
(save-excursion
(save-restriction
(narrow-to-region (point-min) (point))
(ispell-word nil t))
(ispell-word nil t)))
(call-interactively (key-binding (this-command-keys)))))