diff options
| author | Agustín Martín | 2009-01-16 14:04:35 +0000 |
|---|---|---|
| committer | Agustín Martín | 2009-01-16 14:04:35 +0000 |
| commit | 034dc2a3e804d283319e12f110bd5715c2909f68 (patch) | |
| tree | 37a953e32af01014c214231306386e3ee5c68275 | |
| parent | 76472dc27000f6e6f8722359cc3c43d6faaf0acd (diff) | |
| download | emacs-034dc2a3e804d283319e12f110bd5715c2909f68.tar.gz emacs-034dc2a3e804d283319e12f110bd5715c2909f68.zip | |
Protect against declare-function undefined in xemacs.
(ispell-program-name): Search also for hunspell when setting default.
(ispell-find-aspell-dictionaries): Better error message. Use correct
dictionary alist for default. Better fallback default dictionary.
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/textmodes/ispell.el | 15 |
2 files changed, 18 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3b5aeefc7ed..4699cd0fd92 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2009-01-16 Agustín Martín <agustin.martin@hispalinux.es> | ||
| 2 | |||
| 3 | * textmodes/ispell.el: Protect against declare-function undefined | ||
| 4 | in xemacs. | ||
| 5 | (ispell-program-name): Search also for hunspell when setting default. | ||
| 6 | (ispell-find-aspell-dictionaries): Better error message. Use correct | ||
| 7 | dictionary alist for default. Better fallback default dictionary. | ||
| 8 | |||
| 1 | 2009-01-16 Ulrich Mueller <ulm@kph.uni-mainz.de> | 9 | 2009-01-16 Ulrich Mueller <ulm@kph.uni-mainz.de> |
| 2 | 10 | ||
| 3 | * international/quail.el (quail-insert-kbd-layout): Delete | 11 | * international/quail.el (quail-insert-kbd-layout): Delete |
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index c31e965c9f0..49b6bee1258 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el | |||
| @@ -198,6 +198,9 @@ | |||
| 198 | 198 | ||
| 199 | ;;; Compatibility code for xemacs and (not too) older emacsen: | 199 | ;;; Compatibility code for xemacs and (not too) older emacsen: |
| 200 | 200 | ||
| 201 | (eval-and-compile ;; Protect against declare-function undefined in xemacs | ||
| 202 | (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) | ||
| 203 | |||
| 201 | (declare-function ispell-check-minver "ispell" (v1 v2)) | 204 | (declare-function ispell-check-minver "ispell" (v1 v2)) |
| 202 | 205 | ||
| 203 | (if (fboundp 'version<=) | 206 | (if (fboundp 'version<=) |
| @@ -328,7 +331,9 @@ Must be greater than 1." | |||
| 328 | :group 'ispell) | 331 | :group 'ispell) |
| 329 | 332 | ||
| 330 | (defcustom ispell-program-name | 333 | (defcustom ispell-program-name |
| 331 | (or (locate-file "aspell" exec-path exec-suffixes 'file-executable-p) | 334 | (or (locate-file "aspell" exec-path exec-suffixes 'file-executable-p) |
| 335 | (locate-file "ispell" exec-path exec-suffixes 'file-executable-p) | ||
| 336 | (locate-file "hunspell" exec-path exec-suffixes 'file-executable-p) | ||
| 332 | "ispell") | 337 | "ispell") |
| 333 | "Program invoked by \\[ispell-word] and \\[ispell-region] commands." | 338 | "Program invoked by \\[ispell-word] and \\[ispell-region] commands." |
| 334 | :type 'string | 339 | :type 'string |
| @@ -911,8 +916,8 @@ Internal use.") | |||
| 911 | 916 | ||
| 912 | (defun ispell-find-aspell-dictionaries () | 917 | (defun ispell-find-aspell-dictionaries () |
| 913 | "Find Aspell's dictionaries, and record in `ispell-dictionary-alist'." | 918 | "Find Aspell's dictionaries, and record in `ispell-dictionary-alist'." |
| 914 | (unless ispell-really-aspell | 919 | (unless (and ispell-really-aspell ispell-encoding8-command) |
| 915 | (error "This function only works with aspell")) | 920 | (error "This function only works with aspell >= 0.60.")) |
| 916 | (let* ((dictionaries | 921 | (let* ((dictionaries |
| 917 | (split-string | 922 | (split-string |
| 918 | (with-temp-buffer | 923 | (with-temp-buffer |
| @@ -932,10 +937,10 @@ Internal use.") | |||
| 932 | (setq found (nconc found (list dict))))) | 937 | (setq found (nconc found (list dict))))) |
| 933 | (setq ispell-aspell-dictionary-alist found) | 938 | (setq ispell-aspell-dictionary-alist found) |
| 934 | ;; Add a default entry | 939 | ;; Add a default entry |
| 935 | (let* ((english-dict (assoc "en" ispell-dictionary-alist)) | 940 | (let* ((english-dict (assoc "en" ispell-aspell-dictionary-alist)) |
| 936 | (default-dict | 941 | (default-dict |
| 937 | (cons nil (or (cdr english-dict) | 942 | (cons nil (or (cdr english-dict) |
| 938 | (cdr (car ispell-dictionary-base-alist)))))) | 943 | '("[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-B") nil utf-8))))) |
| 939 | (push default-dict ispell-aspell-dictionary-alist)))) | 944 | (push default-dict ispell-aspell-dictionary-alist)))) |
| 940 | 945 | ||
| 941 | (defvar ispell-aspell-data-dir nil | 946 | (defvar ispell-aspell-data-dir nil |