Yes, I've thought about this.
You could indeed imagine a context menu item in the TOC "Insert
reference to section", that will insert a label and a reference at
once. Or one can think of a second tab in the cross-reference dialog
showing all sections too.
OK, let's move this to devel, then.
Here's the problem that occurred to me: What if there's already a
label there? Do we do that check first? If so, how? The label doesn't
have to be in the section environment itself.
Why ? Can't we find out the part of the text, where there might be a label ?
Maybe if it's not, we can add it? Duplicate labels aren't such a
problem, really.
Technically not, but if I have a document in which multiple labels point
to the same thing, I will get confused or I will make errors.
Another solution would be a kind of "implicit" label, that doesn't
actually surface in LyX at all. Every section-type entity, and maybe
other things, too---figures, tables, etc---could have an "implicit"
label which would get generated with the LaTeX but not actually appear
in LyX. Maybe the way to do this wouldn't be so different: We could
just have an invisible inset that was there, but not drawn. I'm not sure.
Same as before, if I'd rename a section and there is an invisible label
I will easily forget whether the label should still refer to this
section, or if I delete a section, I want to be reminded to move the
label to its new place. The same with copy-pasting, moving, etc.
Richard
Vincent