From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Newsgroups: gmane.emacs.help Subject: aspell dictionaries Date: Fri, 03 Sep 2010 11:01:59 +0200 Organization: Sebastien Vauban Message-ID: <871v9bb3p4.fsf@mundaneum.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1291866180 31896 80.91.229.12 (9 Dec 2010 03:43:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 03:43:00 +0000 (UTC) To: help-gnu-emacs-mXXj517/zsQ@public.gmane.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Thu Dec 09 04:42:55 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQXPD-0003u3-97 for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 04:42:55 +0100 Original-Received: from localhost ([127.0.0.1]:47828 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQXPC-0002QP-DN for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 22:42:54 -0500 Original-Path: usenet.stanford.edu!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 111 Injection-Date: Fri, 3 Sep 2010 09:01:59 +0000 (UTC) Injection-Info: mx03.eternal-september.org; posting-host="No+jx9xcG75RY5G9Zb0asg"; logging-data="744"; mail-complaints-to="abuse-VVbKFVtnif8H+i2N2EyTrmui9UKz+5OX@public.gmane.org"; posting-account="U2FsdGVkX181ghmh27zNVwJ9aeGk2/n/" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-Archive: encrypt Cancel-Lock: sha1:9FzM6FzyZjCMbfQrkNACoQuOGIA= sha1:eRC+Wgdz08TatemkhUr7HRnDnRg= X-Url: Under construction... Original-Xref: usenet.stanford.edu gnu.emacs.help:181100 X-BeenThere: help-gnu-emacs-mXXj517/zsQ@public.gmane.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Xref: news.gmane.org gmane.emacs.help:76569 Archived-At: Hello, In order to make my .emacs more robust to different PC installations, I wou= ld like to test for the presence of the French dictionary before loading it. Something like the following: --8<---------------cut here---------------start------------->8--- (setq ispell-dictionary-alist ;; those not here will result in "undefined dictionary" '( ;; default (nil "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil iso-8859-1) ;; Yankee English ("en_US" "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil utf-8))) ;; standard French (when (file-exists-p "/usr/lib/aspell/fr_FR") ; file can be opened for reading (add-to-list 'ispell-dictionary-alist '("fr_FR" "[a-z=C3=A0=C3=A2=C3=A4=C3=A9=C3=A8=C3=AA=C3=AB=C3=AE=C3= =AF=C3=B4=C3=B6=C3=B9=C3=BB=C3=BC=C3=A7A-Z=C3=80=C3=82=C3=84=C3=89=C3=88=C3= =8A=C3=8B=C3=8E=C3=8F=C3=94=C3=96=C3=99=C3=9B=C3=9C=C3=87]" "[^a-z=C3=A0=C3= =A2=C3=A4=C3=A9=C3=A8=C3=AA=C3=AB=C3=AE=C3=AF=C3=B4=C3=B6=C3=B9=C3=BB=C3=BC= =C3=A7A-Z=C3=80=C3=82=C3=84=C3=89=C3=88=C3=8A=C3=8B=C3=8E=C3=8F=C3=94=C3=96= =C3=99=C3=9B=C3=9C=C3=87]" "[-']" t nil "~list" utf-8) 'append)) --8<---------------cut here---------------end--------------->8--- My questions are: - which file do I have to test for its existence? There are so many differ= ent files for every language (not to mention differences between ispell, aspe= ll and hunspell dictionaries). Just an extract of /usr/lib/aspell/: --8<---------------cut here---------------start------------->8--- -rw-r--r-- 1 root root 78 2002-10-12 20:55 fr-40.multi lrwxrwxrwx 1 root root 30 2010-09-03 10:44 fr-40-only.rws -> /var/l= ib/aspell/fr-40-only.rws -rw-r--r-- 1 root root 78 2002-10-12 20:55 fr-60.multi lrwxrwxrwx 1 root root 30 2010-09-03 10:44 fr-60-only.rws -> /var/l= ib/aspell/fr-60-only.rws -rw-r--r-- 1 root root 78 2002-10-12 20:55 fr-80.multi lrwxrwxrwx 1 root root 30 2010-09-03 10:44 fr-80-only.rws -> /var/l= ib/aspell/fr-80-only.rws -rw-r--r-- 1 root root 78 2002-10-12 20:55 francais-40.alias -rw-r--r-- 1 root root 78 2002-10-12 20:55 francais-60.alias -rw-r--r-- 1 root root 78 2002-10-12 20:55 francais-80.alias -rw-r--r-- 1 root root 75 2002-10-12 20:55 francais.alias -rw-r--r-- 1 root root 78 2002-10-12 20:55 francais-lrg.alias -rw-r--r-- 1 root root 78 2002-10-12 20:55 francais-med.alias -rw-r--r-- 1 root root 78 2002-10-12 20:55 francais-sml.alias -rw-r--r-- 1 root root 97 2002-10-12 20:55 fr_CH-40.multi -rw-r--r-- 1 root root 116 2002-10-12 20:55 fr_CH-60.multi -rw-r--r-- 1 root root 135 2002-10-12 20:55 fr_CH-80.multi -rw-r--r-- 1 root root 78 2002-10-12 20:55 fr_CH-lrg.alias -rw-r--r-- 1 root root 78 2002-10-12 20:55 fr_CH-med.alias -rw-r--r-- 1 root root 78 2002-10-12 20:55 fr_CH.multi lrwxrwxrwx 1 root root 30 2010-09-03 10:44 fr_CH-only.rws -> /var/l= ib/aspell/fr_CH-only.rws -rw-r--r-- 1 root root 78 2002-10-12 20:55 fr_CH-sml.alias -rw-r--r-- 1 root root 126 2002-10-12 20:55 fr.dat -rw-r--r-- 1 root root 78 2002-10-12 20:55 french-40.alias -rw-r--r-- 1 root root 78 2002-10-12 20:55 french-60.alias -rw-r--r-- 1 root root 78 2002-10-12 20:55 french-80.alias -rw-r--r-- 1 root root 75 2002-10-12 20:55 french.alias -rw-r--r-- 1 root root 78 2002-10-12 20:55 french-lrg.alias -rw-r--r-- 1 root root 78 2002-10-12 20:55 french-med.alias -rw-r--r-- 1 root root 78 2002-10-12 20:55 french-sml.alias -rw-r--r-- 1 root root 78 2002-10-12 20:55 fr_FR-40.multi -rw-r--r-- 1 root root 97 2002-10-12 20:55 fr_FR-60.multi -rw-r--r-- 1 root root 116 2002-10-12 20:55 fr_FR-80.multi -rw-r--r-- 1 root root 78 2002-10-12 20:55 fr_FR-lrg.alias -rw-r--r-- 1 root root 78 2002-10-12 20:55 fr_FR-med.alias -rw-r--r-- 1 root root 78 2002-10-12 20:55 fr_FR.multi -rw-r--r-- 1 root root 78 2002-10-12 20:55 fr_FR-sml.alias -rw-r--r-- 1 root root 78 2002-10-12 20:55 fr-lrg.alias -rw-r--r-- 1 root root 78 2002-10-12 20:55 fr-med.alias -rw-r--r-- 1 root root 75 2002-10-12 20:55 fr.multi -rw-r--r-- 1 root root 2931 2001-06-13 05:16 fr_phonet.dat -rw-r--r-- 1 root root 78 2002-10-12 20:55 fr-sml.alias --8<---------------cut here---------------end--------------->8--- and of /var/lib/aspell/: --8<---------------cut here---------------start------------->8--- -rw-r--r-- 1 root root 5826736 2010-09-03 10:44 fr-40-only.rws -rw-r--r-- 1 root root 11590736 2010-09-03 10:44 fr-60-only.rws -rw-r--r-- 1 root root 334880 2010-09-03 10:44 fr-80-only.rws -rw-r--r-- 1 root root 2816 2010-09-03 10:44 fr_CH-only.rws -rw-r--r-- 1 root root 8 2010-09-03 10:44 fr.compat --8<---------------cut here---------------end--------------->8--- - How to alias fr_FR to the right dictionary files? Best regards, Seb --=20 S=C3=A9bastien Vauban