--- ispell.el.orig 2010-10-18 13:20:35.000000000 +0200 +++ ispell.el 2010-10-18 13:20:45.000000000 +0200 @@ -983,17 +983,30 @@ (car (split-string (buffer-string))))) (defun ispell-aspell-find-dictionary (dict-name) + "Create a list of properties for a given aspell dictionary." + ;; Make sure this is defined + (or ispell-aspell-data-dir + (setq ispell-aspell-data-dir + (ispell-get-aspell-config-value "data-dir"))) ;; This returns nil if the data file does not exist. ;; Can someone please explain the return value format when the ;; file does exist -- rms? - (let* ((lang ;; Strip out variant, etc. - (and (string-match "^[[:alpha:]_]+" dict-name) - (match-string 0 dict-name))) + (let* ((datafile1 + (concat ispell-aspell-data-dir "/" + ;; Strip out variant, country code, etc. + (and (string-match "^[[:alpha:]]+" dict-name) + (match-string 0 dict-name)) ".dat")) + (datafile2 + (concat ispell-aspell-data-dir "/" + ;; Strip out anything but xx_YY. + (and (string-match "^[[:alpha:]_]+" dict-name) + (match-string 0 dict-name)) ".dat")) (data-file - (concat (or ispell-aspell-data-dir - (setq ispell-aspell-data-dir - (ispell-get-aspell-config-value "data-dir"))) - "/" lang ".dat")) + (if (file-readable-p datafile1) + datafile1 + (if (file-readable-p datafile2) + datafile2 + "No dat file found"))) otherchars) (condition-case () (with-temp-buffer