Opened 20 years ago

Closed 13 years ago

Last modified 9 years ago

#1509 closed enhancement (fixed)

Allow document parts to be skipped in spellchecking

Reported by: iainjunk@… Owned by: nobody@…
Priority: low Milestone: 2.0.0
Component: spell Version: unspecified
Severity: minor Keywords:
Cc: christian.ridderstrom@…, mael.hillereau@…

Description (last modified by Juergen Spitzmueller)

It would be a nice enhancement to be able to configure the spellchecker to avoid
certain paragraph environments. For example, I use a lot of LyX-Code paragraphs
which should not be spellchecked using a human language word list. For me the
ideal solution would be to set the spellchecker to avoid all paragraphs with the
LyX-Code format.

Attachments (3)

spellcheck-only-output-v3.patch (12.4 KB ) - added by mael.hillereau@… 17 years ago.
This patch gives more control over what is spellchecked
spellcheck-control-v6.patch (23.8 KB ) - added by mael.hillereau@… 17 years ago.
New patch with testing special insets and 3 checkboxes
spellcheck-only-output-v4.patch (14.1 KB ) - added by mael.hillereau@… 17 years ago.
Updated patch with two checkboxes

Download all attachments as: .zip

Change History (27)

comment:1 by levon, 20 years ago

Summary: Configure the spellchecker to avoid paragraph environmentsAllow some environments to be skipped in spellchecking
Version: 1.3.1unspecified

comment:2 by levon, 19 years ago

Owner: changed from levon to nobody@…

comment:3 by anderso@…, 19 years ago

I'll second that. This would also be useful for skipping spellchecking of
comments. I believe most users use the Comment environment for scrabbling down
quick reminders for them selves during the writing process. I know at least I
do. In this case it is mainly a waste of time spellchecking them since they are
only for your personal use during a limited time, and for that reason they tend
not to be very carefully written and thus contain many spelling errors. And more
importantly in my case I often write comments in my native language while the
document is in english. This means that the spellchecker stops on every word in
the comments.

comment:4 by leeming, 19 years ago

The set the language of the text to "your native language"...

comment:5 by anderso@…, 19 years ago

My point was that the text is in English while my comments are in another
language (Swedish). As far as I know I can set the language for the whole text
(in Layout->Document->Language) but not for single paragraphs or environments,
can I?

comment:6 by leeming, 19 years ago

Sure you can. Layout->Character dialog.

comment:7 by anderso@…, 19 years ago

I see, didn't know that. I still think it might be a nice feature to be able to
disable spellchecking of specific environments.

comment:8 by Uwe Stöhr, 17 years ago

Cc: christian.ridderstrom@… added

comment:9 by Uwe Stöhr, 17 years ago

* #1042 has been marked as a duplicate of this bug. *

comment:10 by chr, 17 years ago

#1042 was marked as a duplicate of this bug.

I'm not positive they are equivalent. Reading the summary and the previous
comments for this bug, it seems this bug is about telling the spell checker to
ignore certain *types* of environments, e.g. commments? Alternatively, this bug
(1509) isn't about types of environments, but of selecting certain instances of
environments to be ignored by the spell checker. However, that may still not
cover what I'd like as described in #1042.

The purpose of the feature requested in *#1042* can be described as follows:

!!! Function
I'd like to be able to mark different regions of a LyX document so that it is
not spell checked. The region may be a single paragraph, a subset of a paragraph
or even several paragaphs. Basically, I'd like to be able to select a part of
the document and then somehow indicate that this selection should not be parsed
by the spell checker.

!!! Motivation
One motivation for this functionality is that the spell checker cannot parse the
region properly. The reason for that could be that the region contains code (in
a LyX code environment, or data/code snipppets as normal text inlined in a
paragraph). Or it could simply be that the spell checker has no data on this
language.
Another motivation is that a region is really comments and it's language isn't
important, so I don't want to be bothered with spell checking it. This could
apply to comments of course.

!!! Solution
The solution suggesting in #1042 was that you would select a region and then
set the "language" of this region to "none", which would indicate that it should
not be parsed by the spell checker.

I am not particular to the solution chosed for implementing the features desired
as described in #1042 - Uwe was against introducing a bogus language - but I
don't think this bug (1509) covers all that I want.

