Mercurial > emacs
comparison lisp/textmodes/ispell.el @ 49085:18b672f173d2
(lookup-words): Cope with null lookup-dict.
author | Dave Love <fx@gnu.org> |
---|---|
date | Mon, 06 Jan 2003 20:46:57 +0000 |
parents | 759019dacc3f |
children | dd7295763a84 |
comparison
equal
deleted
inserted
replaced
49084:f43c7c8adcdf | 49085:18b672f173d2 |
---|---|
1238 ;; session in a buffer, and pass them anew each time we invoke | 1238 ;; session in a buffer, and pass them anew each time we invoke |
1239 ;; Ispell to process another chunk of text. (Yes, I know this is a | 1239 ;; Ispell to process another chunk of text. (Yes, I know this is a |
1240 ;; terrible kludge, and it's a bit slow, but it does get the work done.) | 1240 ;; terrible kludge, and it's a bit slow, but it does get the work done.) |
1241 (let ((cmd (aref string 0)) | 1241 (let ((cmd (aref string 0)) |
1242 ;; The following commands are not passed to Ispell until | 1242 ;; The following commands are not passed to Ispell until |
1243 ;; we have a *reall* reason to invoke it. | 1243 ;; we have a *real* reason to invoke it. |
1244 (cmds-to-defer '(?* ?@ ?~ ?+ ?- ?! ?%)) | 1244 (cmds-to-defer '(?* ?@ ?~ ?+ ?- ?! ?%)) |
1245 (default-major-mode 'fundamental-mode) | 1245 (default-major-mode 'fundamental-mode) |
1246 (session-buf ispell-session-buffer) | 1246 (session-buf ispell-session-buffer) |
1247 (output-buf ispell-output-buffer) | 1247 (output-buf ispell-output-buffer) |
1248 (ispell-args ispell-cmd-args) | 1248 (ispell-args ispell-cmd-args) |
1927 ;; convert * to .* | 1927 ;; convert * to .* |
1928 (insert "^" word "$") | 1928 (insert "^" word "$") |
1929 (while (search-backward "*" nil t) (insert ".")) | 1929 (while (search-backward "*" nil t) (insert ".")) |
1930 (setq word (buffer-string)) | 1930 (setq word (buffer-string)) |
1931 (erase-buffer)) | 1931 (erase-buffer)) |
1932 (setq status (call-process prog nil t nil args word lookup-dict)) | 1932 ;; Use apply since `lookup-dict' can be nil. |
1933 (setq status (apply #'call-process prog nil t nil args word lookup-dict)) | |
1933 ;; grep returns status 1 and no output when word not found, which | 1934 ;; grep returns status 1 and no output when word not found, which |
1934 ;; is a perfectly normal thing. | 1935 ;; is a perfectly normal thing. |
1935 (if (stringp status) | 1936 (if (stringp status) |
1936 (setq results (cons (format "error: %s exited with signal %s" | 1937 (setq results (cons (format "error: %s exited with signal %s" |
1937 (file-name-nondirectory prog) status) | 1938 (file-name-nondirectory prog) status) |