Le 17 août 07 à 12:34, Dov Feldstern a écrit :

It's not just a matter of convenience --- I'm still not convinced that insets are *conceptually* right in this case.

An inset conveys to me the following idea: I have the main text, and then inside it is something which is a *break* from the normal flow. It may be an integral part of the text, but it's still a break in some *textual* sense. Notes, footnotes, equations --- in fact, nearly all of the insets we currently have --- fit into this category.

Then the question is: *should* they all fit into this category? I see no particular reason for that constraint. Besides, does a note and an equation really constitute comparable breaks? What about ERTs, notes and spaces which are insets? (Do they really constitute a textual break?) What about lists (and layouts in general) which are not insets? (Don't they constitute textual breaks?)

I don't think that ignore-spellcheck fits into this model. It is not a textual break --- it doesn't really have any textual significance. It's more of a technical thing. I think this fits in better in a slightly different concept, which is that of "marking off" regions of the text.

It has a "technical" significance indeed (even though it may be used for delimitating natural and technical languages). Nevertheless it responds to a user need among all other needs (textual among others), even if it has no consequence into the output (BTW, this is true also for notes).

Can I clearly delineate when something should be an inset and when a region? No. There are probably many gray areas, and whether a region or an inset is preferred in these cases is mainly a matter of taste.

Why do you feel the need to delineate?

But I'll try anyhow to give some guidelines which make sense to me:

An inset is the right idea when everything inside of it --- without even knowing what's going to be inside it --- should inherit whatever property the inset is endowing. So for example, when I insert a Note, then I'm saying that everything inside is not part of the text, it's notes to the author. Even if I insert a footnote, or a graphic, or whatever, these should all not be displayed. Or, if I insert an image in a footnote, then I want that image to appear inside the footnote, not in the main text.

With a "NoSpellcheck" inset, everything inside it is not spellchecked, unless you use a "Spellcheck" inset at some point inside. This behavior is not bad, as not unclear to the user IMO.

A region should be preferred when that kind of guarantee can't be made. For example, when I say that part of the text should be \emph, does that mean that also a footnote from within that text should be \emph? I don't think so.[*] Same with language: the fact that I switch languages within a text does not mean that everything "within" this language will also be of the same language.

Then, if you put a footnote inside a foreign language region, what should be the language of this footnote? Perhaps you (as me) have no answer to this. I think this is normal because it depends on the context (the kind of document you're writing).

Of course, one could implement virtually all these situations with either only insets or only regions. But the fact is, there is a conceptual difference between the two, and it makes sense to support both concepts at the implementation level.

What about merging those two things? What you call a "conceptual difference" is only a slightly different behavior, and an internal property in my vision. This property doesn't have to be known by the user, despite it should be specified at implementation level. The user shouldn't have to think of such things.

Getting back to spell-checker, IMO spell-checking belongs more to the region concept than to the inset concept. Obviously, not everyone agrees with this ;).

If you looked at my last patch, you can imbricate "NoSpellcheck" and "Spellcheck" insets. So obviously, I agree with this behavior ;) However, insets and regions could be the same thing: a delimited area of text having some properties useful to the user. This area could be drawn on screen in many different ways.

But portraying things as if we're just trying to do what's easiest, without thinking of the concepts, is not really fair...

Well, you cannot make me forget that replacing one info by another info and two processes for each of comment, note and unselected branches, is not a good thing (due to maintainability). Perhaps, nothing but the font and character themselves should be stored into a font or character property.

[*] Actually, in this case in LyX we *do* currently make the text of the footnote \emph. I think the rationale for doing this is one of user experience: generally speaking, I think the user expects the font attributes to remain as they are, until explicitly changed. However, in this specific case, I imagine that users will usually switch off \emph within the footnote.

Not sure. Is there a bug about this? Again this may depend on the context (or personal habits).

Mael.


Reply via email to