Re: PATCH for ticket 7026

2010-12-04 Thread Stephan Witt
Am 03.12.2010 um 19:38 schrieb Enrico Forestieri: On Fri, Dec 03, 2010 at 06:40:39PM +0100, Georg Baum wrote: Stephan Witt wrote: Am 03.12.2010 um 04:36 schrieb Enrico Forestieri: 2) replace all occurrences of isDigit() with isDigitASCII() I don't know. Unless somebody goes through

Re: PATCH for ticket 7026

2010-12-04 Thread Enrico Forestieri
On Sat, Dec 04, 2010 at 09:37:09PM +0100, Stephan Witt wrote: I made another patch for the topic. Enrico, Georg, do you have any plans yourself? I think you should also perform the substitution isDigit() - isDigitASCII() as they are duplicates, and ditch the isDigit() implementation in

Re: PATCH for ticket 7026

2010-12-04 Thread Stephan Witt
Am 03.12.2010 um 19:38 schrieb Enrico Forestieri: > On Fri, Dec 03, 2010 at 06:40:39PM +0100, Georg Baum wrote: > >> Stephan Witt wrote: >> >>> Am 03.12.2010 um 04:36 schrieb Enrico Forestieri: >>> 2) replace all occurrences of isDigit() with isDigitASCII() >> >> I don't know. Unless

Re: PATCH for ticket 7026

2010-12-04 Thread Enrico Forestieri
On Sat, Dec 04, 2010 at 09:37:09PM +0100, Stephan Witt wrote: > I made another patch for the topic. > Enrico, Georg, do you have any plans yourself? I think you should also perform the substitution isDigit() -> isDigitASCII() as they are duplicates, and ditch the isDigit() implementation in

Re: PATCH for ticket 7026

2010-12-03 Thread Georg Baum
Stephan Witt wrote: Am 03.12.2010 um 04:36 schrieb Enrico Forestieri: It's becoming a mess. We have isdigit(), isDigit(), isDigitASCII(), and now iswdigit() enters the scene. iswdigit() is POSIX standard for wchar_t arguments - our char_type is a typedef of wchar_t. But I don't insist

Re: PATCH for ticket 7026

2010-12-03 Thread Enrico Forestieri
On Fri, Dec 03, 2010 at 06:40:39PM +0100, Georg Baum wrote: Stephan Witt wrote: Am 03.12.2010 um 04:36 schrieb Enrico Forestieri: 2) replace all occurrences of isDigit() with isDigitASCII() I don't know. Unless somebody goes through all usages and confirms that indeed an ASCII

Re: PATCH for ticket 7026

2010-12-03 Thread Georg Baum
Enrico Forestieri wrote: On Fri, Dec 03, 2010 at 06:40:39PM +0100, Georg Baum wrote: Stephan Witt wrote: Am 03.12.2010 um 04:36 schrieb Enrico Forestieri: 2) replace all occurrences of isDigit() with isDigitASCII() I don't know. Unless somebody goes through all usages and confirms

Re: PATCH for ticket 7026

2010-12-03 Thread Andre Poenitz
On Fri, Dec 03, 2010 at 07:33:58AM +0100, Stephan Witt wrote: Am 03.12.2010 um 04:36 schrieb Enrico Forestieri: On Fri, Dec 03, 2010 at 12:44:57AM +0100, Pavel Sanda wrote: Stephan Witt wrote: There is a patch pending from Georg. I present it here again and propose to apply it.

Re: PATCH for ticket 7026

2010-12-03 Thread Stephan Witt
Am 03.12.2010 um 20:33 schrieb Andre Poenitz: On Fri, Dec 03, 2010 at 07:33:58AM +0100, Stephan Witt wrote: Am 03.12.2010 um 04:36 schrieb Enrico Forestieri: On Fri, Dec 03, 2010 at 12:44:57AM +0100, Pavel Sanda wrote: Stephan Witt wrote: There is a patch pending from Georg. I present

Re: PATCH for ticket 7026