comment:11 by Uwe Stöhr, 17 years ago

Summary: Allow some environments to be skipped in spellcheckingAllow document parts to be skipped in spellchecking

comment:12 by mael.hillereau@…, 17 years ago

This problem also applies to notes. I agree with Christian: #1042 (which
implies using "None" as language) isn't the same as this one. This bug is about
types whereas #1042 is about instances (but this isn't evident in the bug title).

Some checkboxes could be added to the preferences pane or to the
spellchecker dialog in order to ignore common layouts such as notes,
comments, or maybe disabled branches, or every layout that don't go to
output...

In addition, a complementary feature would be to add a new keyword into
layout files so that customized layouts could ignore spellchecking (IMO this is
not very useful, and maybe would need much more code to be written).

comment:13 by mael.hillereau@…, 17 years ago

Cc: mael.hillereau@… added

comment:14 by Uwe Stöhr, 17 years ago

Keywords: patch added
Milestone: 1.6.0

by mael.hillereau@…, 17 years ago

This patch gives more control over what is spellchecked

comment:15 by mael.hillereau@…, 17 years ago

attachments.isobsolete: 01

by mael.hillereau@…, 17 years ago

Updated patch with two checkboxes

comment:16 by mael.hillereau@…, 17 years ago

attachments.isobsolete: 01

comment:17 by bgrpt@…, 16 years ago

Is it possible to disable spell-checking of single words with this?
It would be nice if it is possible to mark them *Ignore in future spell-checks*
from the spell-checker and in Layout->Character.

comment:18 by Juergen Spitzmueller, 16 years ago

Milestone: 1.6.01.6.x

I wasn't aware we had a patch for this. Why hasn't this been sent to the list?

1.6 is feature-frozen. But this could be implemented during the 1.6.x cycle.

comment:19 by ps, 15 years ago

Priority: highlow

comment:20 by Juergen Spitzmueller, 14 years ago

Description: modified (diff)
Milestone: 1.6.x2.0.0

in LyX 2.0, notes and comments can be excluded from the spell checker:
http://www.lyx.org/trac/changeset/33468

Also, you can set any InsetLayout to be excluded:
http://www.lyx.org/trac/changeset/33467

I do not close this, since not all requests are met (paragraph environments, as initially requested, still cannot be excluded).

comment:21 by Juergen Spitzmueller, 14 years ago

Keywords: fixedintrunk added; patch removed

paragraph environments can be excluded now as well:
http://www.lyx.org/trac/changeset/33469

comment:22 by ps, 13 years ago

Keywords: fixedintrunk removed
Resolution: fixed
Status: newclosed

2.0.0 is ready

in reply to:  20 ; comment:23 by DF, 9 years ago

Replying to spitz:

in LyX 2.0, notes and comments can be excluded from the spell checker:
http://www.lyx.org/trac/changeset/33468

Also, you can set any InsetLayout to be excluded:
http://www.lyx.org/trac/changeset/33467

I do not close this, since not all requests are met (paragraph environments, as initially requested, still cannot be excluded).

Hello. Sorry in advance if this is not the proper place/way for this.

I noticed that even when "Spellcheck for Notes" is disabled, it still spellchecks text within elements that are inside Notes (such as in a footnote that is inside a Note, for example). Maybe this was the intended behviour for this. In my opinion any content inside the Note should be ignored in this case (since people often use Notes to comment out content, or to separate it temporarily from the main text).

in reply to:  23 comment:24 by Scott Kostyshak, 9 years ago

Replying to danielpferreira:

Hello. Sorry in advance if this is not the proper place/way for this.

I noticed that even when "Spellcheck for Notes" is disabled, it still spellchecks text within elements that are inside Notes (such as in a footnote that is inside a Note, for example). Maybe this was the intended behviour for this. In my opinion any content inside the Note should be ignored in this case (since people often use Notes to comment out content, or to separate it temporarily from the main text).

Hi Daniel,

Thanks for this feedback. Can you please open a new bug report for it? I agree with you that the spellcheck should skip everything in a note. I can reproduce the behavior you describe.

Thanks,

Scott

Note: See TracTickets for help on using tickets.