Arbortext Command Language > Commands > undo
  
undo
undo [ boundary | current | clear | mark | unmark | suspend | resume]
With no arguments, this command undoes the most recent change. A redo brings it back.
The options are only useful within ACL scripts. The boundary option causes Arbortext Editor to insert a boundary in the undo history so that a subsequent undo will restore changes up to the current change. Normally, when executing a function or alias mapped to a key or menu item, Arbortext Editor considers all changes made by the script as a single undoable event. The function or alias can use undo boundary to cause the changes to be considered as separately undoable operations.
If current is specified, then this command undoes all changes made by the currently executing function or alias and discards the undo history. This can be used to cancel the effect of a command script, for example, if the script prompts for confirmation and the user cancels the request.
If clear is specified, the undo buffer is cleared. You will not be able to undo any prior operations. Subsequent operations will begin to re-fill the undo buffer.
The mark option inserts a temporary boundary in the undo history that can be removed with the unmark option. This is useful if a script makes changes to the document and then raises a modal dialog to make additional changes. Normally, when a dialog is raised Arbortext Editor inserts a boundary in the undo history. This means the changes made before the dialog was raised would require a separate undo operation to undo. The script can use undo mark and undo unmark to cause the two sets of changes to be combined into a single undo event. See the example below.
If suspend is specified, then any changes made after the command will not be added to the undo history and cannot be undone. Use undo resume to re-enable the undo history. You should use the undo suspend command with care, since it is possible to disable undo history for all further edits to the document if undo resume is not called.
Undo operations are not added to the undo buffer.
Examples
und
undo boundary
undo current
# undo mark/unmark/current example:
if (insert_tag(name)) {
# Tag insertion succeeded, set a temporary boundary and
# raise the modify attributes dialog as a modal dialog
undo mark;
modify_tag -local -modal;
if (main::status != 0) {
undo current; # User cancelled so back out insert_tag change
} else {
# Dialog succeeded, so remove the temporary undo boundary so
# both operations will become a single undoable event.
undo unmark;
}
}
Related Topics
redo command