2010-12-03 Thread Georg Baum
Stephan Witt wrote: > Am 03.12.2010 um 04:36 schrieb Enrico Forestieri: > >> It's becoming a mess. We have isdigit(), isDigit(), isDigitASCII(), >> and now iswdigit() enters the scene. > > iswdigit() is POSIX standard for wchar_t arguments - our char_type > is a typedef of wchar_t. But I don't

Re: PATCH for ticket 7026

2010-12-03 Thread Enrico Forestieri
On Fri, Dec 03, 2010 at 06:40:39PM +0100, Georg Baum wrote: > Stephan Witt wrote: > > > Am 03.12.2010 um 04:36 schrieb Enrico Forestieri: > > > >> 2) replace all occurrences of isDigit() with isDigitASCII() > > I don't know. Unless somebody goes through all usages and confirms that > indeed

Re: PATCH for ticket 7026

2010-12-03 Thread Georg Baum
Enrico Forestieri wrote: > On Fri, Dec 03, 2010 at 06:40:39PM +0100, Georg Baum wrote: > >> Stephan Witt wrote: >> >> > Am 03.12.2010 um 04:36 schrieb Enrico Forestieri: >> > >> >> 2) replace all occurrences of isDigit() with isDigitASCII() >> >> I don't know. Unless somebody goes through all

Re: PATCH for ticket 7026

2010-12-03 Thread Andre Poenitz
On Fri, Dec 03, 2010 at 07:33:58AM +0100, Stephan Witt wrote: > Am 03.12.2010 um 04:36 schrieb Enrico Forestieri: > > > On Fri, Dec 03, 2010 at 12:44:57AM +0100, Pavel Sanda wrote: > > > >> Stephan Witt wrote: > >>> There is a patch pending from Georg. > >>> I present it here again and propose

Re: PATCH for ticket 7026

2010-12-03 Thread Stephan Witt
Am 03.12.2010 um 20:33 schrieb Andre Poenitz: > On Fri, Dec 03, 2010 at 07:33:58AM +0100, Stephan Witt wrote: >> Am 03.12.2010 um 04:36 schrieb Enrico Forestieri: >> >>> On Fri, Dec 03, 2010 at 12:44:57AM +0100, Pavel Sanda wrote: >>> Stephan Witt wrote: > There is a patch pending from

Re: PATCH for ticket 7026

2010-12-02 Thread Stephan Witt
Am 17.11.2010 um 23:02 schrieb Enrico Forestieri: On Wed, Nov 17, 2010 at 04:19:34PM -0500, Richard Heck wrote: On 11/17/2010 03:48 PM, Enrico Forestieri wrote: As regards the other isxxx() tests, I suggest to audit them on an as needed basis, according to what the posix standard says:

Re: PATCH for ticket 7026

2010-12-02 Thread Pavel Sanda
Stephan Witt wrote: There is a patch pending from Georg. I present it here again and propose to apply it. The second part of the patch is mine. It encapsulates the crucial hasDigit into an ignoreWord() method to prepare to solve the FIXME and to propose an alternate implementation. The

Re: PATCH for ticket 7026

2010-12-02 Thread Enrico Forestieri
On Fri, Dec 03, 2010 at 12:44:57AM +0100, Pavel Sanda wrote: Stephan Witt wrote: There is a patch pending from Georg. I present it here again and propose to apply it. The second part of the patch is mine. It encapsulates the crucial hasDigit into an ignoreWord() method to prepare to

Re: PATCH for ticket 7026

2010-12-02 Thread Stephan Witt
Am 03.12.2010 um 04:36 schrieb Enrico Forestieri: On Fri, Dec 03, 2010 at 12:44:57AM +0100, Pavel Sanda wrote: Stephan Witt wrote: There is a patch pending from Georg. I present it here again and propose to apply it. The second part of the patch is mine. It encapsulates the crucial

Re: PATCH for ticket 7026

