Mael Hilléreau wrote:
Selon Dov Feldstern <dfeldstern-rhxOsnTko2JWk0Htik3J/[EMAIL PROTECTED]>:
Mael Hilléreau wrote:
Selon Helge Hafting <[EMAIL PROTECTED]>:
I want my disabled branches spellchecked. :-/
I write a test with hidden answers. I want to spellcheck everything,
so I can print the answers later without further checking & editing.
That's why there's a checkbox in the preference pane :) (see the patch at
bug
1509).
Helge is right (I'm not sure if this is what he meant or not) in that
there's a difference between Notes and disabled branches. Presumably,
notes are not meant to be output (though even that is not certain,
especially given that it's now very easy to switch between different
kinds of notes, some of which *are* output), whereas inactive branches
*are* meant to be output, just not in every "version" of the document.
So it's very possible for someone to want to spellcheck inactive
branches, but not notes.
Agreed. I have a simple solution: use 2 checkboxes. One for notes, the other for
disabled branches.
Sure it's simple enough, but then a third person wants comments (as
opposed to notes) treated a third way, a fourth wants to be able to
choose *which* instances of notes he wants spell checked and which he
wants ignored, etc., etc. It becomes too ad-hoc, the code gets more and
more complicated in order to deal with ever-more specific cases, and we
are still not as flexible as possible.
That's why I think we're better off starting with a very basic level: it
will allow maximum flexibility, because the user can do *anything*. And
it's a simple concept, so the user also knows exactly what to expect,
and can easily *see* what's going on if necessary. And as I explained,
we can still make it easier to work with by building layers on top of
that; but because it's simple at the basic level, then it's easy to
override in specific cases in which the more sophisticated layers don't
do exactly what the user wants. And then *we* don't have to provide for
every single case, but we still allow the user to deal with any case.
But this starts getting really complicated. On the one hand, as JMarc
said, we don't need to go with "everything is customizable". On the
other hand, I think that it is bad if the spell checker ignores text
which the user thinks that it is checking --- so it should be very clear
to the user what is or is not being checked. And ignoring text --- any
text, even if it isn't going to be output, even if it's in a code
segment --- without letting the user have it spell checked could be very
annoying to some users.
I propose: default value = spellcheck anything unless the layout says not to do
it. If the user clicks on the checkbox, he'll know what will happen.
But it's not just layout: you just provided 2 checkboxes above, which
are in addition to the layouts. It starts getting complicated. Let's say
that I now want to know exactly which parts of my document are going to
be spell checked (or ignored by the spell-check) --- is there an easy
way for me to find that out? The more rules there are, the more check
boxes and layout definitions, etc., the harder it becomes to answer that
simple question.
Don't get me wrong --- I like the idea of being able to define a layout,
or character style, or inset type, that will ignore spelling. But that
should not be the most basic layer: the basic layer should be dead
simple, I shouldn't have to think about it at all.
The question is, can we reach some kind of solution which will, on the
one hand, be simple (hopefully also to implement, but more importantly:
for the user to understand how it works) and on the other hand, flexible
enough to handle all these different preferences?
It seems to me like perhaps the best solution is to have a character
attribute --- similar to language or font --- which specifies whether
or not text is to be spell checked. On top of that we can add another
layer which will automatically set this attribute in an intelligent way
(ignore text which doesn't go to output, etc.) --- but since the base
level is simple, it's not so important if the layers on top of that
don't always do the right thing. This solution could then also be
integrated into the spell checker, and then when a word pops up which we
want to ignore in a specific instance (and not add to the personal
dictionary), all the spell checker needs to do is change this attribute
for that specific instance of that specific word. Finally, we could also
optionally mark this in the GUI (say, with a green underline, similar to
the blue underline used to mark foreign languages) so that the user can
always easily find out what is or is not being spell checked.
What about an inset? This would be clear enough IMO. And that doesn't exclude
having a list of ignored words per document.
There are a few reasons why I prefer character styles to insets:
*) I think it'll be easier to deal with when we get to generating the
latex: this marking of text should have absolutely no effect on how the
text is output to latex. But if it's in a separate inset, that would be
hard to achieve, I think: there are certain things which happen at the
latex output stage when we open/close insets, which should *not* happen
in this case. Dealing with that will complicate that code quite a bit,
and it's already too complicated.
*) From a purely aesthetic point of view, I think that character styles
are more appropriate if I want to be able to mark small chunks of text
here and there.
*) In addition, it would be easier to turn a green underline on or off
at will, that to do such a thing with an inset...
Mael.
Dov