diff options
| author | Eli Zaretskii | 2005-09-24 10:46:03 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2005-09-24 10:46:03 +0000 |
| commit | 999f7d65195dbc448c2bbfe3de7db91fbf2108ec (patch) | |
| tree | 18574b2dfeb1a493caacd3f633aecb5f9e843efc /lisp | |
| parent | d74a5c919c2b1dddfd72e9220db5009d1b41ded7 (diff) | |
| download | emacs-999f7d65195dbc448c2bbfe3de7db91fbf2108ec.tar.gz emacs-999f7d65195dbc448c2bbfe3de7db91fbf2108ec.zip | |
(ispell-maybe-find-aspell-dictionaries): New function, code extracted from
ispell-valid-dictionary-list.
(ispell-valid-dictionary-list, ispell-accept-buffer-local-defs): Call it.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/textmodes/ispell.el | 19 |
2 files changed, 19 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e4ba2de1504..db35b6631dc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2005-09-24 Magnus Henoch <mange@freemail.hu> | ||
| 2 | |||
| 3 | * textmodes/ispell.el (ispell-maybe-find-aspell-dictionaries): New | ||
| 4 | function, code extracted from ispell-valid-dictionary-list. | ||
| 5 | (ispell-valid-dictionary-list, ispell-accept-buffer-local-defs): | ||
| 6 | Call it. | ||
| 7 | |||
| 1 | 2005-09-24 Eli Zaretskii <eliz@gnu.org> | 8 | 2005-09-24 Eli Zaretskii <eliz@gnu.org> |
| 2 | 9 | ||
| 3 | * subr.el (version-regexp-alist): Extend valid syntax for version | 10 | * subr.el (version-regexp-alist): Extend valid syntax for version |
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 1259b607b1f..b811d963fc4 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el | |||
| @@ -880,6 +880,16 @@ and added as a submenu of the \"Edit\" menu.") | |||
| 880 | (defvar ispell-have-aspell-dictionaries nil | 880 | (defvar ispell-have-aspell-dictionaries nil |
| 881 | "Non-nil if we have queried Aspell for dictionaries at least once.") | 881 | "Non-nil if we have queried Aspell for dictionaries at least once.") |
| 882 | 882 | ||
| 883 | (defun ispell-maybe-find-aspell-dictionaries () | ||
| 884 | "Find Aspell's dictionaries, unless already done." | ||
| 885 | (when (and (not ispell-have-aspell-dictionaries) | ||
| 886 | (condition-case () | ||
| 887 | (progn (ispell-check-version) t) | ||
| 888 | (error nil)) | ||
| 889 | ispell-really-aspell | ||
| 890 | ispell-aspell-supports-utf8) | ||
| 891 | (ispell-find-aspell-dictionaries))) | ||
| 892 | |||
| 883 | (defun ispell-find-aspell-dictionaries () | 893 | (defun ispell-find-aspell-dictionaries () |
| 884 | "Find Aspell's dictionaries, and record in `ispell-dictionary-alist'." | 894 | "Find Aspell's dictionaries, and record in `ispell-dictionary-alist'." |
| 885 | (interactive) | 895 | (interactive) |
| @@ -976,13 +986,7 @@ Assumes that value contains no whitespace." | |||
| 976 | "Returns a list of valid dictionaries. | 986 | "Returns a list of valid dictionaries. |
| 977 | The variable `ispell-library-directory' defines the library location." | 987 | The variable `ispell-library-directory' defines the library location." |
| 978 | ;; If Ispell is really Aspell, query it for the dictionary list. | 988 | ;; If Ispell is really Aspell, query it for the dictionary list. |
| 979 | (when (and (not ispell-have-aspell-dictionaries) | 989 | (ispell-maybe-find-aspell-dictionaries) |
| 980 | (condition-case () | ||
| 981 | (progn (ispell-check-version) t) | ||
| 982 | (error nil)) | ||
| 983 | ispell-really-aspell | ||
| 984 | ispell-aspell-supports-utf8) | ||
| 985 | (ispell-find-aspell-dictionaries)) | ||
| 986 | (let ((dicts (append ispell-local-dictionary-alist ispell-dictionary-alist)) | 990 | (let ((dicts (append ispell-local-dictionary-alist ispell-dictionary-alist)) |
| 987 | (dict-list (cons "default" nil)) | 991 | (dict-list (cons "default" nil)) |
| 988 | name load-dict) | 992 | name load-dict) |
| @@ -3573,6 +3577,7 @@ You can bind this to the key C-c i in GNUS or mail by adding to | |||
| 3573 | 3577 | ||
| 3574 | (defun ispell-accept-buffer-local-defs () | 3578 | (defun ispell-accept-buffer-local-defs () |
| 3575 | "Load all buffer-local information, restarting Ispell when necessary." | 3579 | "Load all buffer-local information, restarting Ispell when necessary." |
| 3580 | (ispell-maybe-find-aspell-dictionaries) | ||
| 3576 | (ispell-buffer-local-dict) ; May kill ispell-process. | 3581 | (ispell-buffer-local-dict) ; May kill ispell-process. |
| 3577 | (ispell-buffer-local-words) ; Will initialize ispell-process. | 3582 | (ispell-buffer-local-words) ; Will initialize ispell-process. |
| 3578 | (ispell-buffer-local-parsing)) | 3583 | (ispell-buffer-local-parsing)) |