2010-12-02 Thread Stephan Witt
Am 17.11.2010 um 23:02 schrieb Enrico Forestieri: > On Wed, Nov 17, 2010 at 04:19:34PM -0500, Richard Heck wrote: >> On 11/17/2010 03:48 PM, Enrico Forestieri wrote: >>> >>> As regards the other isxxx() tests, I suggest to audit them on an as >>> needed basis, according to what the posix

Re: PATCH for ticket 7026

2010-12-02 Thread Pavel Sanda
Stephan Witt wrote: > There is a patch pending from Georg. > I present it here again and propose to apply it. > > The second part of the patch is mine. > It encapsulates the crucial hasDigit into an ignoreWord() method to > prepare to solve the FIXME and to propose an alternate implementation. >

Re: PATCH for ticket 7026

2010-12-02 Thread Enrico Forestieri
On Fri, Dec 03, 2010 at 12:44:57AM +0100, Pavel Sanda wrote: > Stephan Witt wrote: > > There is a patch pending from Georg. > > I present it here again and propose to apply it. > > > > The second part of the patch is mine. > > It encapsulates the crucial hasDigit into an ignoreWord() method to >

Re: PATCH for ticket 7026

2010-12-02 Thread Stephan Witt
Am 03.12.2010 um 04:36 schrieb Enrico Forestieri: > On Fri, Dec 03, 2010 at 12:44:57AM +0100, Pavel Sanda wrote: > >> Stephan Witt wrote: >>> There is a patch pending from Georg. >>> I present it here again and propose to apply it. >>> >>> The second part of the patch is mine. >>> It

Re: PATCH for ticket 7026

2010-11-17 Thread Stephan Witt
Am 16.11.2010 um 18:00 schrieb Enrico Forestieri: On Tue, Nov 16, 2010 at 01:16:38PM +0100, Vincent van Ravesteijn wrote: This will work too I guess. In the sense of avoid the crash... The purpose of hasDigit() is to test for occurrences of digits to avoid spell check of words with

Re: PATCH for ticket 7026

2010-11-17 Thread Enrico Forestieri
On Wed, Nov 17, 2010 at 08:23:58PM +0100, Stephan Witt wrote: Am 16.11.2010 um 18:00 schrieb Enrico Forestieri: Moral: either we stick an #undef isdigit in our code or we switch to iswdigit(). However, in this case, some locale expert should clarify under what conditions the output of

Re: PATCH for ticket 7026

2010-11-17 Thread Richard Heck
On 11/17/2010 03:48 PM, Enrico Forestieri wrote: As regards the other isxxx() tests, I suggest to audit them on an as needed basis, according to what the posix standard says: http://www.opengroup.org/onlinepubs/9699919799/mindex.html (click on the Alphabetic index link at the bottom for

Re: PATCH for ticket 7026

2010-11-17 Thread Enrico Forestieri
On Wed, Nov 17, 2010 at 04:19:34PM -0500, Richard Heck wrote: On 11/17/2010 03:48 PM, Enrico Forestieri wrote: As regards the other isxxx() tests, I suggest to audit them on an as needed basis, according to what the posix standard says:

Re: PATCH for ticket 7026

2010-11-17 Thread Stephan Witt
Am 16.11.2010 um 18:00 schrieb Enrico Forestieri: > On Tue, Nov 16, 2010 at 01:16:38PM +0100, Vincent van Ravesteijn wrote: This will work too I guess. >>> >>> In the sense of "avoid the crash"... >>> >>> The purpose of hasDigit() is to test for occurrences of digits to avoid >>> spell

Re: PATCH for ticket 7026

2010-11-17 Thread Enrico Forestieri
On Wed, Nov 17, 2010 at 08:23:58PM +0100, Stephan Witt wrote: > Am 16.11.2010 um 18:00 schrieb Enrico Forestieri: > > Moral: either we stick an "#undef isdigit" in our code or we switch > > to iswdigit(). However, in this case, some locale expert should clarify > > under what conditions the output

Re: PATCH for ticket 7026

