summaryrefslogtreecommitdiff
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2005-10-28 04:22:19 +0000
committerRichard M. Stallman <rms@gnu.org>2005-10-28 04:22:19 +0000
commitca7250cb5a7fdd3e1c93426e626c8a82872c79eb (patch)
tree99febababb2da4d152cd85b891c8d5e5cb902e59 /lisp/textmodes
parent93e7f889422e0d4475cd0ef248470e4125067f32 (diff)
downloademacs-ca7250cb5a7fdd3e1c93426e626c8a82872c79eb.tar.gz
(flyspell-large-region): Pass -t if Tex file.
(flyspell-external-point-words): Error if misspelled word is not found. Set flyspell-large-region-beg at end of word.
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/flyspell.el18
1 files changed, 12 insertions, 6 deletions
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index a876593e738..ee94ff01d64 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -1333,7 +1333,7 @@ The buffer to mark them in is `flyspell-large-region-buffer'."
;; Loop over incorrect words.
(while (re-search-forward "\\([^\n]+\\)\n" (point-max) t)
;; Bind WORD to the next one.
- (let ((word (match-string 1)))
+ (let ((word (match-string 1)) (wordpos (point)))
;; Here there used to be code to see if WORD is the same
;; as the previous iteration, and count the number of consecutive
;; identical words, and the loop below would search for that many.
@@ -1350,11 +1350,15 @@ The buffer to mark them in is `flyspell-large-region-buffer'."
(with-current-buffer flyspell-large-region-buffer
(goto-char flyspell-large-region-beg)
(let ((keep t))
- (while (and keep
- (search-forward word flyspell-large-region-end t))
- (goto-char (- (point) 1))
- (setq keep (flyspell-word)))
- (setq flyspell-large-region-beg (point))))))
+ (while keep
+ (if (search-forward word
+ flyspell-large-region-end t)
+ (progn
+ (setq flyspell-large-region-beg (point))
+ (goto-char (- (point) 1))
+ (setq keep (flyspell-word)))
+ (error "Bug: misspelled word `%s' (output pos %d) not found in buffer"
+ word wordpos)))))))
;; we are done
(if flyspell-issue-message-flag (message "Spell Checking completed.")))
;; Kill and forget the buffer with the list of incorrect words.
@@ -1389,6 +1393,8 @@ The buffer to mark them in is `flyspell-large-region-buffer'."
(if ispell-local-dictionary
(setq ispell-dictionary ispell-local-dictionary))
(setq args (ispell-get-ispell-args))
+ (if (eq ispell-parser 'tex)
+ (setq args (cons "-t" args)))
(if ispell-dictionary ; use specified dictionary
(setq args
(append (list "-d" ispell-dictionary) args)))