Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#24 Patch for Ispell.el to improve UTF-8 support, misc.

other
open
None
5
2011-06-26
2004-04-30
J. J. Ramsey
No

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.

Discussion

1 2 > >> (Page 1 of 2)
  • J. J. Ramsey
    J. J. Ramsey
    2004-04-30

    Patch for ispell.el 3.7 beta

     
    Attachments
  • Kevin Atkinson
    Kevin Atkinson
    2004-05-14

    • assigned_to: nobody --> kevina
     
  • Kevin Atkinson
    Kevin Atkinson
    2004-10-22

    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/

     
  • J. J. Ramsey
    J. J. Ramsey
    2004-10-22

    Logged In: YES
    user_id=156375

    > Have you sumitted this to Ken Stevens?

    Yes, quite a while ago?

     
  • J. J. Ramsey
    J. J. Ramsey
    2004-12-31

    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.

     
  • J. J. Ramsey
    J. J. Ramsey
    2004-12-31

    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.

     
  • J. J. Ramsey
    J. J. Ramsey
    2004-12-31

    Revised patch for ispell.el 3.7 beta for Emacs 21.3.50

     
    Attachments
  • J. J. Ramsey
    J. J. Ramsey
    2005-01-27

    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.

     
  • J. J. Ramsey
    J. J. Ramsey
    2005-01-27

    Patch for ispell.el 3.7 beta to fix "Wrong type argument" error

     
    Attachments
  • 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,

     
1 2 > >> (Page 1 of 2)