Structured editing

As a general rule, the behaviour of most structured editing operations is conditioned by the innermost tag for which a particular behaviour has been defined.

For instance, the structured insertion commands A-left, A-right, A-up and A-down have a particular meaning both inside tables and trees. Inside tables, they allow you to insert new rows and columns (see figure ?). Inside trees, they correspond to the insertion of new nodes (see figure ?). Whenever you inside a tree inside a table, then the innermost tag is a tree, and node insertions will take precedence over the insertion of new rows and columns.

In many cases, a “default particular behaviour” has been defined for all tags minus some exceptional ones. In our example of structured insertion, the default behaviour of A-left and A-right is to insert a new argument to the tag at the left or at the right (when allowed).

(
a b| c
d e f
) (
a b | c
d e f
) (
a | b c
d e f
) (
a b c
|
d e f
) (
|
a b c
d e f
)

Figure 1. Assume that the cursor is at the position of | inside the left-most matrix. Then the four other matrices respectively correspond to the insertion of a new column at the left (A-left) or right (A-right), resp. a new row above (A-up) or below (A-down).

Figure 2. Assume that the cursor is at the position of | inside the left-most tree. Then the four other trees respectively correspond to the insertion of a new node at the left (A-left), at the right (A-right), above (A-up) or below (A-down).

Similarly, in the case of matrices, the keys A-home, A-end, A-pageup and A-pagedown can be used for inserting a new first or last column, resp. a new first or last row. The keys A-backspace and A-delete are mapped to the commands for backward resp. forward structured deletion. In the case of matrices, this will result in the removal of the column before or after the cursor (see figure ?). In order to remove the enclosing environment you may use C-backspace or C-delete.

(
a b| c
d e f
) (
b| c
e f
) (
a |c
d f
) b |

Figure 3. Assume that the cursor is at the position of | inside the left-most matrix. Then pressing the keys A-backspace and A-delete respectively result in the next two matrices. Pressing either C-backspace or C-delete replaces the matrix by the content of the cell in which you are, leaving you with the b at the right-hand side.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".