Sun 11 Mar 2012 02:07:58 PM UTC, comment #3:
===reproducibility of the bug===
I am intrigued because I can reproduce the bug only if I use the vanilla .TeXmacs. On the other hand I don't have customizations for kbd-map of sections, and using both vanilla and custom .TeXmacs the key events are the same (as reported by the keyboard debugging tool) and creation of sections works normally.
===opinion on desirable behavior===
You probably can anticipate my strong viewpoint on this: the user is trying to give you some information with the selection, and you should use it in a well-defined way that she can rely upon after a few trial-and-error.
I think here the most useful is to realize that several paragraphs conform to the list protocol, hence: make one sectional heading out of each of them.
This is the efficient way to turn a collection of lines into headings. With > meaning selection start and < selection end:
becomes 3 headings
The question remains what to do in the more general case,
or even
In the TeXmacs representation paragraphs seem to be just implicated by an empty line.
I suggest to create a scheme function called "head-homogeneous?" that tests if in the selected collection all elements (in this case paragraphs) have the same head. For insance, if you select several items in an itemize a what-head? primitive should pick up what comes after the concat, because each item is
if all that is selected are items, they can be turned into sections. If there's something else, then ignore. The same goes for paragraphs, although the what-head? test should be special-cased for them because they (seem to) have this funky representation in terms of newlines.
Please correct if I overlooked something of the way the TeXmacs format works.
|