comparison lisp/textmodes/ispell.el @ 90228:fa0da9b57058

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-82 Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 542-553) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 116-121) - Merge from emacs--cvs-trunk--0 - Update from CVS
author Miles Bader <miles@gnu.org>
date Mon, 19 Sep 2005 10:20:33 +0000
parents 10fe5fadaf89 703495630901
children ee12d75eb214
comparison
equal deleted inserted replaced
90227:10fe5fadaf89 90228:fa0da9b57058
717 contain the same character set as casechars and otherchars in the 717 contain the same character set as casechars and otherchars in the
718 LANGUAGE.aff file \(e.g., english.aff\).") 718 LANGUAGE.aff file \(e.g., english.aff\).")
719 719
720 (defvar ispell-really-aspell nil) ; Non-nil if aspell extensions should be used 720 (defvar ispell-really-aspell nil) ; Non-nil if aspell extensions should be used
721 721
722 (defvar ispell-aspell-supports-utf8 nil
723 "Non-nil means to try to automatically find aspell dictionaries.
724 This is set to t in ispell-check-version for aspell >= 0.60.
725
726 Earlier aspell versions do not consistently support UTF-8. Handling
727 this would require some extra guessing in `ispell-aspell-find-dictionary'.")
722 728
723 729
724 730
725 ;;; ********************************************************************** 731 ;;; **********************************************************************
726 ;;; The following are used by ispell, and should not be changed. 732 ;;; The following are used by ispell, and should not be changed.
780 (end-of-line) 786 (end-of-line)
781 (setq result (concat (buffer-substring-no-properties (point-min) 787 (setq result (concat (buffer-substring-no-properties (point-min)
782 (point)) 788 (point))
783 ", " 789 ", "
784 ispell-version)) 790 ispell-version))
785 (message result)) 791 (message "%s" result))
786 ;; return library directory. 792 ;; return library directory.
787 (if (re-search-forward "LIBDIR = \\\"\\([^ \t\n]*\\)\\\"" nil t) 793 (if (re-search-forward "LIBDIR = \\\"\\([^ \t\n]*\\)\\\"" nil t)
788 (setq result (buffer-substring (match-beginning 1) (match-end 1))))) 794 (setq result (buffer-substring (match-beginning 1) (match-end 1)))))
789 (goto-char (point-min)) 795 (goto-char (point-min))
790 (if (not (memq status '(0 nil))) 796 (if (not (memq status '(0 nil)))
812 (setq ispell-offset 0)) 818 (setq ispell-offset 0))
813 ;; Check to see if it's really aspell. 819 ;; Check to see if it's really aspell.
814 (goto-char (point-min)) 820 (goto-char (point-min))
815 (let (case-fold-search) 821 (let (case-fold-search)
816 (setq ispell-really-aspell 822 (setq ispell-really-aspell
817 (and (search-forward-regexp "(but really Aspell \\(.*\\))" nil t) 823 (and (search-forward-regexp
818 (if (version< (match-string 1) "0.60") 824 "(but really Aspell \\(.*\\))" nil t)
819 (error "aspell version 0.60 or greater is required") 825 (progn
826 (setq ispell-aspell-supports-utf8
827 (not (version< (match-string 1) "0.60")))
820 t))))) 828 t)))))
821 (kill-buffer (current-buffer))) 829 (kill-buffer (current-buffer)))
822 result)) 830 result))
823 831
824 832
970 ;; If Ispell is really Aspell, query it for the dictionary list. 978 ;; If Ispell is really Aspell, query it for the dictionary list.
971 (when (and (not ispell-have-aspell-dictionaries) 979 (when (and (not ispell-have-aspell-dictionaries)
972 (condition-case () 980 (condition-case ()
973 (progn (ispell-check-version) t) 981 (progn (ispell-check-version) t)
974 (error nil)) 982 (error nil))
975 ispell-really-aspell) 983 ispell-really-aspell
984 ispell-aspell-supports-utf8)
976 (ispell-find-aspell-dictionaries)) 985 (ispell-find-aspell-dictionaries))
977 (let ((dicts (append ispell-local-dictionary-alist ispell-dictionary-alist)) 986 (let ((dicts (append ispell-local-dictionary-alist ispell-dictionary-alist))
978 (dict-list (cons "default" nil)) 987 (dict-list (cons "default" nil))
979 name load-dict) 988 name load-dict)
980 (dolist (dict dicts) 989 (dolist (dict dicts)
2346 ((string= output "-") t) ; compound word match 2355 ((string= output "-") t) ; compound word match
2347 ((eq (aref output 0) ?+) ; found because of root word 2356 ((eq (aref output 0) ?+) ; found because of root word
2348 (substring output 2)) ; return root word 2357 (substring output 2)) ; return root word
2349 ((equal 0 (string-match "[\ra-zA-Z]" output)) 2358 ((equal 0 (string-match "[\ra-zA-Z]" output))
2350 (ding) ; error message from ispell! 2359 (ding) ; error message from ispell!
2351 (message (concat "Ispell error: " output)) 2360 (message "Ispell error: %s" output)
2352 (sit-for 5) 2361 (sit-for 5)
2353 nil) 2362 nil)
2354 (t ; need to process &, ?, and #'s 2363 (t ; need to process &, ?, and #'s
2355 (let ((type (aref output 0)) ; &, ?, or # 2364 (let ((type (aref output 0)) ; &, ?, or #
2356 (original-word (substring output 2 (string-match " " output 2))) 2365 (original-word (substring output 2 (string-match " " output 2)))