diff options
| author | Richard M. Stallman | 2006-09-14 01:19:38 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2006-09-14 01:19:38 +0000 |
| commit | 9c0fad71d954207e4e7b10c305563324939cba95 (patch) | |
| tree | 8be2b08e0086cc1091aca2d61afa8c1edfc45c4e | |
| parent | 2b3ffda0b5ac32eee9d2ede7e0612a63d268a599 (diff) | |
| download | emacs-9c0fad71d954207e4e7b10c305563324939cba95.tar.gz emacs-9c0fad71d954207e4e7b10c305563324939cba95.zip | |
(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.
| -rw-r--r-- | lisp/textmodes/flyspell.el | 21 |
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." | |||
| 992 | (flyspell-accept-buffer-local-defs) | 992 | (flyspell-accept-buffer-local-defs) |
| 993 | (let* ((cursor-location (point)) | 993 | (let* ((cursor-location (point)) |
| 994 | (flyspell-word (flyspell-get-word following)) | 994 | (flyspell-word (flyspell-get-word following)) |
| 995 | start end poss word) | 995 | start end poss word ispell-filter) |
| 996 | (if (or (eq flyspell-word nil) | 996 | (if (or (eq flyspell-word nil) |
| 997 | (and (fboundp flyspell-generic-check-word-predicate) | 997 | (and (fboundp flyspell-generic-check-word-predicate) |
| 998 | (not (funcall flyspell-generic-check-word-predicate)))) | 998 | (not (funcall flyspell-generic-check-word-predicate)))) |
| @@ -1050,7 +1050,12 @@ Mostly we check word delimiters." | |||
| 1050 | (not (string= "" (car ispell-filter)))))) | 1050 | (not (string= "" (car ispell-filter)))))) |
| 1051 | ;; (ispell-send-string "!\n") | 1051 | ;; (ispell-send-string "!\n") |
| 1052 | ;; back to terse mode. | 1052 | ;; back to terse mode. |
| 1053 | ;; Remove leading empty element | ||
| 1053 | (setq ispell-filter (cdr ispell-filter)) | 1054 | (setq ispell-filter (cdr ispell-filter)) |
| 1055 | ;; ispell process should return something after word is sent. | ||
| 1056 | ;; Tag word as valid (i.e., skip) otherwise | ||
| 1057 | (or ispell-filter | ||
| 1058 | (setq ispell-filter '(*))) | ||
| 1054 | (if (consp ispell-filter) | 1059 | (if (consp ispell-filter) |
| 1055 | (setq poss (ispell-parse-output (car ispell-filter)))) | 1060 | (setq poss (ispell-parse-output (car ispell-filter)))) |
| 1056 | (let ((res (cond ((eq poss t) | 1061 | (let ((res (cond ((eq poss t) |
| @@ -1830,7 +1835,7 @@ This command proposes various successive corrections for the current word." | |||
| 1830 | (let ((start (car (cdr word))) | 1835 | (let ((start (car (cdr word))) |
| 1831 | (end (car (cdr (cdr word)))) | 1836 | (end (car (cdr (cdr word)))) |
| 1832 | (word (car word)) | 1837 | (word (car word)) |
| 1833 | poss) | 1838 | poss ispell-filter) |
| 1834 | (setq flyspell-auto-correct-word word) | 1839 | (setq flyspell-auto-correct-word word) |
| 1835 | ;; now check spelling of word. | 1840 | ;; now check spelling of word. |
| 1836 | (ispell-send-string "%\n") ;put in verbose mode | 1841 | (ispell-send-string "%\n") ;put in verbose mode |
| @@ -1839,7 +1844,12 @@ This command proposes various successive corrections for the current word." | |||
| 1839 | (while (progn | 1844 | (while (progn |
| 1840 | (accept-process-output ispell-process) | 1845 | (accept-process-output ispell-process) |
| 1841 | (not (string= "" (car ispell-filter))))) | 1846 | (not (string= "" (car ispell-filter))))) |
| 1847 | ;; Remove leading empty element | ||
| 1842 | (setq ispell-filter (cdr ispell-filter)) | 1848 | (setq ispell-filter (cdr ispell-filter)) |
| 1849 | ;; ispell process should return something after word is sent. | ||
| 1850 | ;; Tag word as valid (i.e., skip) otherwise | ||
| 1851 | (or ispell-filter | ||
| 1852 | (setq ispell-filter '(*))) | ||
| 1843 | (if (consp ispell-filter) | 1853 | (if (consp ispell-filter) |
| 1844 | (setq poss (ispell-parse-output (car ispell-filter)))) | 1854 | (setq poss (ispell-parse-output (car ispell-filter)))) |
| 1845 | (cond | 1855 | (cond |
| @@ -1980,7 +1990,7 @@ The word checked is the word at the mouse position." | |||
| 1980 | (let ((start (car (cdr word))) | 1990 | (let ((start (car (cdr word))) |
| 1981 | (end (car (cdr (cdr word)))) | 1991 | (end (car (cdr (cdr word)))) |
| 1982 | (word (car word)) | 1992 | (word (car word)) |
| 1983 | poss) | 1993 | poss ispell-filter) |
| 1984 | ;; now check spelling of word. | 1994 | ;; now check spelling of word. |
| 1985 | (ispell-send-string "%\n") ;put in verbose mode | 1995 | (ispell-send-string "%\n") ;put in verbose mode |
| 1986 | (ispell-send-string (concat "^" word "\n")) | 1996 | (ispell-send-string (concat "^" word "\n")) |
| @@ -1988,7 +1998,12 @@ The word checked is the word at the mouse position." | |||
| 1988 | (while (progn | 1998 | (while (progn |
| 1989 | (accept-process-output ispell-process) | 1999 | (accept-process-output ispell-process) |
| 1990 | (not (string= "" (car ispell-filter))))) | 2000 | (not (string= "" (car ispell-filter))))) |
| 2001 | ;; Remove leading empty element | ||
| 1991 | (setq ispell-filter (cdr ispell-filter)) | 2002 | (setq ispell-filter (cdr ispell-filter)) |
| 2003 | ;; ispell process should return something after word is sent. | ||
| 2004 | ;; Tag word as valid (i.e., skip) otherwise | ||
| 2005 | (or ispell-filter | ||
| 2006 | (setq ispell-filter '(*))) | ||
| 1992 | (if (consp ispell-filter) | 2007 | (if (consp ispell-filter) |
| 1993 | (setq poss (ispell-parse-output (car ispell-filter)))) | 2008 | (setq poss (ispell-parse-output (car ispell-filter)))) |
| 1994 | (cond | 2009 | (cond |