|<< Prev||- Up -||Next >>|
The commands in this chapter assist in editing Oz code. To achieve this, many of these are aware of the lexical or syntactical structure of Oz programs.
The Oz modes offer commands for creating new interactive buffers and quickly switching between Oz buffers:
oz-new-buffer(C-. n) [command]
Create a new buffer using the Oz major mode. Note that this buffer has no associated file name, so quitting Emacs will kill it without warning.
Switch to the previous resp. next buffer in the buffer list that runs in an Oz mode. If no such buffer exists, an error is signalled.
The preferred indentation style can currently be customized through the following user option:
3) [user option]
Number of columns that statements are indented w. r. t. the block containing them.
Several commands assist in formatting existing Oz code.
Reindent the current line. If
COUNT is given, reindent that many lines above and below point as well.
Reindent all lines at least partly covered by the current region.
Reindent every line in the buffer.
Reindent all lines at least partly covered by the Oz expression following point. For a description of what constitutes an Oz expression, see Section 3.5.
The following command assists in authoring Oz code.
Terminate the current line, i. e., delete all whitespace around point and break the line. If the user option
oz-auto-indent is non-
nil, indent both lines.
t) [user option]
Additionally, DEL is bound to the Emacs command
Fontification is the term used in Emacs for displaying text in different font faces, depending on its syntactical form and context, to ease reading of code. For example, comments and strings may be displayed in different colours.
Many major modes in Emacs provide several levels of fontification with increasing use of faces, but also increasing resource consumption. In the Oz modes, there are three levels. You can select one using the
font-lock-maximum-decoration user option, e. g., add the following line to your
(setq font-lock-maximum-decoration 3)
The default level depends on your version of Emacs.
The following user option controls automatic fontification in the OPI.
t) [user option]
nil, automatically invoke
font-lock-mode when any of the Oz modes is activated. If you prefer to control this via
global-font-lock-mode, you can set this to
nil) [user option]
If non-nil, highlight ill-placed whitespace. Note that this user option must be set before the
oz library is loaded.
The face in which ill-placed whitespace is highlighted.
Remove all ill-placed whitespace from the current buffer. This is all the whitespace that is highlighted in
fill-paragraph command, but handles Oz comments. If any of the current line is a comment, fill the comment or the paragraph of it that point is in, preserving the comment's indentation and initial percent signs. The buffer-local variable
fill-paragraph-function is bound to this command, so it will also be invoked by M-x fill-paragraph (M-q).
Comment or uncomment each line in the region. With just C-u as prefix argument, uncomment each line in region. A numeric prefix argument
ARG means use
ARG comment characters. If
ARG is negative, delete that many comment characters instead. Blank lines do not get comments.
Comment or uncomment each line in the region. See the
oz-comment-region command for more information; note that the prefix argument is negated though.
In this section, we use the term Oz definition to stand for the text from a
meth keyword up to its matching
end. Also, we use the term Oz expression to stand for the text corresponding to either a bracketed Oz construct (such as
end) or a single word.
Move point forward by one balanced Oz expression. With
COUNT, do it that many times. Negative
COUNT means backwards.
COUNT(M-C-@, M-C-SPC) [command]
transpose-words command (M-t) but applies to balanced Oz expressions. Caveat: This might not produce nice results in all cases.
COUNT(M-C-DEL 1) [command]
Kill the balanced Oz expression preceding point. With
COUNT, kill that many Oz expressions before point. Negative
COUNT means kill
COUNT Oz expressions after point.
Move point to the start of the Oz definition it is in. If point is not inside an Oz definition, move to start of buffer. Returns
t unless search stops due to beginning or end of buffer.
Move point to the end of the Oz definition it is in. If point is not inside an Oz definition, move to end of buffer.
|<< Prev||- Up -||Next >>|