Next: , Previous: Text, Up: Dimensions

3.4 Structured Text coordinates

Structured text coordinates are similar to text coordinates (see Text), with the addition of moving by nested blocks as used in many markup languages, in a manner similar to structural coordinates (see Structural).

The dimensions available in structured text coordinates are:

Nested blocks extend the idea of bracketed expressions, to things where the brackets are not single characters but things such as HTML tags.

The definition of block syntax is mode-specific. For example, in HTML, paired tags are defined to begin and end blocks.

The commands for moving backwards and forwards over nested blocks are similar to those for moving over bracketed s-expressions, but use opening and closing tags, such as those in HTML, instead of parentheses.

Likewise, the commands for moving in and out of levels of nested blocks are similar to those for moving in and out of bracketed lists.

In modes supported structured forms of text, Versor's sexp-based commands (see Structural) are extended to handle the language syntax. This is built on top of the nested blocks facility, and provides behaviour which is more consistent with that provided for programming languages. This is recommended in preference to the bare “structured text” / “nested blocks” facility (which, however, is still available should you prefer it).

An associated command is another-block which analyzes the block before point (that is, from a closing-block construct back to the corresponding opening-block construct), collects up all the structuring constructs in it, and inserts a copy of those at point. For example, if point is just after an HTML table row (so that the tag most immediately before point is </tr>, the HTML table row ender), another-block will find all the HTML tags back to the corresponding <tr>, and insert them, but without the intervening non-tag text. (This specific example is probably the most useful use of this command, in the author's experience.)

This part of Versor is very much a work in progress, and you are encouraged to add to the definition of block syntax for your favourite markup language, and send it to the author of Versor. The block syntax mechanism is defined in the file nested-blocks.el. Logo