From: "Sébastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: help-gnu-emacs-mXXj517/zsQ@public.gmane.org
Subject: aspell dictionaries
Date: Fri, 03 Sep 2010 11:01:59 +0200 [thread overview]
Message-ID: <871v9bb3p4.fsf@mundaneum.com> (raw)
Hello,
In order to make my .emacs more robust to different PC installations, I would
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àâäéèêëîïôöùûüçA-ZÀÂÄÉÈÊËÎÏÔÖÙÛÜÇ]" "[^a-zàâäéèêëîïôöùûüçA-ZÀÂÄÉÈÊËÎÏÔÖÙÛÜÇ]"
"[-']" 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 different
files for every language (not to mention differences between ispell, aspell
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/lib/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/lib/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/lib/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/lib/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
--
Sébastien Vauban
reply other threads:[~2010-09-03 9:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871v9bb3p4.fsf@mundaneum.com \
--to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@public.gmane.org \
--cc=help-gnu-emacs-mXXj517/zsQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.