On Wed, Mar 16, 2005 at 02:32:57AM +0100, Reuben Thomas wrote:
> 
> Since the current version of dictionaries-common and aspell-0.60,
> spell checking in Emacs using aspell no longer works properly for me.
> 

Even if the problem has been triggered now, there is nothing new related
to this problem in either dictionaries-common or aspell not already present for
the last two years. 

I guess you did not notice that previously because you had no ispell dicts
at all installed and all the installed aspell dicts did not register for
use with the dictionaries-common system. The difference is that aspell-en
now does.

For that reason you were using ispell.el provided by emacs while now you are
using ispell.el provided by dictionaries-common. This latter is more recent,
but the system nulls the ispell-dictionary-alist provided by ispell.el and
refills it with the values provided by dict maintainers, either ispell or
aspell.

> A bit of background: I use accented characters in my British English
> words (as does the Oxford English Dictionary). Having looked over the
> new version of dictionaries-common, it seems what I need to do is add
> an entry to ispell-local-dictionary-alist. I erased my previous
> customisation of ispell-dictionary-alist, added one for
> ispell-local-dictionary-alist, and added accented letters to the case
> and non-case character classes. But words like "rôle"
> (r-ocircumflex-l-e) still get mangled: aspell flags up "le" as not a
> word, treating the ô as not a letter.
 
ispell.el is probably buggy related to ispell-local-dictionary-alist, while
it should read it everytime it gets casechars and so on, seems that it is
only read at load time before reading ~/.emacs. There is a patch for that
in the emacs21 CVS I was considering for adition, but in the meantime I
suggest you to use in ~/.emacs the same function
(debian-add-dictionary-entry) used by dictionaries-common for this, just
adding ñ and ô to ths {non}-casechars entries would look like

(debian-ispell-add-dictionary-entry
  '("british+accs"
    "[A-ZÑÔa-zñô]"
    "[^A-ZÑÔa-zñô]"
    "[']"
    nil
    ("-B" "-d" "british-w_accents")
    nil
    iso-8859-1)
  "aspell")

and then feed debian-ispell-dictionary-alist to ispell-dictionary-alist,

(setq ispell-dictionary-alist debian-ispell-dictionary-alist)

This way something like

-----------------------------------------
rôle

Local Variables:
ispell-program-name: "aspell"
ispell-local-dictionary: "british+accs"
End:
-----------------------------------------

should work, even if the dict is not shown as one of the possible values in
ispell-change-dictionary (it should with the current dictionaries-common
unstable version, 0.24.11, but I cannot check now).

If you are going to add more changes, or the unpatched ispell.el can be run
sometimes, is probably better to test for function availability,

(if (fboundp 'debian-ispell-add-dictionary-entry)
  (progn
    (debian-ispell-add-dictionary-entry ... )
    (debian-ispell-add-dictionary-entry ... )
  )
)

Using this function has the drawback that is too Debian specific, but has
another advantages for the future. On the one hand it should allow the entry
be shown as one of the possible values for ispell-change-dictionary
(although not in the popup menus). On the other hand, the trailing "aspell"
is currently not used, but is intended to mean that the dict is available for
aspell only. In the future I would like, for systems having both ispell and
aspell installed, allow an automatic selection of the spellchecker program
based on the value of ispell-program-name and dict availability for that
entry and spellchecker. I have promising code for this, but requires
flyspell.el modification and a lot of testing.

I have definitely to write something about this in the README file. That
should close the bug report.

Thanks for yur feedback,

Cheers,

-- 
Agustin

Reply via email to