Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-11-25 Thread Scott Kostyshak
On Thu, Nov 25, 2021 at 05:06:43PM +0100, Jürgen Spitzmüller wrote:
> Am Dienstag, dem 23.11.2021 um 21:35 -0500 schrieb Scott Kostyshak:
> > I think I found another instance of this issue. To reproduce, open
> > the attached file and do spellcheck. "abcxyz" is misspelled, but if
> > you click on "ignore all" it goes to the next instance of that word.
> > 
> > I think the issue is that both instances are in an inset (in this
> > case the footnote inset). If the footnote is dissolved, there is no
> > issue.
> 
> Right. Should be fixed as of 5a6498c3d3bfe0c.

Works well, thank you!

Scott


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-11-25 Thread Jürgen Spitzmüller
Am Dienstag, dem 23.11.2021 um 21:35 -0500 schrieb Scott Kostyshak:
> I think I found another instance of this issue. To reproduce, open
> the attached file and do spellcheck. "abcxyz" is misspelled, but if
> you click on "ignore all" it goes to the next instance of that word.
> 
> I think the issue is that both instances are in an inset (in this
> case the footnote inset). If the footnote is dissolved, there is no
> issue.

Right. Should be fixed as of 5a6498c3d3bfe0c.

Jürgen

> 
> Scott



signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-11-23 Thread Scott Kostyshak
On Sat, Aug 21, 2021 at 09:40:21AM -0400, Scott Kostyshak wrote:
> On Sat, Aug 21, 2021 at 03:20:05PM +0200, Jürgen Spitzmüller wrote:
> > Am Donnerstag, dem 19.08.2021 um 16:04 -0400 schrieb Scott Kostyshak:
> > > I've just tested it and it is working well. I will enjoy using this
> > > feature for my personal use. A few comments, although I understand if
> > > you don't have time these days:
> > 
> > Yes, and I fear this will be true for quite a while.
> > 
> > > 
> > > 1. When I do "Ignore all", a subsequent occurrence is still found as
> > >    misspelled. For example, in "hello blahblahxx blahblahxx" if I put
> > >    "Ignore All" for the first occurrence of "blahblahxx", the
> > > spellcheck
> > >    still goes to the second occurrence of "blahblahxx". Is this
> > >    expected? I expected "Ignore all" to imply "Skip all" but perhaps
> > >    I've misunderstood?
> > 
> > No, you're right. We need to re-check the whole buffer. Done now.
> > Please check.
> 
> Thanks for the quick fixes. Tested and works well!

I think I found another instance of this issue. To reproduce, open the
attached file and do spellcheck. "abcxyz" is misspelled, but if you click
on "ignore all" it goes to the next instance of that word.

I think the issue is that both instances are in an inset (in this case
the footnote inset). If the footnote is dissolved, there is no issue.

Scott


ignore-all-example.23.lyx
Description: application/lyx


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-08-21 Thread Scott Kostyshak
On Sat, Aug 21, 2021 at 03:20:05PM +0200, Jürgen Spitzmüller wrote:
> Am Donnerstag, dem 19.08.2021 um 16:04 -0400 schrieb Scott Kostyshak:
> > I've just tested it and it is working well. I will enjoy using this
> > feature for my personal use. A few comments, although I understand if
> > you don't have time these days:
> 
> Yes, and I fear this will be true for quite a while.
> 
> > 
> > 1. When I do "Ignore all", a subsequent occurrence is still found as
> >    misspelled. For example, in "hello blahblahxx blahblahxx" if I put
> >    "Ignore All" for the first occurrence of "blahblahxx", the
> > spellcheck
> >    still goes to the second occurrence of "blahblahxx". Is this
> >    expected? I expected "Ignore all" to imply "Skip all" but perhaps
> >    I've misunderstood?
> 
> No, you're right. We need to re-check the whole buffer. Done now.
> Please check.
> 
> > 2. Would it be OK to change "This is perdurant beyond the current
> >    session" to "This persists beyond the current session." ?
> 
> Yes, sure. Fixed as well.
> 
> Thanks for checking.

Thanks for the quick fixes. Tested and works well!

Scott


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-08-21 Thread Jürgen Spitzmüller
Am Donnerstag, dem 19.08.2021 um 16:04 -0400 schrieb Scott Kostyshak:
> I've just tested it and it is working well. I will enjoy using this
> feature for my personal use. A few comments, although I understand if
> you don't have time these days:

Yes, and I fear this will be true for quite a while.

> 
> 1. When I do "Ignore all", a subsequent occurrence is still found as
>    misspelled. For example, in "hello blahblahxx blahblahxx" if I put
>    "Ignore All" for the first occurrence of "blahblahxx", the
> spellcheck
>    still goes to the second occurrence of "blahblahxx". Is this
>    expected? I expected "Ignore all" to imply "Skip all" but perhaps
>    I've misunderstood?

No, you're right. We need to re-check the whole buffer. Done now.
Please check.

> 2. Would it be OK to change "This is perdurant beyond the current
>    session" to "This persists beyond the current session." ?

Yes, sure. Fixed as well.

Thanks for checking.

Jürgen



signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-08-19 Thread Scott Kostyshak
On Sat, Mar 06, 2021 at 12:25:49PM -0500, Scott Kostyshak wrote:
> On Sat, Mar 06, 2021 at 05:54:27PM +0100, Jean-Marc Lasgouttes wrote:
> > Le 06/03/2021 à 16:52, Juergen Spitzmueller a écrit :
> > > commit 07396ab2445720b21dc8195816eb1aee1f2ae3a7
> > > Author: Juergen Spitzmueller 
> > > Date:   Sat Mar 6 16:53:33 2021 +0100
> > > 
> > >  Meet per-document spelling dictionaries (fixes #86 [sic!])
> > 
> > Great news!
> 
> Well done! I look forward to testing this feature.

I've just tested it and it is working well. I will enjoy using this
feature for my personal use. A few comments, although I understand if
you don't have time these days:

1. When I do "Ignore all", a subsequent occurrence is still found as
   misspelled. For example, in "hello blahblahxx blahblahxx" if I put
   "Ignore All" for the first occurrence of "blahblahxx", the spellcheck
   still goes to the second occurrence of "blahblahxx". Is this
   expected? I expected "Ignore all" to imply "Skip all" but perhaps
   I've misunderstood?

2. Would it be OK to change "This is perdurant beyond the current
   session" to "This persists beyond the current session." ?

Scott


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-08 Thread Stephan Witt
Am 08.03.2021 um 19:39 schrieb Stephan Witt :
> 
> Am 08.03.2021 um 19:22 schrieb Stephan Witt :
>> 
>> Am 08.03.2021 um 14:32 schrieb Pavel Sanda :
>>> 
>>> On Mon, Mar 08, 2021 at 01:14:12PM +0100, Stephan Witt wrote:
> Are you sure you did not errorneously flagged one of bisect steps wrongly?
 
 My HEAD is ahead of origin by 4 commits (including the manual reversion - 
 diff attached).
>>> 
>>> 07122f066b43 and your reversion is not identical - I see several changes in 
>>> exception includes.
>>> What happens if you actually revert 07122f066b43 verbatim?
>> 
>> The same. :(
>> Attached is the revert patch I’ve used to test.
> 
> To come closer to the original I've moved the location of the spellignore() 
> retrieval (patch attached). Same exception.
> 
> Please consider the fact that I check the spelling of the german Intro.lyx.
> 
> The bparams.spellignore() word list should be empty and it is.
> 
> The basic_string exception must be independent and more general.

Finally I got it. Sorry for the noise and thank you for your patience.

The change 6273c1f66d fixes it.

I couldn’t imagine the exception ruins the stack trace completely.

Stephan
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-08 Thread Stephan Witt
Am 08.03.2021 um 19:22 schrieb Stephan Witt :
> 
> Am 08.03.2021 um 14:32 schrieb Pavel Sanda :
>> 
>> On Mon, Mar 08, 2021 at 01:14:12PM +0100, Stephan Witt wrote:
 Are you sure you did not errorneously flagged one of bisect steps wrongly?
>>> 
>>> My HEAD is ahead of origin by 4 commits (including the manual reversion - 
>>> diff attached).
>> 
>> 07122f066b43 and your reversion is not identical - I see several changes in 
>> exception includes.
>> What happens if you actually revert 07122f066b43 verbatim?
> 
> The same. :(
> Attached is the revert patch I’ve used to test.

To come closer to the original I've moved the location of the spellignore() 
retrieval (patch attached). Same exception.

Please consider the fact that I check the spelling of the german Intro.lyx.

The bparams.spellignore() word list should be empty and it is.

The basic_string exception must be independent and more general.

Stephan


spell-BufferParams.diff
Description: Binary data
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-08 Thread Stephan Witt
Am 08.03.2021 um 14:32 schrieb Pavel Sanda :
> 
> On Mon, Mar 08, 2021 at 01:14:12PM +0100, Stephan Witt wrote:
>>> Are you sure you did not errorneously flagged one of bisect steps wrongly?
>> 
>> My HEAD is ahead of origin by 4 commits (including the manual reversion - 
>> diff attached).
> 
> 07122f066b43 and your reversion is not identical - I see several changes in 
> exception includes.
> What happens if you actually revert 07122f066b43 verbatim?

The same. :(
Attached is the revert patch I’ve used to test.

Stephan


spellcheck-revert-07122f066b.diff
Description: Binary data
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-08 Thread Jürgen Spitzmüller
Am Mo., 8. März 2021 um 14:34 Uhr schrieb Pavel Sanda :

> So "Ignore all" has now different schematics?
>

Yes, "Ignore" and "Ignore All" have changed semantics, as the ignorance
will now persist beyind session.

"Skip" is old "Ignore" (just skip this match without actually ignoring it),
"Skip All" is old "Ignore All" (ignore for this session).

Jürgen



> Pavel
> --
> lyx-devel mailing list
> lyx-devel@lists.lyx.org
> http://lists.lyx.org/mailman/listinfo/lyx-devel
>
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-08 Thread Pavel Sanda
On Mon, Mar 08, 2021 at 02:13:21PM +0100, Stephan Witt wrote:
> Am 08.03.2021 um 12:18 schrieb Pavel Sanda :
> > 
> > On Sat, Mar 06, 2021 at 04:52:12PM +0100, Juergen Spitzmueller wrote:
> >> commit 07396ab2445720b21dc8195816eb1aee1f2ae3a7
> >> Author: Juergen Spitzmueller 
> >> Date:   Sat Mar 6 16:53:33 2021 +0100
> >> 
> >>Meet per-document spelling dictionaries (fixes #86 [sic!])
> > 
> > Is this option supposed to pop up at the spellcheck pane?
> > I do not see the corresponding button here???
> 
> It???s in the context-menu.
> 
> LyX in german UI has it labeled with ???Alle ignorieren???

So "Ignore all" has now different schematics?
Pavel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-08 Thread Pavel Sanda
On Mon, Mar 08, 2021 at 01:14:12PM +0100, Stephan Witt wrote:
> > Are you sure you did not errorneously flagged one of bisect steps wrongly?
> 
> My HEAD is ahead of origin by 4 commits (including the manual reversion - 
> diff attached).

07122f066b43 and your reversion is not identical - I see several changes in 
exception includes.
What happens if you actually revert 07122f066b43 verbatim?

Pavel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-08 Thread Stephan Witt
Am 08.03.2021 um 12:18 schrieb Pavel Sanda :
> 
> On Sat, Mar 06, 2021 at 04:52:12PM +0100, Juergen Spitzmueller wrote:
>> commit 07396ab2445720b21dc8195816eb1aee1f2ae3a7
>> Author: Juergen Spitzmueller 
>> Date:   Sat Mar 6 16:53:33 2021 +0100
>> 
>>Meet per-document spelling dictionaries (fixes #86 [sic!])
> 
> Is this option supposed to pop up at the spellcheck pane?
> I do not see the corresponding button here…

It’s in the context-menu.

LyX in german UI has it labeled with „Alle ignorieren“

Stephan
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-08 Thread Stephan Witt
Am 08.03.2021 um 12:14 schrieb Pavel Sanda :
> 
> On Mon, Mar 08, 2021 at 11:14:13AM +0100, Stephan Witt wrote:
>> Am 08.03.2021 um 07:27 schrieb Jürgen Spitzmüller :
>>> 
>>> Am Sonntag, dem 07.03.2021 um 20:55 +0100 schrieb Stephan Witt:
 To reproduce I
 
 1. Open the Help -> Intro.
 2. Boom.
>>> 
>>> Is it related to the darkmode runtime switch we recently added? You
>>> backtrace points towards that code region.
>>> 
>>> In any case, you can try bisecting.
>> 
>> I did it already. But I???m lost now. Bisect points to my commit 07122f066b.
>> I don???t see the reason and reversion of this is not easy. 
>> If I revert it manually it doesn???t help. The crash remains.
> 
> I struggle with the claim that bisect points to 07122f066b, yet if you revert
> it the crash remains. But that's essentially what bisect does.
> 
> Are you sure you did not errorneously flagged one of bisect steps wrongly?

My HEAD is ahead of origin by 4 commits (including the manual reversion - diff 
attached).

I assume e2f3dd5f6a2b73 is good and my HEAD is bad (2nd diff attached).

I’ll redo and log my steps here:

$ git bisect start HEAD e2f3dd5f6a2b736ed457c1b13361b2892aa54338
Bisecting: 29 revisions left to test after this (roughly 5 steps)
[31dc0acbb89b8b2b9a8783b02168c193ad41a98b] Layout fix

=> Compile error in AppleSpellChecker::check and EnchantChecker::check
=> fix it (add missing const & in front of docdict)

Compile and test with
1. Start LyX in Xcode
2. Open Intro (Einführung in german)
3. Spell check interactive
4. Cycle through complete document (more than 70 skips).

Ok, works.

$ git checkout src/AppleSpellChecker.cpp src/EnchantChecker.cpp
Updated 2 paths from the index
$ git bisect good
Bisecting: 14 revisions left to test after this (roughly 4 steps)
[b07084df2dbf04a7b54206ab5135b0f628bd59b8] Add ticks to zoom slider 

Compile and run. Test ok.

$ git bisect good
Bisecting: 7 revisions left to test after this (roughly 3 steps)
[07122f066b43f9dd41462932894a91aed78201d0] Refactoring: move check for match in 
spellignore() to buffer params.

Compile and run. Crash after 6 times „Überspringen“ (skip).

$ git bisect bad
Bisecting: 3 revisions left to test after this (roughly 2 steps)
[bc300585f7e5aaf412a843638b90b8c311b99e5a] Properly set initial zoom value

Compile and run. Test ok.

$ git bisect good
Bisecting: 1 revision left to test after this (roughly 1 step)
[be6dc7dd5dc10f79ef2525b2ba77d0b02c46] Show zoom value in statusbar

Compile and run. Test ok.

$ git bisect good
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[430327152a23017797751e0b8e63552ccf84c466] Fix per-document dictionary with Mac

Compile and run. Test ok.

$ git bisect good
07122f066b43f9dd41462932894a91aed78201d0 is the first bad commit
commit 07122f066b43f9dd41462932894a91aed78201d0
Author: Stephan Witt 
Date:   Sun Mar 7 17:46:01 2021 +0100

Refactoring: move check for match in spellignore() to buffer params.

:04 04 9e429f821e1b40190ac577935ec368dc352fc748 
24f5f679d4ccbc239bad0028b73c494bdfad8d83 M  src

Again the pointer to 07122f066b43f9dd41462932894a91aed78201d0.

I’m using Xcode with the cmake created project. I don’t recreate the project 
after a bisect step.

> It the crash 100% reproducible?

Yes.

Stephan



bisect-start-origin.diff
Description: Binary data


bisect-start-e2f3dd5f6a2b73.diff
Description: Binary data
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-08 Thread Pavel Sanda
On Sat, Mar 06, 2021 at 04:52:12PM +0100, Juergen Spitzmueller wrote:
> commit 07396ab2445720b21dc8195816eb1aee1f2ae3a7
> Author: Juergen Spitzmueller 
> Date:   Sat Mar 6 16:53:33 2021 +0100
> 
> Meet per-document spelling dictionaries (fixes #86 [sic!])

Is this option supposed to pop up at the spellcheck pane?
I do not see the corresponding button here...

Pavel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-08 Thread Pavel Sanda
On Mon, Mar 08, 2021 at 11:14:13AM +0100, Stephan Witt wrote:
> Am 08.03.2021 um 07:27 schrieb Jürgen Spitzmüller :
> > 
> > Am Sonntag, dem 07.03.2021 um 20:55 +0100 schrieb Stephan Witt:
> >> To reproduce I
> >> 
> >> 1. Open the Help -> Intro.
> >> 2. Boom.
> > 
> > Is it related to the darkmode runtime switch we recently added? You
> > backtrace points towards that code region.
> > 
> > In any case, you can try bisecting.
> 
> I did it already. But I???m lost now. Bisect points to my commit 07122f066b.
> I don???t see the reason and reversion of this is not easy. 
> If I revert it manually it doesn???t help. The crash remains.

I struggle with the claim that bisect points to 07122f066b, yet if you revert
it the crash remains. But that's essentially what bisect does.

Are you sure you did not errorneously flagged one of bisect steps wrongly?
It the crash 100% reproducible?

Pavel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-08 Thread Stephan Witt
Am 08.03.2021 um 07:27 schrieb Jürgen Spitzmüller :
> 
> Am Sonntag, dem 07.03.2021 um 20:55 +0100 schrieb Stephan Witt:
>> To reproduce I
>> 
>> 1. Open the Help -> Intro.
>> 2. Boom.
> 
> Is it related to the darkmode runtime switch we recently added? You
> backtrace points towards that code region.
> 
> In any case, you can try bisecting.

I did it already. But I’m lost now. Bisect points to my commit 07122f066b.
I don’t see the reason and reversion of this is not easy. 
If I revert it manually it doesn’t help. The crash remains.

Any idea how to get the cause? It looks like some uninitialized memory.

To reproduce I

1. Start LyX
2. Disable on-the-fly spell-checker
3. Load the Intro
4. Start spell-checker and stop in GuiApplication.cpp at line 2941 (first line 
of the exception handler for "exception const & e") - the crash
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 4.1
  * frame #0: 0x00010350967a 
LyX`lyx::frontend::GuiApplication::notify(this=0x604788d0, 
receiver=0x604000378790, event=0x6080005635a0) at 
GuiApplication.cpp:2941:3
frame #1: 0x00010d3d0b44 
QtCore`QCoreApplication::notifyInternal2(QObject*, QEvent*) + 212
frame #2: 0x00010d3d1c56 
QtCore`QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) + 
774
(lldb) print e
(const lyx::support::ExceptionMessage) $0 = (type_ = 1413567809, title_ = 
L"\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\UfffdÉ\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd蒃\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd\Ufffd",
 details_ = L""..., message_ = ""...)

The constructor of lyx::support::ExceptionMessage is not used for the object e.

It makes no difference to use cmake or autotools.

Stephan
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-07 Thread Jürgen Spitzmüller
Am Sonntag, dem 07.03.2021 um 20:55 +0100 schrieb Stephan Witt:
> To reproduce I
> 
> 1. Open the Help -> Intro.
> 2. Boom.

Is it related to the darkmode runtime switch we recently added? You
backtrace points towards that code region.

In any case, you can try bisecting.

Jürgen



signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-07 Thread Stephan Witt
Am 07.03.2021 um 20:08 schrieb Stephan Witt :
> 
>> Am 07.03.2021 um 19:09 schrieb Jürgen Spitzmüller :
>> 
>> Am Sonntag, dem 07.03.2021 um 18:58 +0100 schrieb Stephan Witt:
>>> From the dictionary.
>> 
>> Thanks. Cannot reproduce. Can you try to dig in deeper?
> 
> How? The exception comes from „outer space“ …

I can say it’s absolutely unrelated.

To reproduce I

1. Open the Help -> Intro.
2. Boom.

Stephan

> 
> This is the program output:
> 
> ==
> LyX hat einen Fehler (Exception) entdeckt. Das Programm wird jetzt versuchen, 
> alle ungespeicherten Dateien zu speichern, und dann beendet.
> 
> Exception: basic_string
> ==
> 
> Stephan

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-07 Thread Stephan Witt


> Am 07.03.2021 um 19:09 schrieb Jürgen Spitzmüller :
> 
> Am Sonntag, dem 07.03.2021 um 18:58 +0100 schrieb Stephan Witt:
>> From the dictionary.
> 
> Thanks. Cannot reproduce. Can you try to dig in deeper?

How? The exception comes from „outer space“ …

This is the program output:

==
LyX hat einen Fehler (Exception) entdeckt. Das Programm wird jetzt versuchen, 
alle ungespeicherten Dateien zu speichern, und dann beendet.

Exception: basic_string
==

Stephan
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-07 Thread Jürgen Spitzmüller
Am Sonntag, dem 07.03.2021 um 18:58 +0100 schrieb Stephan Witt:
> From the dictionary.

Thanks. Cannot reproduce. Can you try to dig in deeper?

Jürgen



signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-07 Thread Stephan Witt
Am 07.03.2021 um 18:50 schrieb Jürgen Spitzmüller :
> 
> Am Sonntag, dem 07.03.2021 um 18:48 +0100 schrieb Stephan Witt:
>> To reproduce I do:
>> 
>> 1. Open the attached document.
>> 2. Remove the second unrrund.
>> 3. Navigate and type some text. Boom.
> 
> What do you mean by "remove"? Remove from the dictionary or delete the
> word in the document?

From the dictionary.

Stephan
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-07 Thread Jürgen Spitzmüller
Am Sonntag, dem 07.03.2021 um 18:48 +0100 schrieb Stephan Witt:
> To reproduce I do:
> 
> 1. Open the attached document.
> 2. Remove the second unrrund.
> 3. Navigate and type some text. Boom.

What do you mean by "remove"? Remove from the dictionary or delete the
word in the document?

Jürgen



signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-07 Thread Stephan Witt
Am 07.03.2021 um 18:24 schrieb Jürgen Spitzmüller :
> 
> Am Sonntag, dem 07.03.2021 um 17:55 +0100 schrieb Jürgen Spitzmüller:
>> But I'll implement another lfun along this way.
> 
> Done.
> 
> Jürgen

Thanks.

Is this crash related? Hard to say…

(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
frame #0: 0x7fff6dc5d2c2 libsystem_kernel.dylib`__pthread_kill + 10
frame #1: 0x000105abe80d libsystem_pthread.dylib`pthread_kill + 284
frame #2: 0x7fff6dbc76a6 libsystem_c.dylib`abort + 127
  * frame #3: 0x00010039d8ff LyX`lyx::lyx_exit(exit_code=1) at LyX.cpp:272:2
frame #4: 0x000100be9918 
LyX`lyx::frontend::GuiApplication::notify(this=0x000107b417d0, 
receiver=0x000126c6cd90, event=0x7ffeefbfce10) at 
GuiApplication.cpp:2946:3
frame #5: 0x0001055bdb44 
QtCore`QCoreApplication::notifyInternal2(QObject*, QEvent*) + 212
frame #6: 0x000104812b1d 
QtWidgets`QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint 
const&, int, QPainter*, QWidgetBackingStore*) + 2989
frame #7: 0x0001047ec738 QtWidgets`QWidgetBackingStore::doSync() + 4616
frame #8: 0x000104819ceb QtWidgets`QWidget::event(QEvent*) + 1643
frame #9: 0x000104929304 QtWidgets`QMainWindow::event(QEvent*) + 276
frame #10: 0x000100f0b051 
LyX`lyx::frontend::GuiView::event(this=0x00012441ab60, 
e=0x0001078c7d50) at GuiView.cpp:1533:23
frame #11: 0x0001047dee60 
QtWidgets`QApplicationPrivate::notify_helper(QObject*, QEvent*) + 272
frame #12: 0x0001047e0215 QtWidgets`QApplication::notify(QObject*, 
QEvent*) + 581
frame #13: 0x000100be9763 
LyX`lyx::frontend::GuiApplication::notify(this=0x000107b417d0, 
receiver=0x00012441ab60, event=0x0001078c7d50) at 
GuiApplication.cpp:2907:24
frame #14: 0x0001055bdb44 
QtCore`QCoreApplication::notifyInternal2(QObject*, QEvent*) + 212
frame #15: 0x0001055bec56 
QtCore`QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) + 
774
frame #16: 0x000107cbeba2 
libqcocoa.dylib`QCocoaEventDispatcherPrivate::processPostedEvents() + 322
frame #17: 0x000107cbf2a8 
libqcocoa.dylib`QCocoaEventDispatcherPrivate::postedEventsSourceCallback(void*) 
+ 40
frame #18: 0x7fff41b5ad13 
CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
frame #19: 0x7fff41b5acb9 CoreFoundation`__CFRunLoopDoSource0 + 108
frame #20: 0x7fff41b3e5af CoreFoundation`__CFRunLoopDoSources0 + 195
frame #21: 0x7fff41b3db79 CoreFoundation`__CFRunLoopRun + 1189
frame #22: 0x7fff41b3d482 CoreFoundation`CFRunLoopRunSpecific + 455
frame #23: 0x7fff40d9c1ab HIToolbox`RunCurrentEventLoopInMode + 292
frame #24: 0x7fff40d9bee5 HIToolbox`ReceiveNextEventCommon + 603
frame #25: 0x7fff40d9bc76 
HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 64
frame #26: 0x7fff3f13377d AppKit`_DPSNextEvent + 1135
frame #27: 0x7fff3f13246b AppKit`-[NSApplication(NSEvent) 
_nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1361
frame #28: 0x7fff3f12c588 AppKit`-[NSApplication run] + 699
frame #29: 0x000107cbe108 
libqcocoa.dylib`QCocoaEventDispatcher::processEvents(QFlags)
 + 2648
frame #30: 0x0001055b928f 
QtCore`QEventLoop::exec(QFlags) + 431
frame #31: 0x0001055be192 QtCore`QCoreApplication::exec() + 130
frame #32: 0x000100be7b36 
LyX`lyx::frontend::GuiApplication::exec(this=0x000107b417d0) at 
GuiApplication.cpp:2666:9
frame #33: 0x00010039e512 LyX`lyx::LyX::exec(this=0x7ffeefbff390, 
argc=0x7ffeefbff3a8, argv=0x7ffeefbff3d0) at LyX.cpp:397:39
frame #34: 0x0001006179d6 LyX`main(argc=1, argv=0x7ffeefbff3d0) at 
main.cpp:42:26
frame #35: 0x7fff6db223d5 libdyld.dylib`start + 1
(lldb) 

To reproduce I do:

1. Open the attached document.
2. Remove the second unrrund.
3. Navigate and type some text. Boom.

Stephan



Spellcheck-1.lyx
Description: Binary data
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-07 Thread Jürgen Spitzmüller
Am Sonntag, dem 07.03.2021 um 17:55 +0100 schrieb Jürgen Spitzmüller:
> But I'll implement another lfun along this way.

Done.

Jürgen



signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-07 Thread Jürgen Spitzmüller
Am Sonntag, dem 07.03.2021 um 17:56 +0100 schrieb Stephan Witt:
> Or add it to LFUN_SPELLING_REMOVE implementation?

I would rather keep the diverse dictionaries separated.

Jürgen



signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-07 Thread Stephan Witt
Am 07.03.2021 um 17:55 schrieb Jürgen Spitzmüller :
> 
> Am Sonntag, dem 07.03.2021 um 17:47 +0100 schrieb Stephan Witt:
>> Yes, there is LFUN_SPELLING_REMOVE already.
> 
> I find this rather odd, as you have to know a word is in the dictionary
> in order to remove it.
> 
> But I'll implement another lfun along this way.

Or add it to LFUN_SPELLING_REMOVE implementation?

Stephan
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-07 Thread Jürgen Spitzmüller
Am Sonntag, dem 07.03.2021 um 17:47 +0100 schrieb Stephan Witt:
> Yes, there is LFUN_SPELLING_REMOVE already.

I find this rather odd, as you have to know a word is in the dictionary
in order to remove it.

But I'll implement another lfun along this way.

Jürgen



signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-07 Thread Jürgen Spitzmüller
Am Sonntag, dem 07.03.2021 um 17:51 +0100 schrieb Stephan Witt:
> > It did not come yet AFAIR.
> 
> Yes, it was not announced yet.

So we are not in feature freeze.

Jürgen



signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-07 Thread Stephan Witt
Am 07.03.2021 um 17:36 schrieb Jürgen Spitzmüller :
> 
> Am Sonntag, dem 07.03.2021 um 17:32 +0100 schrieb Stephan Witt:
>>> Are we? I must have missed the announcement. Can you point me to
>>> it?
>> 
>> https://wiki.lyx.org/Devel/Meeting2021-01-11
> 
> This only says "A feature and format freeze is coming soon."
> 
> It did not come yet AFAIR.

Yes, it was not announced yet.

Stephan

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-07 Thread Stephan Witt
Am 07.03.2021 um 17:24 schrieb Jürgen Spitzmüller :
> 
> Am Sonntag, dem 07.03.2021 um 16:53 +0100 schrieb Stephan Witt:
>> No I don’t want to enhance it *now*. We are in feature-freeze IMO.
> 
> Are we? I must have missed the announcement. Can you point me to it?
> 
> (I agree that we should enter feature freeze soon, though).
> 
>> 
>>> I see. Can you try (and maybe play with) the attached patch?
>> 
>> This is better now.
> 
> Goof. Will commit, then.

I did some play before. I’ve commit it.

>> Next problem: I cannot remove the learned word from document
>> dictionary?
>> Should this work?
> 
> No, I haven't implemented this yet. My idea was to allow this via
> document > settings > language. Or do you want and lfun instead/as
> well?

Yes, there is LFUN_SPELLING_REMOVE already.

Stephan
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-07 Thread Jürgen Spitzmüller
Am Sonntag, dem 07.03.2021 um 17:32 +0100 schrieb Stephan Witt:
> > Are we? I must have missed the announcement. Can you point me to
> > it?
> 
> https://wiki.lyx.org/Devel/Meeting2021-01-11

This only says "A feature and format freeze is coming soon."

It did not come yet AFAIR.

Jürgen



signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-07 Thread Stephan Witt
Am 07.03.2021 um 17:24 schrieb Jürgen Spitzmüller :
> 
> Am Sonntag, dem 07.03.2021 um 16:53 +0100 schrieb Stephan Witt:
>> No I don’t want to enhance it *now*. We are in feature-freeze IMO.
> 
> Are we? I must have missed the announcement. Can you point me to it?

https://wiki.lyx.org/Devel/Meeting2021-01-11

> (I agree that we should enter feature freeze soon, though).
> 
>> 
>>> I see. Can you try (and maybe play with) the attached patch?
>> 
>> This is better now.
> 
> Goof. Will commit, then.

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-07 Thread Jürgen Spitzmüller
Am Sonntag, dem 07.03.2021 um 16:53 +0100 schrieb Stephan Witt:
> No I don’t want to enhance it *now*. We are in feature-freeze IMO.

Are we? I must have missed the announcement. Can you point me to it?

(I agree that we should enter feature freeze soon, though).

> > > > > 
> > I see. Can you try (and maybe play with) the attached patch?
> 
> This is better now.

Goof. Will commit, then.

> Next problem: I cannot remove the learned word from document
> dictionary?
> Should this work?

No, I haven't implemented this yet. My idea was to allow this via
document > settings > language. Or do you want and lfun instead/as
well?

Jürgen



signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-07 Thread Stephan Witt
Am 07.03.2021 um 14:36 schrieb Jürgen Spitzmüller :
> 
> Am Sonntag, dem 07.03.2021 um 14:04 +0100 schrieb Stephan Witt:
>>> I can't follow you here. Sure it is.
>> 
>> IMO it is a new feature.
> 
> Where did I claim it isn't?
> 
> If you want to enhance it: be invited.

No I don’t want to enhance it *now*. We are in feature-freeze IMO.

> Also, as you say it is marked correctly after context menu
> action,
> there is probably only some call missing here.
 
 Yes, probably.
>>> 
>>> I have just looked again at AppleSpellChecker and really do not see
>>> how
>>> this is so special. Maybe you just need to debug a bit
>>> Paragraph::spellCheck() (the routine which is in if (speller-
 canCheckParagraph())). Well likely just a simple oversight. Check
 for
>>> the return values of speller->check() gathered here. It should be
>>> LEARNED_WORD for the cases in question.
>> 
>> The difference is made by the canCheckParagraph() method of spellers.
> 
> Yes, I know (see my comment above).
> 
>> Paragraph::spellCheck() has different code paths for it.
>> 
>> With paragraph check enabled - see AppleSpellChecker.h - the speller
>> sees the whole sentence as a word and marks one or more words as mis-
>> spelled at once.
> 
> I see. Can you try (and maybe play with) the attached patch?

This is better now.

Next problem: I cannot remove the learned word from document dictionary?
Should this work?

Stephan
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-07 Thread Jürgen Spitzmüller
Am Sonntag, dem 07.03.2021 um 14:04 +0100 schrieb Stephan Witt:
> > I can't follow you here. Sure it is.
> 
> IMO it is a new feature.

Where did I claim it isn't?

If you want to enhance it: be invited.

> > > > Also, as you say it is marked correctly after context menu
> > > > action,
> > > > there is probably only some call missing here.
> > > 
> > > Yes, probably.
> > 
> > I have just looked again at AppleSpellChecker and really do not see
> > how
> > this is so special. Maybe you just need to debug a bit
> > Paragraph::spellCheck() (the routine which is in if (speller-
> > > canCheckParagraph())). Well likely just a simple oversight. Check
> > > for
> > the return values of speller->check() gathered here. It should be
> > LEARNED_WORD for the cases in question.
> 
> The difference is made by the canCheckParagraph() method of spellers.

Yes, I know (see my comment above).

> Paragraph::spellCheck() has different code paths for it.
> 
> With paragraph check enabled - see AppleSpellChecker.h - the speller
> sees the whole sentence as a word and marks one or more words as mis-
> spelled at once.

I see. Can you try (and maybe play with) the attached patch?

Jürgen
diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 008ed0e461..00d9dc1de4 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -460,10 +460,12 @@ public:
 		return numskips;
 	}
 
-	void markMisspelledWords(pos_type const & first, pos_type const & last,
-			 SpellChecker::Result result,
-			 docstring const & word,
-			 SkipPositions const & skips);
+	void markMisspelledWords(Language const * lang,
+ pos_type const & first, pos_type const & last,
+ SpellChecker::Result result,
+ docstring const & word,
+ SkipPositions const & skips,
+ vector const & docdic);
 
 	InsetCode ownerCode() const
 	{
@@ -4924,10 +4926,12 @@ void Paragraph::anonymize()
 
 
 void Paragraph::Private::markMisspelledWords(
+	Language const * lang,
 	pos_type const & first, pos_type const & last,
 	SpellChecker::Result result,
 	docstring const & word,
-	SkipPositions const & skips)
+	SkipPositions const & skips,
+	vector const & docdict)
 {
 	if (!SpellChecker::misspelled(result)) {
 		setMisspelled(first, last, SpellChecker::WORD_OK);
@@ -4945,7 +4949,8 @@ void Paragraph::Private::markMisspelledWords(
 		int wlen = 0;
 		speller->misspelledWord(index, wstart, wlen);
 		/// should not happen if speller supports range checks
-		if (!wlen) continue;
+		if (!wlen)
+			continue;
 		docstring const misspelled = word.substr(wstart, wlen);
 		wstart += first + numskipped;
 		if (snext < wstart) {
@@ -4955,12 +4960,27 @@ void Paragraph::Private::markMisspelledWords(
 wstart - 1, SpellChecker::WORD_OK);
 		}
 		snext = wstart + wlen;
+		vector::const_iterator iit = docdict.begin();
+		SpellChecker::Result actresult = result;
+		for (; iit != docdict.end(); ++iit) {
+			if (iit->lang()->code() != lang->code())
+continue;
+			if (iit->word() == misspelled) {
+actresult = SpellChecker::WORD_OK;
+break;
+			}
+		}
 		numskipped += countSkips(it, et, snext);
 		/// mark the range of misspelling
-		setMisspelled(wstart, snext, result);
-		LYXERR(Debug::GUI, "misspelled word: \"" <<
-			   misspelled << "\" [" <<
-			   wstart << ".." << (snext-1) << "]");
+		setMisspelled(wstart, snext, actresult);
+		if (actresult == SpellChecker::WORD_OK)
+			LYXERR(Debug::GUI, "local dictionary word: \"" <<
+   misspelled << "\" [" <<
+   wstart << ".." << (snext-1) << "]");
+		else
+			LYXERR(Debug::GUI, "misspelled word: \"" <<
+   misspelled << "\" [" <<
+   wstart << ".." << (snext-1) << "]");
 		++snext;
 	}
 	if (snext <= last) {
@@ -4992,7 +5012,7 @@ void Paragraph::spellCheck() const
 			BufferParams const & bparams = d->inset_owner_->buffer().params();
 			SpellChecker::Result result = !word.empty() ?
 speller->check(wl, bparams.spellignore()) : SpellChecker::WORD_OK;
-			d->markMisspelledWords(first, last, result, word, skips);
+			d->markMisspelledWords(lang, first, last, result, word, skips, bparams.spellignore());
 			first = ++last;
 		}
 	} else {


signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-07 Thread Stephan Witt
Am 07.03.2021 um 13:54 schrieb Jürgen Spitzmüller :
> 
> Am Sonntag, dem 07.03.2021 um 13:45 +0100 schrieb Stephan Witt:
>> I see more than one problem.
>> 
>> 1. The spell checker on Mac is an OS service and there is support for
>> document scope too. Probably this collides with our implementation in
>> LyX.
> 
> Why is this a problem? The implementation I have done is OS-independent
> and should work on the Mac, too. AppleSpellChecker really does not
> strike me too different from the other spellers.
> 
>> 2. Document local dictionary is only one option to improve the
>> situation.
>> Imagine documents for specific context - e.g. medical or chemical
>> science -
>> there it would be better to associate the document with a dedicated
>> personal
>> dictionary and/or even share it with colleagues.
> 
> How does this relate to the problem we are just talking about? The
> feature request I addressed was about document local dictionaries,
> nothing else.

Yes, and I propose to do it in a more general way instead.

>> 3. IMO this wasn’t a bug fix - it’s an enhancement or a new feature.
> 
> I can't follow you here. Sure it is.

IMO it is a new feature.

>>> Also, as you say it is marked correctly after context menu action,
>>> there is probably only some call missing here.
>> 
>> Yes, probably.
> 
> I have just looked again at AppleSpellChecker and really do not see how
> this is so special. Maybe you just need to debug a bit
> Paragraph::spellCheck() (the routine which is in if (speller-
>> canCheckParagraph())). Well likely just a simple oversight. Check for
> the return values of speller->check() gathered here. It should be
> LEARNED_WORD for the cases in question.

The difference is made by the canCheckParagraph() method of spellers.

Paragraph::spellCheck() has different code paths for it.

With paragraph check enabled - see AppleSpellChecker.h - the speller
sees the whole sentence as a word and marks one or more words as mis-spelled
at once.

Stephan
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-07 Thread Jürgen Spitzmüller
Am Sonntag, dem 07.03.2021 um 13:45 +0100 schrieb Stephan Witt:
> I see more than one problem.
> 
> 1. The spell checker on Mac is an OS service and there is support for
> document scope too. Probably this collides with our implementation in
> LyX.

Why is this a problem? The implementation I have done is OS-independent
and should work on the Mac, too. AppleSpellChecker really does not
strike me too different from the other spellers.

> 2. Document local dictionary is only one option to improve the
> situation.
> Imagine documents for specific context - e.g. medical or chemical
> science -
> there it would be better to associate the document with a dedicated
> personal
> dictionary and/or even share it with colleagues.

How does this relate to the problem we are just talking about? The
feature request I addressed was about document local dictionaries,
nothing else.

> 3. IMO this wasn’t a bug fix - it’s an enhancement or a new feature.

I can't follow you here. Sure it is.

> > Also, as you say it is marked correctly after context menu action,
> > there is probably only some call missing here.
> 
> Yes, probably.

I have just looked again at AppleSpellChecker and really do not see how
this is so special. Maybe you just need to debug a bit
Paragraph::spellCheck() (the routine which is in if (speller-
>canCheckParagraph())). Well likely just a simple oversight. Check for
the return values of speller->check() gathered here. It should be
LEARNED_WORD for the cases in question.

Best,
Jürgen



signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-07 Thread Stephan Witt
Am 07.03.2021 um 13:36 schrieb Jürgen Spitzmüller :
> 
> Am Sonntag, dem 07.03.2021 um 13:24 +0100 schrieb Stephan Witt:
>> The first document has „unrrund“ in local dictionary and therefore it
>> shouldn’t
>> marked as mis-spelled. On Mac the spellchecker doesn’t check words -
>> it checks
>> paragraphs and so it misses the entries in local dictionary.
>> 
>> That’s not easy to fix.
> 
> But isn't AppleSpellChecker::check() triggered on the paragraphs when a
> document is opened? And this does check for WordLangTuples, and we
> check for the existence of the word within the docdic before doing
> anything else.
> 
> So I really do not understand what the problem here is.
> 
> (It is possible that I missed something on implementation, as I
> couldn't test the Mac speller, but I fail to see a conceptual problem
> here).

I see more than one problem.

1. The spell checker on Mac is an OS service and there is support for 
document scope too. Probably this collides with our implementation in LyX.

2. Document local dictionary is only one option to improve the situation.
Imagine documents for specific context - e.g. medical or chemical science -
there it would be better to associate the document with a dedicated personal
dictionary and/or even share it with colleagues.

3. IMO this wasn’t a bug fix - it’s an enhancement or a new feature.

> Also, as you say it is marked correctly after context menu action,
> there is probably only some call missing here.

Yes, probably.

Stephan
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-07 Thread Jürgen Spitzmüller
Am Sonntag, dem 07.03.2021 um 13:24 +0100 schrieb Stephan Witt:
> The first document has „unrrund“ in local dictionary and therefore it
> shouldn’t
> marked as mis-spelled. On Mac the spellchecker doesn’t check words -
> it checks
> paragraphs and so it misses the entries in local dictionary.
> 
> That’s not easy to fix.

But isn't AppleSpellChecker::check() triggered on the paragraphs when a
document is opened? And this does check for WordLangTuples, and we
check for the existence of the word within the docdic before doing
anything else.

So I really do not understand what the problem here is.

(It is possible that I missed something on implementation, as I
couldn't test the Mac speller, but I fail to see a conceptual problem
here).

Also, as you say it is marked correctly after context menu action,
there is probably only some call missing here.

Jürgen



signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-07 Thread Stephan Witt
Am 07.03.2021 um 12:35 schrieb Jürgen Spitzmüller :
> 
> Am Sonntag, dem 07.03.2021 um 11:24 +0100 schrieb Stephan Witt:
>> On Mac it doesn’t work well.
>> 
>> 1. Mark a word as ignored per-document.
>> 2. Save it.
>> 3. Close it.
>> 4. Reopen it.
>> 5. The ignored word is misspelled.
>> 6. Open context-menu w/o doing any action and close it.
>> 7. Word is not misspelled anymore.
>> 
>> My example document is attached.
> 
> Did you update inbetween? I have changed the syntax of the buffer param
> today, so documents saved before 0b42f77551 lost their dictionaries.

Yes.

> As to the examples: I don't know how they are meant to be interpreted.
> Spellcheck-1.lyx has "unrrund" in the dictionary, and this does not get
> marked when I open it (as expected). Spellcheck-2.lyx doesn't have an
> item in the dictionary, and, as expected, "unrrund" is marked.

Yes, sorry. I’ve changed my mind what to attach after the mail text was 
finished.

The first document has local dictionary and the second document not. 
So it’s easy to test the effects of the change.

The second document has „unrrund“ mis-spelled all the time and this is ok.

The first document has „unrrund“ in local dictionary and therefore it shouldn’t
marked as mis-spelled. On Mac the spellchecker doesn’t check words - it checks
paragraphs and so it misses the entries in local dictionary.

That’s not easy to fix.

Stephan
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-07 Thread Jürgen Spitzmüller
Am Sonntag, dem 07.03.2021 um 11:24 +0100 schrieb Stephan Witt:
> On Mac it doesn’t work well.
> 
> 1. Mark a word as ignored per-document.
> 2. Save it.
> 3. Close it.
> 4. Reopen it.
> 5. The ignored word is misspelled.
> 6. Open context-menu w/o doing any action and close it.
> 7. Word is not misspelled anymore.
> 
> My example document is attached.

Did you update inbetween? I have changed the syntax of the buffer param
today, so documents saved before 0b42f77551 lost their dictionaries.

As to the examples: I don't know how they are meant to be interpreted.
Spellcheck-1.lyx has "unrrund" in the dictionary, and this does not get
marked when I open it (as expected). Spellcheck-2.lyx doesn't have an
item in the dictionary, and, as expected, "unrrund" is marked.

Jürgen



signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-07 Thread Stephan Witt
Am 06.03.2021 um 18:25 schrieb Scott Kostyshak :
> 
> On Sat, Mar 06, 2021 at 05:54:27PM +0100, Jean-Marc Lasgouttes wrote:
>> Le 06/03/2021 à 16:52, Juergen Spitzmueller a écrit :
>>> commit 07396ab2445720b21dc8195816eb1aee1f2ae3a7
>>> Author: Juergen Spitzmueller 
>>> Date:   Sat Mar 6 16:53:33 2021 +0100
>>> 
>>> Meet per-document spelling dictionaries (fixes #86 [sic!])
>> 
>> Great news!
> 
> Well done! I look forward to testing this feature.

On Mac it doesn’t work well.

1. Mark a word as ignored per-document.
2. Save it.
3. Close it.
4. Reopen it.
5. The ignored word is misspelled.
6. Open context-menu w/o doing any action and close it.
7. Word is not misspelled anymore.

My example document is attached.

Stephan



Spellcheck-1.lyx
Description: Binary data


Spellcheck-2.lyx
Description: Binary data
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-06 Thread Jean-Marc Lasgouttes

Le 06/03/2021 à 21:06, José Abílio Matos a écrit :

On Saturday, March 6, 2021 5:52:53 PM WET Jean-Marc Lasgouttes wrote:

Don't tempt me. Or a flutter frontend?

JMarc


I suggest instead a probably less known toolkit: xforms. It is a small code
base but the mailing list is still active, the last messages are from last
December. :-D


The real added value would be ascii terminal.

JMarc

--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-06 Thread José Abílio Matos
On Saturday, March 6, 2021 5:52:53 PM WET Jean-Marc Lasgouttes wrote:
> Don't tempt me. Or a flutter frontend?
> 
> JMarc

I suggest instead a probably less known toolkit: xforms. It is a small code 
base but the mailing list is still active, the last messages are from last 
December. :-D

-- 
José Abílio


-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-06 Thread Jean-Marc Lasgouttes

Le 06/03/2021 à 18:25, Scott Kostyshak a écrit :

You are cheating here. Only #88 is available.


If you want, we can reopen 1 and you can add a gtk 4.0 frontend to fix it?


Don't tempt me. Or a flutter frontend?

JMarc
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Meet per-document spelling dictionaries (fixes #86 [sic!])

2021-03-06 Thread Scott Kostyshak
On Sat, Mar 06, 2021 at 05:54:27PM +0100, Jean-Marc Lasgouttes wrote:
> Le 06/03/2021 à 16:52, Juergen Spitzmueller a écrit :
> > commit 07396ab2445720b21dc8195816eb1aee1f2ae3a7
> > Author: Juergen Spitzmueller 
> > Date:   Sat Mar 6 16:53:33 2021 +0100
> > 
> >  Meet per-document spelling dictionaries (fixes #86 [sic!])
> 
> Great news!

Well done! I look forward to testing this feature.

> >  Now who can beat that? ;-)
> 
> You are cheating here. Only #88 is available.

If you want, we can reopen 1 and you can add a gtk 4.0 frontend to fix it?

Scott


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel