[Top][All Lists]

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

ispell.el word list length

From: Juri Linkov
Subject: ispell.el word list length
Date: Sun, 03 Jul 2005 03:05:45 +0300
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

It's hard to believe that such a popular and old package as ispell.el
has a trivial and easily reproducible bug.  When the length of the
returned look-up words is greater than 256, then ispell.el fails with
the error "Invalid character: 0400, 256, 0x100".

Steps to reproduce: type a non-dictionary word, type `M-$' on it,
type `l' and a string containing wildcards like `ac*'.

The patch below avoids this error by restricting the number of
displayed words to 256.  But I wonder are characters between
127 and 256 are useful?  How users are supposed to type them?
The code in ispell.el takes into account the fact that codes
above 127 are displayed in octal notation which increases the
length of displayed text to 3 per character (see the condition
`(if (> count ?~) 3 0)').

Index: lisp/textmodes/ispell.el
RCS file: /cvsroot/emacs/emacs/lisp/textmodes/ispell.el,v
retrieving revision 1.167
diff -c -r1.167 ispell.el
*** lisp/textmodes/ispell.el    28 Jun 2005 22:02:13 -0000      1.167
--- lisp/textmodes/ispell.el    3 Jul 2005 00:03:32 -0000
*** 1818,1819 ****
                                    choices miss
                                    line ispell-choices-win-default-height)
                              (while (and choices ; adjust choices window.
+                                         (< count 256)
                                          (< (if (> (+ 7 (current-column)
                                                       (length (car choices))
                                                       (if (> count ?~) 3 0))

Juri Linkov

reply via email to

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