Donate Share

GNU Aspell

Tracker: Patches

5 Patch for Ispell.el to improve UTF-8 support, misc. - ID: 945391
Last Update: Comment added ( agmartin )

I've attached a compressed diff that will apply cleanly
against the Ispell.el 3.7 beta dated 22 Sept 2003,
available from
<http://www.kdstevens.com/~stevens/ispell-page.html>.
If need be, it should not be hard to backport it to
Ispell.el 3.6, although as far as I can tell, what made
Ispell.el 3.7 a "beta" was that it used a couple
functions that were defined in the Ispell.el
maintainer's setup, but not by all Emacs users, and
those problems are fixed by this patch. The features of
the patch:

* If the "ispell" used by Emacs is really a version of
Aspell 0.50 or greater, then by default the encoding to
pass strings to and from the Ispell process is whatever
encoding Emacs uses to display the file being spell
checked. UTF-8 support is only available for Aspell
0.60 or better, and it works for Aspell 0.60
pre-release snapshots dated after 24 Apr 2004. This
feature can be turned off by setting
ispell-auto-detect-encoding to nil.

* By default the casechars, non-casechars, and
otherchars are determined from the encoding returned by
ispell-get-coding-system. I tried so set things up so
that foreign letters (i.e. accented characters)
would not be mistaken for word separators by the
ispell-word function or Flyspell. This feature can be
turned off by setting ispell-auto-detect-casechars to nil.

* The feature from the patch at
<ftp://ftp.gnu.org/gnu/aspell/ispell.el-aspell-0.1.diff>,
where Aspell is notified "of the replacements you make
so it can improve the suggestion list in the future",
has been integrated into this patch. Since for Aspell
to keep a record of replacements the personal
dictionary has to be saved, and apparently not all
Ispell.el users want this, this feature can be turned
off by setting
ispell-aspell-learn-from-user-misspelling to nil.


J. J. Ramsey ( jjramsey ) - 2004-04-30 15:59

5

Open

None

Kevin Atkinson

None

None

Public


Comments ( 6 )

Date: 2005-04-01 10:43
Sender: agmartin

Logged In: YES
user_id=368139

Looks like mime-charset is not a coding-system property for
xemacs,
Something like

(if (featurep 'xemacs)
(coding-system-name
(coding-system-base (ispell-get-coding-system)))
(coding-system-get (ispell-get-coding-system) 'mime-charset))

seems to work, although for 'no-conversion' will return
raw-text where I think emacs returns nil. I do not know if
there is a better way for this,


Date: 2005-01-27 15:38
Sender: jjramsey

Logged In: YES
user_id=156375

If the coding-system of the buffer was set to nil,
Ispell-mode would die with the error "coding-system-get:
Wrong type argument: arrayp, nil". This problem should be fixed.


Date: 2004-12-31 18:05
Sender: jjramsey

Logged In: YES
user_id=156375

Fixed (?) the regular expression used to determine what
characters belong to a word when the encoding is UTF-8--at
least I got it to the "works for me" stage. It should now
nominally cover all the languages Emacs and Aspell support,
even in Emacs 21.3.50. There seems to be some oddities in
Emacs 21.3.50 that affect how it handles CJK charsets.



Date: 2004-12-31 05:28
Sender: jjramsey

Logged In: YES
user_id=156375

In the last revision, the regular expression used to
determine what characters belong to a word was by default
determined by the encoding Emacs uses to display the file
being spell checked. This is still the case; however, Emacs
21.3.50 complained of ranges straddling charsets, so now the
regular expression only covers characters in Latin-based
languages. :( I'm not sure if the bug is in 21.3.50 or in
the regular expression I had before.



Date: 2004-10-22 15:10
Sender: jjramsey

Logged In: YES
user_id=156375

> Have you sumitted this to Ken Stevens?

Yes, quite a while ago?



Date: 2004-10-22 12:27
Sender: kevinaProject AdminAccepting Donations

Logged In: YES
user_id=6591

Have you sumitted this to Ken Stevens?

PS: I finally added a link to this patch at http://aspell.net/


Attached Files ( 3 )

Filename Description Download
ispell.diff.gz Patch for ispell.el 3.7 beta Download
ispell.diff.gz Revised patch for ispell.el 3.7 beta for Emacs 21.3.50 Download
ispell-new.diff.gz Patch for ispell.el 3.7 beta to fix "Wrong type argument" error Download

Changes ( 8 )

Field Old Value Date By
File Added 117392: ispell-new.diff.gz 2005-01-27 15:38 jjramsey
File Added 114039: ispell.diff.gz 2004-12-31 22:29 jjramsey
File Deleted 114013: 2004-12-31 22:29 jjramsey
File Added 114013: ispell.diff.gz 2004-12-31 18:05 jjramsey
File Deleted 113979: 2004-12-31 18:04 jjramsey
File Added 113979: ispell.diff.gz 2004-12-31 05:28 jjramsey
assigned_to nobody 2004-05-14 20:29 kevina
File Added 85641: ispell.diff.gz 2004-04-30 15:59 jjramsey