]> git.eshelyaron.com Git - emacs.git/commitdiff
Protect against declare-function undefined in xemacs.
authorAgustín Martín <agustin.martin@hispalinux.es>
Fri, 16 Jan 2009 14:04:35 +0000 (14:04 +0000)
committerAgustín Martín <agustin.martin@hispalinux.es>
Fri, 16 Jan 2009 14:04:35 +0000 (14:04 +0000)
(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.

lisp/ChangeLog
lisp/textmodes/ispell.el

index 3b5aeefc7eded79795388c37609a310a6690f9c3..4699cd0fd92797f0702e771467f507cf17cc3669 100644 (file)
@@ -1,3 +1,11 @@
+2009-01-16  Agustín Martín <agustin.martin@hispalinux.es>
+
+       * textmodes/ispell.el: 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.
+
 2009-01-16  Ulrich Mueller  <ulm@kph.uni-mainz.de>
 
        * international/quail.el (quail-insert-kbd-layout): Delete
index c31e965c9f0f9431363596cfc524f59d420b149d..49b6bee12581e501ef0990506c304d273c90efbc 100644 (file)
 
 ;;; Compatibility code for xemacs and (not too) older emacsen:
 
+(eval-and-compile ;; Protect against declare-function undefined in xemacs
+  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
+
 (declare-function ispell-check-minver "ispell" (v1 v2))
 
 (if (fboundp 'version<=)
@@ -328,7 +331,9 @@ Must be greater than 1."
   :group 'ispell)
 
 (defcustom ispell-program-name
-  (or (locate-file "aspell" exec-path exec-suffixes 'file-executable-p)
+  (or (locate-file "aspell"   exec-path exec-suffixes 'file-executable-p)
+      (locate-file "ispell"   exec-path exec-suffixes 'file-executable-p)
+      (locate-file "hunspell" exec-path exec-suffixes 'file-executable-p)
       "ispell")
   "Program invoked by \\[ispell-word] and \\[ispell-region] commands."
   :type 'string
@@ -911,8 +916,8 @@ Internal use.")
 
 (defun ispell-find-aspell-dictionaries ()
   "Find Aspell's dictionaries, and record in `ispell-dictionary-alist'."
-  (unless ispell-really-aspell
-    (error "This function only works with aspell"))
+  (unless (and ispell-really-aspell ispell-encoding8-command)
+    (error "This function only works with aspell >= 0.60."))
   (let* ((dictionaries
          (split-string
           (with-temp-buffer
@@ -932,10 +937,10 @@ Internal use.")
        (setq found (nconc found (list dict)))))
     (setq ispell-aspell-dictionary-alist found)
     ;; Add a default entry
-    (let* ((english-dict (assoc "en" ispell-dictionary-alist))
+    (let* ((english-dict (assoc "en" ispell-aspell-dictionary-alist))
           (default-dict
             (cons nil (or (cdr english-dict)
-                          (cdr (car ispell-dictionary-base-alist))))))
+                          '("[[:alpha:]]" "[^[:alpha:]]" "[']" nil ("-B") nil utf-8)))))
       (push default-dict ispell-aspell-dictionary-alist))))
 
 (defvar ispell-aspell-data-dir nil