emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug 130397


From: Stefan Monnier
Subject: Re: Bug 130397
Date: Tue, 04 Jan 2005 23:42:15 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

>> Why can't ispell.el just use the `w' syntax to decide what is a word and
>> then rely on the decoding/encoding to do the rest of the work?

>> That would fix the problem where a word like "expérience" is checked as two
>> words if the dictionary is "american".

> That will cause another problem.  For instance, when we have
> "español" in a buffer and the ispell dictionary is czech
> (latin-2), as "español" is encoded into "espa?ol" by
> latin-2, it causes the error "Ispell and its process have
> different character maps" because ispell returns the result
> of two words "eapa" and "ol".

But ispell.el should be able to automatically check whether the chars can be
safely encoded with the coding-system and if not (as in your example),
ispell.el will know that the word can't be checked by ispell and should
just be skipped (and maybe marked as "uncheckable").

>>> +           (string-as-multibyte
>>> +            (mapconcat
>>> +             #'(lambda (c)
>>> +                 (let ((unichar (aref ucs-mule-8859-to-mule-unicode c)))
>>> +                   (if unichar
>>> +                       (aref ispell-unified-chars-table unichar)
>>> +                     (string c))))
>>> +             str ""))))

>> Do you expect the output of mapconcat to be unibyte and to contain
>> emacs-mule encoding of multibyte chars?

> No.  STR may be an ASCII-only string, in which case, the
> result of mapconcat is a unibyte ASCII-only string.  I'd
> like to change it to a multibyte ASCII-only stirng to avoid
> converting STR again and again in such a case.

Then string-to-multibyte sounds like a safer choice.
`string-as-multibyte' has very strange semantics, I recommend we avoid it as
much as possible.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]