TutorialCut-and-Paste




Prev | Up | Next | Back | Forward | Tutorial Top

Both textual and structural cut-and-paste are supported.

Textual cut-and-paste is just like the cut and paste of a normal text editor. Arbitrary substrings of text can be cut out and inserted. The commands are cut-text (menu: Edit/Cut Text   X: Ctrl+WNT: Ctrl+X), and paste-text (menu: Edit/Paste Text   X: Ctrl+Y   NT: Ctrl+V).

Notice that the underscores are automatically adjusted for you.

Structural cut-and-paste operates similarly, but with structural fragments of the object. A structural cut clips the structural selection into a special clipboard buffer named *clipped*, and replaces the structural selection with the appropriate placeholder. The commands are cut-structure (menu: Edit/Cut Structure   X: Ctrl+Shift+W   NT: Ctrl+Shift+X), and paste-structure (menu: Edit/Paste Structure   X: Ctrl+Shift+Y   NT: Ctrl+Shift+V).

A structural paste is valid only when the structural selection is a placeholder of the same syntactic category as the contents of the clipboard. For example, an expression can never be pasted on top of an existing expression, or into a position where a statement is expected. This guarantees that the object being edited remains well formed.

Note that an error message is printed in the status pane when an incorrect structural paste is attempted.


Forward