5. Menu commands

5.1. File
5.2. View
5.3. Node
5.4. Session
5.4.1. Options
5.4.2. Open Files
5.4.3. File Lists
5.5. Bookmarks
5.6. User-defined
5.7. Help

The following paragraphs describe menu commands. Each submenu in TrEd has as its first item a tear-off line (- - - - -) which can be used to tear the menu off and place it as a separate window anywhere on your desktop.

5.1. File

Open ...

Opens an existing file that the user chooses in the Open dialog box.

Open URL ...

Displays a dialog window with an entry into which the user can enter a URL or a filename. TrEd can downloading and open files at least using http, ftp, and file protocols. Network protocols (http and ftp) are read-only. On UNIX systems, TrEd also supports the SSH protocol with URLs of the form ssh://[user@]host/remote-filename.

Note

Since the current implementation of SSH remote file transfer requires several subsequent login sessions each time a remote file is accessed, it is highly recommended that a password-less access (e.g. using Kerberos or SSH keys) is set up before remote files are opened in TrEd using the SSH protocol.

Additionally to the protocols already mentioned, TrEd supports a special protocol indicated by the URL prefix ntred:// used for communication with BTrEd servers. This protocol allows to inspect and change trees stored in memory of BTrEd servers.

New->From Template

Creates a new empty file with the same set of attributes as the file that the user chooses in the Open dialog box.

New->From Current

Creates a new empty file with the same set of attributes as the current open file. The command does nothing if no file is open.

Close

Closes current file. If the file is modified but not saved, the user is allowed to save it.

Close in Window

Closes the view on the file in the current window. All other views on the file remain untouched. If no other view on the file exists, the file is closed. If the file is modified but not saved, the user is allowed to save it.

Close and remove from filelist

Closes the current file and removes it from the current file-list. If the file is modified but not saved, the user is allowed to save it.

Filelist

Opens a Filelist dialog window which allows the user to manage lists of files used for easy file-to-file navigation. See more detail in Section 11, “Using File-Lists”.

Save