2010-11-17 Thread Richard Heck
On 11/17/2010 03:48 PM, Enrico Forestieri wrote: As regards the other isxxx() tests, I suggest to audit them on an as needed basis, according to what the posix standard says: http://www.opengroup.org/onlinepubs/9699919799/mindex.html (click on the "Alphabetic index" link at the bottom for

Re: PATCH for ticket 7026

2010-11-17 Thread Enrico Forestieri
On Wed, Nov 17, 2010 at 04:19:34PM -0500, Richard Heck wrote: > On 11/17/2010 03:48 PM, Enrico Forestieri wrote: > > > >As regards the other isxxx() tests, I suggest to audit them on an as > >needed basis, according to what the posix standard says: >

Re: PATCH for ticket 7026

2010-11-16 Thread Enrico Forestieri
On Tue, Nov 16, 2010 at 07:56:55AM +0100, Stephan Witt wrote: The attached patch for http://www.lyx.org/trac/ticket/7026 seems to be correct. Maybe yes, maybe not. isdigit(c) tests whether c is one of 0,1,2,...,9 while iswdigit(wc) tests whether wc is a wide-character code representing a

Re: PATCH for ticket 7026

2010-11-16 Thread Stephan Witt
Am 16.11.2010 um 09:53 schrieb Enrico Forestieri: On Tue, Nov 16, 2010 at 07:56:55AM +0100, Stephan Witt wrote: The attached patch for http://www.lyx.org/trac/ticket/7026 seems to be correct. Maybe yes, maybe not. isdigit(c) tests whether c is one of 0,1,2,...,9 while iswdigit(wc) tests

Re: PATCH for ticket 7026

2010-11-16 Thread Vincent van Ravesteijn
On Tue, Nov 16, 2010 at 7:56 AM, Stephan Witt st.w...@gmx.net wrote: The attached patch for http://www.lyx.org/trac/ticket/7026 seems to be correct. When I grep for isdigit I see the following sollution somewhere else in the source: diff --git a/src/support/lstrings.cpp

Re: PATCH for ticket 7026

2010-11-16 Thread Enrico Forestieri
On Tue, Nov 16, 2010 at 11:29:22AM +0100, Stephan Witt wrote: Am 16.11.2010 um 09:53 schrieb Enrico Forestieri: On Tue, Nov 16, 2010 at 07:56:55AM +0100, Stephan Witt wrote: The attached patch for http://www.lyx.org/trac/ticket/7026 seems to be correct. Maybe yes, maybe not.

Re: PATCH for ticket 7026

2010-11-16 Thread Stephan Witt
Am 16.11.2010 um 11:52 schrieb Vincent van Ravesteijn: On Tue, Nov 16, 2010 at 7:56 AM, Stephan Witt st.w...@gmx.net wrote: The attached patch for http://www.lyx.org/trac/ticket/7026 seems to be correct. When I grep for isdigit I see the following sollution somewhere else in the source:

Re: PATCH for ticket 7026

2010-11-16 Thread Vincent van Ravesteijn
This will work too I guess. In the sense of avoid the crash... The purpose of hasDigit() is to test for occurrences of digits to avoid spell check of words with digits. A docstring may very well contain digits coded outside the range of 0x00 .. 0x7F (ascii 0-9). Unicode contains more

Re: PATCH for ticket 7026

2010-11-16 Thread Jürgen Spitzmüller
Vincent van Ravesteijn wrote: Are you sure that the numeric characters in other parts of the spectrum cannot occur in real words that need to be spellchecked. An example to prove that this can be the case is in Chinese: 三 means '3', but 三角 means triangle. Note that the same might be true

Re: PATCH for ticket 7026

2010-11-16 Thread Enrico Forestieri
On Tue, Nov 16, 2010 at 01:16:38PM +0100, Vincent van Ravesteijn wrote: This will work too I guess. In the sense of avoid the crash... The purpose of hasDigit() is to test for occurrences of digits to avoid spell check of words with digits. A docstring may very well contain digits

