summaryrefslogtreecommitdiff
path: root/lisp/textmodes/flyspell.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2006-09-14 01:19:38 +0000
committerRichard M. Stallman <rms@gnu.org>2006-09-14 01:19:38 +0000
commit9c0fad71d954207e4e7b10c305563324939cba95 (patch)
tree8be2b08e0086cc1091aca2d61afa8c1edfc45c4e /lisp/textmodes/flyspell.el
parent2b3ffda0b5ac32eee9d2ede7e0612a63d268a599 (diff)
downloademacs-9c0fad71d954207e4e7b10c305563324939cba95.tar.gz
(flyspell-word, flyspell-correct-word)
(flyspell-auto-correct-word): Make ispell-filter local to these functions. Check that ispell-filter has new stuff before calling ispell-parse-output.
Diffstat (limited to 'lisp/textmodes/flyspell.el')
-rw-r--r--lisp/textmodes/flyspell.el21
1 files changed, 18 insertions, 3 deletions
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 23f4756f4a7..34b6297a800 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -992,7 +992,7 @@ Mostly we check word delimiters."
(flyspell-accept-buffer-local-defs)
(let* ((cursor-location (point))
(flyspell-word (flyspell-get-word following))
- start end poss word)
+ start end poss word ispell-filter)
(if (or (eq flyspell-word nil)
(and (fboundp flyspell-generic-check-word-predicate)
(not (funcall flyspell-generic-check-word-predicate))))
@@ -1050,7 +1050,12 @@ Mostly we check word delimiters."
(not (string= "" (car ispell-filter))))))
;; (ispell-send-string "!\n")
;; back to terse mode.
+ ;; Remove leading empty element
(setq ispell-filter (cdr ispell-filter))
+ ;; ispell process should return something after word is sent.
+ ;; Tag word as valid (i.e., skip) otherwise
+ (or ispell-filter
+ (setq ispell-filter '(*)))
(if (consp ispell-filter)
(setq poss (ispell-parse-output (car ispell-filter))))
(let ((res (cond ((eq poss t)
@@ -1830,7 +1835,7 @@ This command proposes various successive corrections for the current word."
(let ((start (car (cdr word)))
(end (car (cdr (cdr word))))
(word (car word))
- poss)
+ poss ispell-filter)
(setq flyspell-auto-correct-word word)
;; now check spelling of word.
(ispell-send-string "%\n") ;put in verbose mode
@@ -1839,7 +1844,12 @@ This command proposes various successive corrections for the current word."
(while (progn
(accept-process-output ispell-process)
(not (string= "" (car ispell-filter)))))
+ ;; Remove leading empty element
(setq ispell-filter (cdr ispell-filter))
+ ;; ispell process should return something after word is sent.
+ ;; Tag word as valid (i.e., skip) otherwise
+ (or ispell-filter
+ (setq ispell-filter '(*)))
(if (consp ispell-filter)
(setq poss (ispell-parse-output (car ispell-filter))))
(cond
@@ -1980,7 +1990,7 @@ The word checked is the word at the mouse position."
(let ((start (car (cdr word)))
(end (car (cdr (cdr word))))
(word (car word))
- poss)
+ poss ispell-filter)
;; now check spelling of word.
(ispell-send-string "%\n") ;put in verbose mode
(ispell-send-string (concat "^" word "\n"))
@@ -1988,7 +1998,12 @@ The word checked is the word at the mouse position."
(while (progn
(accept-process-output ispell-process)
(not (string= "" (car ispell-filter)))))
+ ;; Remove leading empty element
(setq ispell-filter (cdr ispell-filter))
+ ;; ispell process should return something after word is sent.
+ ;; Tag word as valid (i.e., skip) otherwise
+ (or ispell-filter
+ (setq ispell-filter '(*)))
(if (consp ispell-filter)
(setq poss (ispell-parse-output (car ispell-filter))))
(cond