Saves the active file to the disk. The previous version of the file on the disk is renamed by appending `~' to the filename (according to the well-known UNIX convention for naming of backup files).

Save As ...

This command first asks the user to choose a desired output format, then opens the standard file dialog where new name and location of the file can be specified, and finally runs the Save command.

Recent Files

This submenu displays 10 most recently opened files. User may quickly reopen any of them by clicking on the corresponding item.

Previous File

Opens the previous file of the current filelist in the current view, if any (see Section 11, “Using File-Lists”). Unless displayed in some other view, the active file is closed (the user may be asked to save possible changes).

Next File

Opens the next file of the current filelist in the current view, if any (see Section 11, “Using File-Lists”). Unless displayed in some other view, the active file is closed (the user may be asked to save possible changes).

Print ...

Opens the Print Dialog. See Section 10, “Printing Trees” for a detailed information.

Edit config ...

Opens the configuration file in a simple text editor (see Section 12, “Configuration and customization” for the details about configuration options). To apply the new configuration, save the configuration file to disk and leave the editor press the Save and Apply button. To apply changes without saving them, press Apply. The Close button closes the editor without making any changes to the present configuration. A search entry on the bottom of the dialog window can be used for fast case-insensitive searches. When editing the configuration file, make sure you only define each configuration option once, since TrEd doesn't give you any warning about duplicated configuration entries. If an option occurs in the configuration file more than once, the latter occurrence has precedence.

Note

Some configuration options even if applied take effect only after restarting TrEd.

Reload config ...

Use this command to reload the configuration file from disk and apply the new options. This command is useful if you have changed the configuration file in a text editor or in an another running instance of TrEd. As above, note that some configuration changes still take effect only after restarting TrEd.

Reload stylesheets ...

Reloads display stylesheets from the file ~/.tred-stylesheets. This command is useful if you have changed the stylesheets in a text editor or in an another running instance of TrEd. For more information about stylesheets, see Section 9, “Customizing Tree Appearance: Stylesheets”.

Quit

Quit TrEd. The the user is allowed to save all open files containing unsaved changes.

5.2. View

Previous Tree

View the previous tree in the current file.

Next Tree

View the next tree in the current file.

Stipple Inactive Views

If this item is checked, inactive views are covered with a semi-transparent stipple pattern. This may improve orientation if working with more than one view, but also slightly reduces the clarity of trees displayed in the inactive views. (See also StippleInactiveWindows configuration option).

Draw boxes around labels

If this item is checked, square boxes are drawn around groups of node labels.

Draw boxes around edge labels

If this item is checked, square boxes are drawn around groups of edge attributes.

Show Hidden Nodes

Toggle visibility the ``hidden'' subtrees of the tree. If this item is checked, subtrees of nodes makred as hidden using a special FS-attribute (see FS-format description for details) and displayed. By default subtrees of hidden nodes including the nodes themselves are not displayed.

Highlight Attributes

Toggle highlighting certain attributes with user-definable set of colors. See Section 12, “Configuration and customization” for details on customizing colors and FS-format description to learn about how to specify which attributes are highlighted. In general, it is better to avoid this approach of changing tree appearance in favor of stylesheets (see Section 9, “Customizing Tree Appearance: Stylesheets”).

Sort Attributes in Dialogs

Toggle sorting attributes by name in all dialog windows displaying any form of a list of attributes or attribute values. By default, sorting is turned on. If turned off, depending on the format, attributes may be displayed in order of their declaration in the file. When this option is on, sorting of attributes may be further altered by the sort_attrs_hook.

Close current view

Closes the focused view if more than one views are present.

Split view horizontally

Create and focus a new view by splitting the current view horizontally. Sizes of the new and old view may be adjusted by dragging the bar between them. The user may focus a view by clicking into it. Most keyboard shorcuts as well as menu and button commands only apply to the focused view. The focused view is distinguished from other views by black border drawn around it (both color and width of this border may be customized, see HighlightWindowColor and HighlightWindowWidth configuration options described below). Inactive views may be further distiguished using a stipple pattern (see StippleInactiveWindows configuration option).

Split view vertically

Create and focus a new view by splitting the current view vertically. Sizes of the new and old view may be adjusted by dragging the bar between them. See also little more detailed description of Split view horizontally above.

List of sentences ...

Display a window containing a list of “sentences” of all trees in a current file. These “sentences” are computed in the same way as the content of the text line above the tree, e.g. using a get_value_line_hook or the text: stylesheet pattern (see Section 9, “Customizing Tree Appearance: Stylesheets”), or as a concatenation of special attribute values (i.e. attributes declared as @V in the FS format). In the list, buttons right-arrow display the corresponding sentence in the current TrEd view. Buttons gray-belly are used to select sentences. Selected sentences may be later inserted to tree selection fields, e.g. in the Print dialog and in the Copy trees dialog, by pressing the button with an arrow.

Select context ...

Open a dialog window where the user can select a binding context. Binding contexts are groups of user defined macro-bindings, usually identified with macro packages. See also Section 14, “User Macros”. The current context can also be selected from the first list in the top right corner of the main window, but this makes changing contexts fully keyboard accessible.

Select stylesheet ...

Open a dialog window where the user can select a display stylesheet. See Section 9, “Customizing Tree Appearance: Stylesheets”. A stylesheet can also be selected from the second list in the top right corner of the main window, but this menu makes changing stylesheets fully keyboard accessible.

Edit stylesheet ...

Open a dialog box with a stylesheet editor for the currently selected stylesheet. A styleseet defines which attributes should be displayed and defines the tree's overall appearance. See Section 9, “Customizing Tree Appearance: Stylesheets” for more detail.

List of available macros...

Display a window listing all user-defined menus and keyboard shortcuts (macros) in a selected context. User may run a macro by double-clicking on a corresponding item in the list, or by pressing the Run and Close button. In the latter case, the window is closed. There are several other buttons in the window. The first button, Include anonymous macros, controls whether macros available only via keyboard shortcut are displayed, the second button, See Perl names, toggles displaying of a column containing raw Perl name of macros, and another two buttons (Sort by name and Sort by keyboard shortcuts) control the order in which macros are listed. Finally, the button Export as HTML creates a handy reference from the listing in form of a a HTML document.

5.3. Node

New Node

Creates a new node and connects it as a child of the active node. Initially, all attributes of the new node are empty.

Remove Active Node

Passes all children of the active node to its parent and deletes the active node. This command is ignored if the active node is the root of the tree.

Insert New Tree

Inserts a new tree before the current tree. The new tree consists of a root-node only. Initially, attributes of this node are empty.

Insert New Tree After

Inserts a new tree after the current tree. The new tree consists of a root-node only. Initially, attributes of this node are empty.

Remove Whole Current Tree

Removes the current tree from the file and displays the following tree (or the preceding tree, in case the current tree was the last one in the file). The memory representation of the removed tree is destroyed.

Copy Trees

Displays a dialog allowing user to copy trees from the current file into another file currently opened in TrEd. The trees are selected by a comma separated list of ranges. The format of the list is the same as in the Print dialog.

Edit Node ...

Displays the dialog box Edit Node, which is in detail described in Section 8, “Editing node attributes”.

Find ...

This command displays a dialog box in which the user may specify a search criterion for a node search. The criterion is based on regular expressions, wild-card patterns or literal strings matches for attribute values. In the dialog, every permittable node attribute has an editable entry where the user specifies search criterion for the particular attribute. The user may choose the type of the search criterions to be a regular expressions, exhaustive regular expressions (when the whole value must match), wild-card pattern (where ? matches any character and * matches any number of any characters) or a literal string. The type of the criterion is selected in the Search method option-menu and applies to all entries.

In the Search file-list option-menu, the user may choose a file-list to search through. By default, this menu displays entry [Current file only], which is a virtual file-list containing just the current file.

When user presses Find button, TrEd searches for the first matching node in the selected file-list. A node matches the criterion if and only if every attribute of the node matches the criterion in the corresponding entry (empty criterions always match). If a matching node is found, the search stops and the matching node is displayed and made active.

Find Next ...

Finds a next node matching criteria specified in the previous use of the Find ... command.

Find Previous ...

Finds a preceding node matching the criterion specified in a previous use of the Find ... command.

5.4. Session

This menu lets user switch between currently open files, change current file-list and toggle some file-related options.

5.4.1. Options

Don't close on open

Do not close current file when opening a new one.

Add open files to default file-list

If this option is on, all opened files are added to the file-list Default so that the user could easily go back and forth using File->Previous File and File->Next File.

Preserve patterns on reload

If this option is checked, current attribute pattern setting is not replaced with the one from the file when current file is reloaded with by pressing the reload (see also the ReloadPreservesPatterns configuration option).

Build TGTS from CSTS

This CSTS-backend specific option allows to choose which of the two tree structures stored in a CSTS file should be presented as trees (the other is encoded in node attributes as child-to-parent node references).

5.4.2. Open Files

TrEd allows having multiple files open simultaneously. If the user tries to open a file while another file is already open, modified, and yet not saved (and the Don't close on open option is not checked) TrEd offers the user to save changes in the current file and close it, close it withought saving or to keep the file open. In the latter case, the file is not closed nor any changes are discarded. The file remains open even if not displayed by any view. Kept files can be viewed instantly in the active view by selecting the corresponding item in the Session menu under the Open files label. Any number of files can be simultaneously open in this way.

5.4.3. File Lists

The bottom part of the Session menu contains a section labeled File lists, where file-list currently known to TrEd are listed. User may switch to another file-list by choosing the corresponding item. If the file-list was not accessed during the session, the first file on the list is opened and displayed. Otherwise, the file last accessed on that list is re-opened and displayed. See detailed information about file-lists in Section 11, “Using File-Lists”.

5.5. Bookmarks

This menu contains user's bookmarks. Bookmarks are filenames with tree-number and node position attached. The list of user's bookmarks is maintained in a special file-list named Bookmarks.

Add to Bookmars menu command adds bookmark for the current node.

The Last action menu command automatically opens and shows the file tree and node where the user made a last change to the tree structure or a node attribute. This is extra position is stored in TrEd's configuration file and does not appear among bookmarks.

The rest of the Bookmarks menu lists all defined bookmarks. User may follow a bookmark by choosing the corresponding menu item.

5.6. User-defined

This menu contains user-defined commands in separate sub-menus for every binding context. New commands may be defined as macros (see Section 14, “User Macros”). Beside each menu entry is shown the default keyboard short-cut for the corresponding macro in the particular context. Here we give only a brief description of the few macros defined by default in the TredMacro context in the base macro file tred.mac.

Note

Note that, only a few of non-macro commands in TrEd are associated with a keyboard shortcut (other than the standard menu navigation using Alt and the underlined letter). The aim is to give the user maximum freedom of choice of available shortcuts for his or her own macro commands.

Save File (F2)

Provides a keyboard shortcut for the Save command.

Save and Go to Previous File (F11)

Save the current file and open the previous file on the current file-list.

Save and Go to Next File (F12)

Save the current file and open the next file on the current file-list.

Go to Previous File (Shift+F11)

Close the current file and open the previous file on the current file-list. If the current file contains unsaved changes, the user is allowed to save them.

Go to Next File (Shift+F12)

Close the current file and open the next file on the current file-list. If the current file contains unsaved changes, the user is allowed to save them.

Find (F3)

Invoke Node->Find ....

Find Next (F4)

Invoke Node->Find Next.

Copy Values (F5)

Copies all values of the active node to an internal clipboard. These values may be pasted to any other node using the Paste Values command.

Paste Values (F8)

Assignes the active nodes attribute values stored in an internal clipboard during the last call of the Copy Values command.

Cut Subtree (Ctrl+Insert)

Cuts off a subtree of the active node and stores it in an iternal clipboard. The cut subtree may be attached later to another node using the Paste Subtree command.

Paste Subtree (Shift+Insert)

Ataches a previously cut subtree to the active node.

Delete Node (F8)

Deletes active node. The node must be a leaf and must not be the root of the tree, otherwise this command is ignored.

Go to first tree (Home or Shift+<)

Displays the first tree in the file.

Go to first tree (Shift+Home)

Like Go to first tree, only applies to all views, if lock is pressed.

Go to last tree (End or Shift+>)

Displays the last tree in the file.

Go to to last tree (tied) (Shift+End)

Like Go to last tree, only applies to all views, if lock is pressed.

Go to... (Alt+g)

Promts the user to enter an ordinal number of a tree in the file and displays that tree.

Go to...(tied) (Alt+Shift+G)

Promts the user to enter an ordinal number of a tree in the file and displays that tree (depending on the status of the button lock either in the current view only or in all views).

New Node (r-brother) (F7)

Creates a new node as a right sibling of the active node (this command is ignored if the active node is the root-node).

New Node (son) (Shift+F7)

Creates a new child-node of the active node.

Perl-Search (Alt+H)

When invoked, a dialog with an editor for a Perl code snippet is displayed. The Perl code entered by user is then evaluated for every node of the tree in their natural ordering starting from the current node. The evaluation stops at first node for which the Perl code returns true (i.e. a defined non-zero value) and this node is activated.

The Perl code conforms to the very same rules as a macro, i.e. in brief, the variables $this and $root refer to the active node and root of the tree respectively. If $n refers to some node, then $n->{attr} is value of attr attribute for the node $n. The parent-node of $n is accessed via $n->parent, child-nodes of $n as $n->childnodes (returns a list), etc. Macros from the current context may be called as Perl subroutines. See Section 14, “User Macros” for details.

Perl-Search Next (Alt+Shift+H)

Searches the next node satisfying the Perl-expression specified in a previous usage of the command Perl-Search.

Swap nodes (values only) (Ctrl+PageUp)

Makes the active node exchange its attributes with its parent-node which effectively swaps the two nodes.

Prev node linearly (Ctrl+<)

Activate the previous node in the horizontal linear ordering of the tree (i.e. usually the node corresponding to the previous token or word in a sentence).

Next node linearly (Ctrl+>)

Activate the next node in the horizontal linear ordering of the tree (i.e. usually the node corresponding to the next token or word in a sentence).

View->Previous Tree ignore ties (,comma”)

Displayes the previous tree in the current file. Note that this shorcuts operates on the focused view only, even if button lock is pressed and all views are tied (and this is a feature).

View->Next Tree ignore ties (.dot” )

Displayes the next tree in the current file. Note that this shorcuts operates on the focused view only, even if button lock is pressed and all views are tied (and this is a feature).

View->Previous Tree (Ctrl+,)

Displayes the previous tree in the current view (or all views, if button lock is pressed).

View->Next Tree (Ctrl+.)

Displayes the next tree in the current view (or all views, if button lock is pressed).

5.7. Help

About

Displays the About dialog where the information about version, current file name and format, number of trees, and more is given.

Examine bindings

Displays a window where the user may safely test keyboard bindings. Every time a keyboard short-cut is pressed in the dialog, TrEd looks up if some macro is associated with the short-cut and displayes the result. No macros acrually executed.

Reload macros

Removes all macro code and variables from memory and reloads all macros. This command is useful when the user modifies the macros in a text editor and wants to check the result without having to restart TrEd.

Debugging messages

In this submenu the user may turn on and off various sets of debugging messages printed by TrEd on the standard or error output (e.g. in a terminal window). The following sets of debugging messages are defined: tred (messages produced by TrEd's GUI), macro (messages issued by TrEd when a macro is evaluated), hooks (messages issued by TrEd when a hook is evaluated), keyboard (messages produced by TrEd when a keyboard short-cut is pressed), backend (messages produced by I/O backends), view (messages produced by the displaying engine and errors raised during style-sheet evaluation).