Re: PATCH for ticket 7026

2010-11-16 Thread Enrico Forestieri
On Tue, Nov 16, 2010 at 07:56:55AM +0100, Stephan Witt wrote: > The attached patch for http://www.lyx.org/trac/ticket/7026 seems to be > correct. Maybe yes, maybe not. isdigit(c) tests whether c is one of 0,1,2,...,9 while iswdigit(wc) tests whether wc is a wide-character code representing a

Re: PATCH for ticket 7026

2010-11-16 Thread Stephan Witt
Am 16.11.2010 um 09:53 schrieb Enrico Forestieri: > On Tue, Nov 16, 2010 at 07:56:55AM +0100, Stephan Witt wrote: >> The attached patch for http://www.lyx.org/trac/ticket/7026 seems to be >> correct. > > Maybe yes, maybe not. isdigit(c) tests whether c is one of 0,1,2,...,9 > while iswdigit(wc)

Re: PATCH for ticket 7026

2010-11-16 Thread Vincent van Ravesteijn
On Tue, Nov 16, 2010 at 7:56 AM, Stephan Witt wrote: > The attached patch for http://www.lyx.org/trac/ticket/7026 seems to be > correct. When I grep for "isdigit" I see the following sollution somewhere else in the source: diff --git a/src/support/lstrings.cpp

Re: PATCH for ticket 7026

2010-11-16 Thread Enrico Forestieri
On Tue, Nov 16, 2010 at 11:29:22AM +0100, Stephan Witt wrote: > Am 16.11.2010 um 09:53 schrieb Enrico Forestieri: > > > On Tue, Nov 16, 2010 at 07:56:55AM +0100, Stephan Witt wrote: > >> The attached patch for http://www.lyx.org/trac/ticket/7026 seems to be > >> correct. > > > > Maybe yes,

Re: PATCH for ticket 7026

2010-11-16 Thread Stephan Witt
Am 16.11.2010 um 11:52 schrieb Vincent van Ravesteijn: > On Tue, Nov 16, 2010 at 7:56 AM, Stephan Witt wrote: >> The attached patch for http://www.lyx.org/trac/ticket/7026 seems to be >> correct. > > When I grep for "isdigit" I see the following sollution somewhere else > in

Re: PATCH for ticket 7026

2010-11-16 Thread Vincent van Ravesteijn
>> This will work too I guess. > > In the sense of "avoid the crash"... > > The purpose of hasDigit() is to test for occurrences of digits to avoid spell > check of words with digits. > A docstring may very well contain digits coded outside the range of 0x00 .. > 0x7F (ascii 0-9). > Unicode

Re: PATCH for ticket 7026

2010-11-16 Thread Jürgen Spitzmüller
Vincent van Ravesteijn wrote: > Are you sure that the numeric characters in other parts of the > spectrum cannot occur in real words that need to be spellchecked. An > example to prove that this can be the case is in Chinese: > > 三 means '3', but 三角 means triangle. Note that the same might be

Re: PATCH for ticket 7026

2010-11-16 Thread Enrico Forestieri
On Tue, Nov 16, 2010 at 01:16:38PM +0100, Vincent van Ravesteijn wrote: > >> This will work too I guess. > > > > In the sense of "avoid the crash"... > > > > The purpose of hasDigit() is to test for occurrences of digits to avoid > > spell check of words with digits. > > A docstring may very well

PATCH for ticket 7026

2010-11-15 Thread Stephan Witt
The attached patch for http://www.lyx.org/trac/ticket/7026 seems to be correct. The only thing: I don't understand why it should crash with isdigit() instead of iswdigit()... Stephan Index: src/support/lstrings.cpp === ---

PATCH for ticket 7026

2010-11-15 Thread Stephan Witt
The attached patch for http://www.lyx.org/trac/ticket/7026 seems to be correct. The only thing: I don't understand why it should crash with isdigit() instead of iswdigit()... Stephan Index: src/support/lstrings.cpp === ---