--- ispell.el.orig 2010-07-05 11:31:21.000000000 +0200 +++ ispell.el 2010-07-05 13:25:03.000000000 +0200 @@ -357,21 +357,20 @@ :group 'ispell) (defcustom ispell-alternate-dictionary - (cond ((file-exists-p "/usr/dict/web2") "/usr/dict/web2") - ((file-exists-p "/usr/share/dict/web2") "/usr/share/dict/web2") - ((file-exists-p "/usr/dict/words") "/usr/dict/words") - ((file-exists-p "/usr/lib/dict/words") "/usr/lib/dict/words") - ((file-exists-p "/usr/share/dict/words") "/usr/share/dict/words") - ((file-exists-p "/usr/share/lib/dict/words") + (cond ((file-readable-p "/usr/dict/web2") "/usr/dict/web2") + ((file-readable-p "/usr/share/dict/web2") "/usr/share/dict/web2") + ((file-readable-p "/usr/dict/words") "/usr/dict/words") + ((file-readable-p "/usr/lib/dict/words") "/usr/lib/dict/words") + ((file-readable-p "/usr/share/dict/words") "/usr/share/dict/words") + ((file-readable-p "/usr/share/lib/dict/words") "/usr/share/lib/dict/words") - ((file-exists-p "/sys/dict") "/sys/dict") - (t "/usr/dict/words")) - "*Alternate dictionary for spelling help." + ((file-readable-p "/sys/dict") "/sys/dict")) + "*Alternate plain word-list dictionary for spelling help." :type '(choice file (const :tag "None" nil)) :group 'ispell) (defcustom ispell-complete-word-dict ispell-alternate-dictionary - "*Dictionary used for word completion." + "*Plain word-list dictionary used for word completion." :type '(choice file (const :tag "None" nil)) :group 'ispell) @@ -2273,6 +2272,12 @@ (if (null lookup-dict) (setq lookup-dict ispell-alternate-dictionary)) + (if lookup-dict + (unless (file-readable-p lookup-dict) + (error "lookup-words error: Unreadable or missing plain word-list %s." + lookup-dict)) + (error "lookup-words error: No plain word-list found at system default locations. Customize `ispell-alternate-dictionary' to set yours.")) + (let* ((process-connection-type ispell-use-ptys-p) (wild-p (string-match "\\*" word)) (look-p (and ispell-look-p ; Only use look for an exact match.