Next: , Previous: Tables, Up: Dimensions

3.6 Program coordinates

Program coordinates uses the syntax of programming languages to guide to the selection movements. This uses the accompanying package, Languide (see Top (languide)), to provide the primitives for moving around source code. It is, of course, mode-specific.

Languide definitions are already reasonably comprehensive for Lisp, C, Perl and Java, in progress for shell scripts, and planned for Haskell and Python. They would probably not be meaningful for PostScript. You are encouraged to contribute further or better definitions, both for the languages already covered and for others.

The dimensions defined in program coordinates are as follows:

Apart from the statement-related dimensions, these are the same as those in structural coordinates Structural.

Movement by statement parts moves the selection between parts of the current statement. Programming language statements can typically be divided into two or three parts, as follows:

  1. The head of a statement is often a condition, such as in an if or a while statement.
  2. The body of a statement is typically another statement, or a group of statements, such as the body of an if or a while statement.
  3. The tail of a statement occurs in only a few statement types, such as if-then-else or try-catch-finally.

The “statement parts” dimension will move between these in turn, and can also moved to the container of the current statement, that is, a grouping statement surrounding it.

when you select the body of a statement, and the body is a compound statement, you can then either:

If using voice input (see Voice input), it is convenient to define commands such as “head”, “body”,and “container”, so that you can jump directly to the one you want rather than treating it as part of a sequence. The commands navigate-this-head, navigate-this-body, navigate-this-tail, navigate-this-whole, and navigate-this-container are available for binding directly to voice commands (or, for that matter, to keys of their own).

The “statement” dimension moves between successive statements at the same structural level. This is different from the statement movements provided as part of the GNUemacs' C-mode, which moves in and out of compound statements. Logo