Index Menus Panels Troubleshooting Key glossary Glossary Text rulers Text shortcuts Fonts Size and gadgets Colours Commands
The panel lets you specify two character sets; one defines which
letters, numbers etc. make up a word. The other, count as
indentation, which nonblank characters are to be considered equivalent
to white space (the space character, tab, carriage return and line
feed are always in this set, so they don't need to be specified).
The characters of the ASCII/ISO set are now divided into three
sets: the in-word characters, the white space characters and
interpunction (everything that is not in the other sets).
You can now select how word left, word right, delete
word and backspace word should behave in terms of these three
character classes (See also Moving around).
The definition of a language, called a bounded stack language, is
used to determine special effects for displaying a text, as well as how
the operation Find bracket (Browse menu,
The option switch on highlighting at `open' and `switch mode'
decides whether text highlighting is switched on automatically. Because
for large files or files with very long lines, some highlighting modes
dramatically increase memory consumption and degrade the editing speed,
it may sometimes be wise to have highlighting switched on only on your
explicit request, using Highlight syntax (Mark menu,
A BSL file consists of a number of sections, some of which are
optional. These sections must always appear in the same fixed order
listed below. An empty line indicates the end of a section. A line
starting with a number symbol (
Most often, your highlighting style will be
In some highlighting styles (these are mainly the ones for Edith's
panels), each line can be highlighted independently, eliminating
the need for storage of line information altogether. These are
called
Each line in this section consists of a five character typeface
specification, followed by one (true) tab, and a typeface name.
The typeface name must begin with a capital letter, and can
otherwise contain letters, dashes and underscores.
The five characters in the typeface specifications can be the
following:
Highlighting is performed as follows. The (1,0) position in the
text gets assigned an empty stack with the initial state on top.
Then, on a line-by-line basis, the text is scanned from left to
right using the rules defined in this section.
At each position, the rules are tried top-down. The first rule
that matches the current top state, and whose expression matches
the text immediately following that position (up to at most the
end of the line), is selected. Longest match and prefer
keywords mechanisms can be simulated using the end-of-word
marker
If there is a matching rule, the matched text is scanned, and any
typeface overrides in the expression of the form
If no rule matches, a single character is scanned, no action
performed.
The same procedure is then performed at the new position.
Some notes regarding the expression syntax used: apart from the
typeface tags, it is identical to the used in the
search panel. The typeface tags are treated as
tags between
-
sign as an in-word character,
make sure to have it preceded by a back-slash: \-
.
The un-escaped dash character is used to include range
expressions like a-z
.
**
in
C, //
in C++, #
in shell scripts, %
in LaTeX should be set to `count as indent'. End commented
paragraphs with an empty line, so that Format paragraph (Text menu, %
symbol, so that Format paragraph will not
scramble e.g. mathematical formulae that immediately follow plain
text.
TEXT HIGHLIGHTING
In the lower half of the language panel, you can select the language
definition that defines how text is highlighted and how bracket
matching works. Normally, this selection of a language will be all you
are interested in, and there will be no need to edit the language
definition itself; the most frequent exception is to just change the
type effects (fonts, colours) for certain types of information; this can
be done without editing the language definition itself: you should then
close the language panel and try Highlighting styles... (Options menu, WRITING YOUR OWN LANGUAGE DEFINITIONS
As with text shortcuts, modifying existing highlighting definitions
(BSL files for short) is the most effective way to get acquainted with
creating new definitions.
'#'
) introduces a single line
comment.
finite-state
.
Two of the preset styles however, LaTeX and HTML, are
recursive
; a recursive language is one that has
embedding; in the LaTeX case this means that when you go into
italic mode, then into boldface mode, then return, the editor
should remember that is was in italic mode. The stacks used
for such recursive languages take up 10 bytes, and a complete
stack is stored for each line in the text file. Finite-state
languages only take up 2 bytes extra for each line. Both are in
addition to a standard 4 bytes per line used to efficiently access
the text buffer.
intra-line
. Normally, highlighting styles for
editing modes are trans-line
.
r
(roman), i
(italic), t
(typewriter) or l
(large).
b
(bold) or -
(normal).
u
(underline) or -
(normal).
r
(light red), g
(light green),
b
(light blue), R
(dark red), G
(dark
green), B
(dark blue), y
(yellow), l
(light) or -
(default foreground colour).
i
(insensitive to bracket checking) or
-
(normal).
demo string
immediately followed by a one line example of various constructs
in the language. This string is displayed in the text display/fonts panel.
word range
immediately followed by a character range. This range determines
how the matching operators \<
and \>
are interpreted in the rules
section. It is independent
from the range you specify behind a word may contain in the
language panel. The latter is aimed at influencing the behaviour
of cursor movement; the word range in the BSL file is typically
used to define what characters can make up a keyword or
identifier in the defined language.
\>
.
\{
typeface-identifier}
are substituted by face
changes. Then the actions are performed. These actions have one
of the following forms:
If the new top state has different type effects, the corresponding
face changes are applied at the end of the scanned text.
\(
and \)
(they increment the
corresponding ampersand digit). The back reference &0
is
`global', that is, its value is kept across expressions, and
in trans-line
BSL, also across lines.
FEEDBACK AND FUTURE FEATURES
Please be of assistance to other users, and submit your BSL definitions
to zfc@zfc.nl for inclusion in future
distributions! We can also help you with hints for making efficient
highlighting modes.
Index Menus Panels Troubleshooting Key glossary Glossary
Text rulers Text shortcuts Fonts Size and gadgets Colours Commands