\input texinfo  @c -*-texinfo-*-
@c Copyright (C) 1996-1998,1999 by Salvador Eduardo Tropea.
@c The first 75 lines configures all, the rest is the real doc.

@comment %**start of header

@setfilename setedit.info
@set version 0.4.30
@set update-date 15 July 1999
@set update-month July 1999
@set name-author Salvador Eduardo Tropea

@set rh Robert H@value{ouml}hne
@macro RH{}
@value{rh}
@end macro

@settitle SET's editor v @value{version}
@footnotestyle separate
@paragraphindent asis
@iftex
@afourpaper
@end iftex

@comment %**end of header

@c ---- Includes according to the output format
@ifset html
@include set.htm
@clear text
@end ifset

@ifset text
@include set.txt
@clear html
@end ifset

@ifclear html
@ifclear text
@include set.txi
@end ifclear
@end ifclear

@macro SSET{}
@mail{@value{name-author},salvador@@inti.gov.ar}
@end macro
@set title-printed SET's Editor
@set minidesc-printed A friendly text editor
@set year-copyr 1996, 1997, 1998, 1999
@set info-file  setedit.info

@macro ikey{KEY,DESC}
@key{\KEY\}
@kindex \DESC\ | @key{\KEY\} |
@end macro

@c --------------------------------------------------------------
@c Now we have 3 different headers:
@c 1) For the printed manual, is called titlepage
@c 2) For Info files
@c 3) For HTML files
@c I tried to automate it.
@c --------------------------------------------------------------

@set text-pre1 @ @ @ This document describes the use of the SET's editor; this editor was designed for programmers and to be used alone or inside of the RHIDE.

@set text-pre2 @ @ @ This documentation may be freely distributed with the editor or the RHIDE package or any part thereof, provided this copyright notice is left intact on all copies.

@set text-pre3 @ @ @ Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.

@macro lista1
@itemize @bullet
  @item @sc{@value{rh}} <robert.hoehne@@gmx.net>@*
    (with some base routines, a lot of patches and reports)

  @item @sc{Molnar Laszlo} <molnarl@@cdata.tvnet.hu>@*
    (with the calculator, tests and a lot of ideas)

  @item @sc{Marek Habersack} <grendel@@ananke.amu.edu.pl>@*
    (with tests and a lot of ideas)

  @item @sc{Frank Donahoe} <fdonahoe@@wilkes1.wilkes.edu>@*
    (with a lot of corrections to this text)
@end itemize
@end macro

@macro titem4{NOM,COM,KEY,ALT}
@titem_{\NOM\,\COM\,\KEY\,\ALT\}
@kindex \COM\ @key{\KEY\}
@kindex \NOM\ @key{\KEY\}
@end macro

@macro titem3{NOM,COM,KEY}
@titem_{\NOM\,\COM\,\KEY\}
@kindex \COM\ @key{\KEY\}
@kindex \NOM\ @key{\KEY\}
@end macro

@macro refMenu{command,key}
Name of the command: \command\.@*
Assigned key: @kbd{\key\}
@paragraph{}
@kindex \command\ @key{\key\}
@end macro

@macro refMenu1{command}
Name of the command: \command\.
@paragraph{}
@kindex \command\ @key{From menu}
@end macro

@HeaderPage1{}
@ifinfo
@ifset html
@include editor.ctx
@end ifset
@top EDITOR
@end ifinfo
@HeaderPage2{}

@ifinfo
Pressing F1 when selecting any item of the menu you'll get help about it.
@paragraph{}
@end ifinfo

@chapter Introduction

@value{text-pre1}
@paragraph{}

@value{text-pre2}
@paragraph{}

@value{text-pre3}
@paragraph{}

  People who helped me develop the editor:
@paragraph{}

@lista1{}

  The editor is distributed under the GPL license. Please read the files
included in the source distribution for more information.
@paragraph{}

  This editor is included in the @RH{}'s RHIDE as a replacement for the
original Turbo Vision's editor class.
@paragraph{}

@section Copying

  The editor is distributed under the GPL license:
@paragraph{}

@format
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@end format

  A copy of the license should be in the package, if not please tell me.
@paragraph{}

@c when using something like What's, TeX is confused by the '
@section What is SETs Editor?

  SET's editor is an editor designed to be used by programmers; the main
target of the editor is C and C++ code but Pascal and Clipper are supported
too. Currently I'm trying to make it more general and be useful not only for
programing.
@paragraph{}

  The editor was designed to be very similar to the DOS standard editors for
C, especially to Borland's IDE editor. The editor supports a lot of
WordStar style commands plus some CUA commands, so if you have used any editor
that uses these kinds of commands you'll find my editor very familiar. On the
other hand if you have never used a DOS editor, especially if you use VI on UNIX
machines you'll feel lost. You can configure the keyboard.
@x{How to configure the keyboard}.
@paragraph{}

@section About the Author

@my_flag{}

The editor was created by @value{name-author} with some code contributed by
@RH{}

@display
E-Mail: @SSET{}

Telephone: (+5411) 4759-0013
Postal Address:
Salvador E. Tropea
Curapalig@value{uuml}e 2124
(1678) Caseros - 3 de Febrero
Prov: Buenos Aires
Argentina
@end display
@paragraph{}

@my_flag{}

@chapter Available commands and keys assignments

  In this section I will explain the features of the editor and the default
configuration for the keyboard. If you want to change some assignment
of a key consult "configure the keyboard".  @x{How to configure the keyboard}.
@paragraph{}

  Read the conventions topic first to understand my way of indicating
keystrokes.
@paragraph{}

  In the description of each command I'll include the internal name used by
the editor because this name is needed to configure the keyboard.
@paragraph{}

@section Conventions

  I'll use some conventions when talking about the keystrokes needed to
trigger some command. So here is what I use:
@paragraph{}

  The key named @key{Ctrl} or Control is represented as @samp{^}; this key doesn't have any
effect used alone inside of the editor so the @samp{^} symbol will be used only
in conjunction with the name of some key indicating that you must press the
two keys at the same time. For example, @kbd{^A} is @key{Ctrl} and @key{A} at the same time.
When I say "at the same time" that means: press @kbd{@key{Ctrl}}, hold it, and press
the other key; that's the reason to put @key{A} after @key{Ctrl}.
@paragraph{}

  To indicate a sequence of keystrokes I'll use a dash to separate the keys. For
example, @kbd{^K-B} is @key{Ctrl} and @key{K} at the same time, and then press @key{B}, of course
release @kbd{^K} first.
@paragraph{}

  To indicate keys pressed at the same time other than @kbd{^x} I'll use a plus.
For example, @kbd{Shift+^Insert} is the three keys at the same time!
@paragraph{}

  I don't think that you are stupid; the editor is written for programmers,
but I wanted to make that clear to avoid problems ;-).
@paragraph{}

@section Cursor movement
@cindex Movement

@table4{Action,Command,Key,Alternate}
@titem4{Character left,cmcCharLeft,Left arrow,^S}
@titem4{Character right,cmcCharRight,Right arrow,^D}
@titem4{Word left,cmcWordLeft,^Left arrow,^A}
@titem4{Word right,cmcWordRight,^Right arrow,^F}
@titem4{End of the word,cmcGoEndOfWord,,}
@titem4{Line up,cmcLineUp,Up arrow,^E}
@titem4{Line down,cmcLineDown,Down arrow,^X}
@titem3{Scroll the screen one line up,cmcScrollUp,^W}
@titem3{Scroll the screen one line down,cmcScrollDown,^Z}
@titem4{Page up,cmcPageUp,PgUp,^R}
@titem4{Page down,cmcPageDown,PgDn,^C}
@titem4{Beginning of line,cmcLineStart,Home,^Q-S}
@titem4{End of line,cmcLineEnd,End,^Q-D}
@titem4{Top of window,cmcFirstLineInScreen,^Q-E,^Home}
@titem4{Bottom of window,cmcLastLineInScreen,^Q-X,^End}
@titem4{Top of file,cmcTextStart,^Q-R,^PgUp}
@titem4{Bottom of file,cmcTextEnd,^Q-C,^PgDn}
@endtable_{}

@section Insert and Delete
@cindex Insert and Delete

@table4{Action,Command,Key,Alternate}
@titem4{Delete the character under cursor,cmcDelChar,Del,^G}
@titem4{Delete character to left,cmcBackSpace,Backspace,^H}
@titem3{Delete line,cmcDelLine,^Y}
@titem4{Delete to end of line,cmcDelEnd,^Q-Y,Shift+^Y}
@titem3{Delete to start of line,cmcDelStart,^Q-H}
@titem3{Delete word at left,cmcDelWord,^T}
@titem3{Delete word at right,cmcDelPrevWord,^Backspace}
@titem4{Insert line,cmcNewLine,Enter,^N}
@titem4{Insert mode on/off,cmcInsMode,Ins,^V}
@endtable_{}

  When you are in insert mode all the typed characters are inserted in the
text, but when the insert mode is off the typed characters replace the
old text. The editor starts with insert mode on. You can quickly know the
mode by the cursor shape. When the insert mode is on, the cursor is only a
line, but when it is off, the cursor is block shaped.
@paragraph{}

@section Blocks
@cindex Blocks

  A block is a selected portion of the text. You can copy, delete, @i{etc.@:} blocks
of text. The associated commands are:
@paragraph{}

@table4{Action,Command,Key,Alternate}
@titem3{Move to beginning of block,cmcGoBeginBlock,^Q-B}
@titem3{Move to end of block,cmcGoEndBlock,^Q-K}
@titem3{Set beginning of block,cmcStartSelect,^K-B}
@titem3{Set end of block,cmcEndSelect,^K-K}
@titem3{Hide/Show block,cmcHideSelect,^K-H}
@titem3{Mark line,cmcMarkLine,^K-L}
@titem3{Mark word,cmcMarkWord,^K-T}
@titem4{Delete block and copy it to the Clipboard,cmcCut,^K-Y,Shift+Del}
@titem3{Copy the selected block,cmcCopyBlock,^K-C}
@titem3{Move block,cmcMoveBlock,^K+V}
@titem3{Copy to Clipboard,cmcCopy,^Ins}
@titem3{Delete block,cmcClear,^Del}
@titem3{Paste from Clipboard,cmcPaste,Shift+Ins}
@titem4{Read block from disk,cmcReadBlock,^K-R,Shift+^R}
@titem4{Write block to disk,cmcWriteBlock,^K-W,Shift+^W}
@titem3{Replace the block by the Clipboard block,cmcReplaceSelect,Shift+^Ins}
@titem3{Convert to Uppercase,cmcToUpper,^K-M}
@titem3{Convert to Lowercase,cmcToLower,^K-O}
@titem3{Report the length of the block,cmcSelLength,^Q-L}
@endtable_{}

@subsection Block modes
@cindex Persistent Blocks

  There are two block modes. One is the mode that the old editor of RHIDE
used. This mode is used in CUA programs. The other is called Persistent
Blocks.
@paragraph{}

  In the normal mode each time you select a block and then insert anything
in it (with @code{cmcPaste} or by typing anything) the selected block is deleted
and is replaced by the new text.
@paragraph{}

  In persistent blocks the selection is not replaced and is not lost when
you move the cursor. From this comes the name "Persistent." In this mode
you can use @code{cmcMoveBlock} and @code{cmcCopyBlock} without using the Clipboard. In
addition you can apply indentations to the block (@x{Indentation}),
search only inside it, @i{etc.} That's what makes this mode much more powerful than
the former. If you really like to replace the selected text by the selection
of the Clipboard, that's the default behaviour of the first mode. You can use
the @code{cmcReplaceSelect} command to achieve the same in the Persistent Blocks
mode.
@paragraph{}

@subsection Selecting with the mouse or Shift

  The described commands for selecting a block, @code{cmcStartSelect} and @code{cmcEndSelect},
are good but not so quick. There are other ways to do this.
@paragraph{}

@subsubsection Using the mouse

  Using the mouse you need only point to the start place, hold the left button
pressed and move the mouse to the end point of your block.
@paragraph{}

  To select a word with the mouse just double click on it.
@paragraph{}

@subsubsection Using the Shift key

  Using the @key{Shift} key you only need to move the cursor to the start point,
hold @kbd{@key{Shift}} pressed and move the cursor to the end point with any of the
available cursor commands. @x{Cursor movement}.
@paragraph{}

@subsection Indentation
@cindex Indentation

  You can indent or unindent a block of text using various commands, but you
must keep in mind that for now the editor is limited in the following:
@x{Real Tabs} If you are using tabs to indent your text, don't mix the tabs with
spaces and, if you are using spaces to indent, don't mix them with real tabs.
@paragraph{}

@table4{Action,Command,Key,Alternate}
@titem4{Indent block one position adding a space,cmcIndentBlkOne,^K-I,Shift+^I}
@titem4{Unindent block one character - not an x position,cmcUnIndentBlkOne,^K-U,Shift+^U}
@titem3{Indent block,cmcIndentBlk,^K-Tab}
@titem3{Unindent block,cmcUnIndentBlk,^K-Shift+Tab}
@endtable_{}

@code{cmcUnIndentBlkOne} unindents deleting one char at the start of the line so
if the line is indented with tabs the line will retract one tab.
@paragraph{}

@code{cmcIndentBlk} acts according to the mode. If you are using tabs,
the editor will put one tab beginning each line. If you aren't using tabs the
editor will operate the Tab command on the first line and then will use
this amount of indentation on the entire block. @x{Real Tabs}.
@paragraph{}

@code{cmcUnIndentBlk} acts according to the mode too. @x{Real Tabs} mode. This is
just like @code{cmcUnIndentBlkOne} deleting one tab but if you don't use tabs the
editor uses Backspace on the first used column of the first line of the
block and unindents by the resulting amount all the block.
@paragraph{}

The following commands aren't applied to the whole block, they apply only to
the line where the cursor is positioned.
@paragraph{}

@table3{Action,Command,Key}
@titem3{Smart Indent block,cmcSmartIndent,^Tab}
@titem3{Smart Unindent block,cmcSmartUnIndent,Shift+^Tab}
@endtable_{}

@code{cmcSmartIndent} and @code{cmcSmartUnIndent} indents taking as reference the @{ @} pair
where the cursor is, for example:
@paragraph{}

@example
  @{
line1
     line2
   line3
  @}
@end example

After indenting line1 with @code{cmcSmartIndent} and line2 with @code{cmcSmartUnIndent}
you get:
@paragraph{}

@example
  @{
   line1
   line2
   line3
  @}
@end example

The indentation is made with spaces and you must put the cursor in the first
letter of the line, the l in this example.
@paragraph{}

@subsection Rectangular Blocks
@cindex Blocks - Rectangular

  The editor includes a mode where you can select a rectangular portion of
the text and copy, cut, clear, paste, move, @i{etc.@:} this region.
This tool is very useful for modifications on columns.
@paragraph{}

  Attention! The selected area is based on the X,Y coordinates. For this
reason if you insert lines before the bottom of the rectangle the area won't
be moved. I don't plan to move the area by now because that takes some CPU
and I think that this selection is made just before using it. So don't
report that like a bug. That is the way it works!
@paragraph{}

@table3{Action,Command,Key}
@titem3{Set beginning of block,cmcSelRectStart,^K-Shift+B}
@titem3{Set end of block,cmcSelRectEnd,^K-Shift+K}
@titem3{Hide/Show block,cmcSelRectHide,^K-Shift+H}
@titem3{Delete block and copy it to an special Clipboard,cmcSelRectCut,^K-ShiftT}
@titem3{Move block,cmcSelRectMove,^K+Shift+V}
@titem3{Copy to special Clipboard,cmcSelRectCopy,^K-Shift+C}
@titem3{Delete block,cmcSelRectDel,^K-Shift+L}
@titem3{Paste from special Clipboard,cmcSelRectPaste,^K-Shift+P}
@titem3{Convert to uppercase,cmcSelRectToUpper,}
@titem3{Convert to lowercase,cmcSelRectToLower,}
@endtable_{}

@section Miscellaneous keyboard commands

@table3{Action,Command,Key}
@titem3{Autoindent mode on/off,cmcIndentMode,^O}
@titem3{Find place marker,cmcGotoMarkn,^Q n*}
@titem3{Set marker,cmcPutMarkn,^K n*}
@titem3{Search the open curly bracket where the cursor is,cmcSearchStart,^[}
@titem3{Search the close curly bracket where the cursor is,cmcSearchEnd,^]}
@titem3{Search the ( where the cursor is,cmcSearchOpPar,Shift+^9}
@titem3{Search the ) where the cursor is,cmcSearchClPar,Shift+^0}
@titem3{Search the [ where the cursor is,cmcSearchOpCor,Shift+^[}
@titem3{Search the ] where the cursor is,cmcSearchClCor,Shift+^]}
@titem3{Search the complementary pair,cmcSearchComplement,^Q ESC}
@titem3{Undo,cmcUndo,Alt+Backspace}
@titem3{PMacro's Trigger,cmcExpandCode,^Space}
@titem3{Goto Line,cmcGotoEditorLine,^J}
@titem3{Set the options of the current window (Not in RHIDE),cmcSetLocalOptions,Alt+L}
@titem3{Set the default options (Not in RHIDE),cmcSetGlobalOptions,Alt+G}
@titem3{Convert all tabs in spaces,cmcExpandAllTabs,From menu}
@titem3{Compact the text using tabs,cmcCompactBuffer,From menu}
@titem3{Start recording a macro,cmcRecordMacro,Shift+F10}
@titem3{Stop recording a macro,cmcStopMacro,Alt+F10}
@titem3{Play a macro,cmcPlayMacro,^F10}
@endtable_{}

@chapter Keyboard configuration

  The editor can be configured to trigger one or more commands pressing one key or any
arbitrary sequence of keys. Unlike old versions now the sequence of keys isn't limited.
Additionally you no longer need to configure the editor for non-US keyboards.
@paragraph{}

  If you used an old version of the editor you'll note that now the keyboard
configuration is much more easy and much more powerful.
@paragraph{}

@section How to configure the keyboard

  In the editor these options are located under the menu option called Tool&Ops, submenu
Options, submenu Keyboard, submenu Key assignment; yes is a little deep in the menu.
@paragraph{}

  After selecting this option you'll get a window with the keyboard assignments. This
window shows entries of the type @code{Key sequence -> Commands sequence}. You can
delete an assignment just selecting it and choosing the @code{Delete} button.
@paragraph{}

  The list is sorted by a internal criteria. The keys with @key{Shift} have an @code{S}
before, for @key{Ctrl} you'll see a @code{C} and for @key{Alt} an @code{A}. The editor
can distinguish the left and right @key{Alt} keys; if you enable it the right @key{Alt}
will be represented by an @code{a}. @x{Alt key configuration}.
@paragraph{}

  To add a new assignment press the @code{Add} button. A window called @i{Sequence of
keys} will appear. This window is used to choose the sequence of keys that will trigger
an action in the editor. The sequence can be as large as you want, so if you want to
assign a sequence like this: @kbd{^A-Shift+^Insert-Alt+Z} you can, I doubt you really
want to use such a complex combination but the editor is flexible enough.
@paragraph{}

  To add a new key to the sequence use the @code{Add} button, to delete a key use the
@code{Delete} button. The @code{Add} button ever adds a key at the end of the list; to
insert a key in the sequence use the @code{Insert} button button, it will insert the
key before the selected key. Finally select if you want to assign a sequence of
commands or a sLisp macro to this key sequence. @x{sLisp macros}.
@paragraph{}

@subsection Assigning a sequence of commands

  A window called @i{Commands} will appear. The mechanism to add, insert and delete
commands is the same used in for a keyboard sequence. This time when you add or insert
a new command to the sequence a window offering all the available commands will pop-up.
The meaning of each command can be found in the indeces of this help.
@paragraph{}

  To make a selection with the commands, like when holding @key{Shift}, you must use
the @code{SelectOn} and @code{SelectOff} commands. As an example you can see the
assignments for the @kbd{Shift+Left} or @kbd{Shift+Right} keys.
@paragraph{}

@subsection Assigning a sLisp macro
@cindex macros.slp

  A window called @i{Macros} will appear. This window shows all the macros defined in
the @file{macros.slp} file. @x{sLisp macros}.
@paragraph{}

  The main advantage of using macros instead of command sequence is that macros can
insert text in your code.
@paragraph{}

@section Alt key configuration

  The editor can distinguish the left and right @key{Alt} keys. As old versions didn't
allowed that and as different users use different @key{Alt} keys the editor doesn't
make any difference as default.
@paragraph{}

  The @i{Setup Alt keys} menu option (under Tool&Ops | Options | Keyboard) allows to
enable it. Three options are offered:
@paragraph{}

@table2{Option,Meaning}
@titem_{Left Alt,The menues are tiggered by the left Alt and you can use the right Alt
for commands}
@titem_{Right Alt,Right Alt is used for menues\, in fact both are inverted}
@titem_{Both Alt,Both keys can be used for menues}
@endtable_{}

@section Restoring the default keyboard assignments

  If you need to restore the original keyboard assignment because you did something very
wrong you can use this option for that. The option is located under Tool&Ops | Options
| Keyboard.

@section Consulting scan codes

  If you need to know the scan code of a key for your program you don't need to use a
table or another program. The editor have an option for it under Tool&Ops | Options
| Keyboard.

@c --------------------------------------------------------------------------
@c --------------------------------------------------------------------------
@chapter Pull-down menues

The menues are configurable; for this reason the following structure is just
one of possible arrangements.
@paragraph{}

If you need or want to configure the keyboard look in the @file{menubind.smn}
file, the format is self explanatory and the editor supports syntax highlight
for these files.
@paragraph{}

@c --------------------------------------------------------------------------
@section File

This menu contains the files operations (save, load, print, @i{etc.@:}) and
the program exit functions.
@paragraph{}

@c --------------------------------------------------------------------------
@subsection Open

This option brings the file open dialog (@x{File Open}). From this dialog you can select
a file to load and edit.
@paragraph{}

Choose the Open button or select a file with @kbd{@key{Enter}} to open the
file. Use @kbd{@key{Esc}} to abort.
@paragraph{}

If the file is read-only a dialog will ask you if you want to make the file
writable, in this case the editor will try to change the file attributes. Not
always is possible to change these attributes, as an example, the CDs are
read-only and you can't change it.
@paragraph{}

@refMenu{cmeOpen,F3}

@c --------------------------------------------------------------------------
@subsection New

Use this option to create a new and empty editor window. The window have
@i{Untitled} as title.
@paragraph{}

An alternative way to do it is just using the @i{Open} option and give a new name
instead of selecting an existing file. @x{Open}. The advantage of this
methode is that the new window have a right title instead of @i{Untitled}.
@paragraph{}

@refMenu1{cmeNew}

@c --------------------------------------------------------------------------
@subsection Open Read-only copy

Use this option to open a copy of the file you are editing in another window.
@paragraph{}

Be careful, the new copy is taked from disk so could be unsychronized. The
copy will automatically become read only so you won't be able to modify it
and save over the first copy.
@paragraph{}

@refMenu1{cmeOpenROCopy}

@c --------------------------------------------------------------------------
@subsection Save

This option saves the contents of the current window. Only the contents of
this window are saved; not the rest. Additionally it only saves if the window
was modified.
@paragraph{}

If the window have @i{Untitled} as title this command acts like @x{Save as}.
@paragraph{}

@refMenu{cmcSave,F2}

@c --------------------------------------------------------------------------
@subsection Save as

This option allows to save the contents of the current window specifying a
new name for the file. For this purpose the file open dialog is used
(@x{File Open}).
@paragraph{}

If the file allready exists a dialog will pop-up asking for overwrite
confirmation.
@paragraph{}

The title of the window is changed to reflect the new file name.
@paragraph{}

@refMenu1{cmcSaveAs}

@c --------------------------------------------------------------------------
@subsection Save as UNIX

This option is very similar to the @i{Save as} option (@x{Save as}). The
only difference is that the editor will use the ASCII 10 as line end instead
of the 13,10 DOS sequence. That's very usefull when you need to compile the
file under UNIX or you just want to save some bytes on your disk.
@paragraph{}

Additionally there are an option to save UNIX files as UNIX files without
converting it to DOS style. @x{Editor General,Tool&Ops|Options|Editor General}.
@paragraph{}

@refMenu1{cmcSaveAsUNIX}

@c --------------------------------------------------------------------------
@subsection Save with same time

This option is very similar to the @i{Save} option (@x{Save}). The only
difference is that the editor will let the creation time unmodified. This
option is very usefull to modify header files avoiding the recompilation
of the whole project. A common case is when you only add constants to a
header that is included by various files but only one will use the new
constants.
@paragraph{}

@refMenu1{cmcSaveSameTime}

@c --------------------------------------------------------------------------
@subsection Print

This option prints the current editor window. Don't use this option without
configuring the printer module. @x{Print Setup}.
@paragraph{}

This option was designed to print source files, to print plain text files
or avoid all the formating features just select the portion of text to
print and save the block (@kbd{^K-W}) to a file with the name of the device
where your printer is connected. As an example to print in the DOS LPT 1
device just write the block to the @file{lpt1} file.
@paragraph{}

The editor will report the number of lines processed and printed in the
message window.
@paragraph{}

To learn more about the message window @x{Message Window}.
@paragraph{}

@refMenu1{cmePrintEditor}

@c --------------------------------------------------------------------------
@subsection Print Setup

This option brings a dialog to configure the printing module. After
configuring it you can print using the @i{Print} option. @x{Print}.
If you want to print a plain text (without formating) consult the @i{Print}
option too.
@paragraph{}

The dialog asks for the following parameters:
@paragraph{}

@itemize @bullet
  @item Total lines per page: The total number of lines that fits in one page
including the footer and header lines.
  @item Columns w/o margin: The number of colums that fits in the page without
counting the desired margin.
  @item Left margin: The number of columns left blank at the left side of the
page.
  @item Print line numbers: Select this option to get the line numbers printed
  @item Time format: The time format specified in the C style. (@x{Time and date modifiers formats}).
  @item Date format: The date format specified in the C style. (@x{Time and date modifiers formats}).
  @item Title: used in the header.
  @item Author: used in the header.
  @item Output file: Specify the printer device here. For example: the DOS
LPT 1 is the lpt1 file.
  @item Printer initialization: The sequence of character used to initialize
the printer. Normally it includes a reset and a font selection.
Specify the values separated by commas.
  @item Before heading: Setting to send before the header.
  @item After heading: Setting to send after the header.
  @item Before footer: Setting to send before the footer.
  @item After footer: Setting to send after the footer.
@end itemize

Use the @i{Ok} button to confirm or the @i{Cancel} button to reject.
@paragraph{}

The @i{Epson} button fills the values with the default settings for Epson
printers (ESCP2 language). The @i{HP} button fills the values with the
default settings for Hewlett Packard ink-jet printers.
@paragraph{}

The printer module was designed by me some years ago when I needed to present
a program in my University (Universidad Tecnologica Nacional) and I wanted
to format the source code adding a header, footer, lines number, page number,
date/time of the printing, project and author. So that's what the routines
does. I know they are limited but they generate a very good listing, much
better than just printing the text wothout any formating.
@paragraph{}

@refMenu1{cmeSetUpPrinter}

@c --------------------------------------------------------------------------
@c @subsection Change directory

@c [DOS]
@c @paragraph{}

@c By default the editor saves new files and loads files from the directory
@c where you started the editor. If you need to save or load various files
@c from a different directory select the directory here just once. For more
@c information about it @xref{File Open}.
@c @paragraph{}

@c @refMenu1{cmeChangeDrct}

@c --------------------------------------------------------------------------
@subsection Shell

Calls to the default commands interpreter indicated by the @i{COMSPEC}
enviroment variable. I guess you know that typing exit you'll go back to the
editor.
@paragraph{}

@refMenu1{cmeDosShell}

@c --------------------------------------------------------------------------
@subsection Quit
@cindex backups, delete at exit

This option exits the editor deleting all the back-up, desktop and project
files located in the current directory. That's usefull if you want to let the
directory clean.
@paragraph{}

When you use this option a dialog will appear asking if for confirmation, you
can avoid this dialog in the future operations using the "don't show again"
option.
@paragraph{}

@refMenu{cmeQuitDelete,Alt+Q}

@c --------------------------------------------------------------------------
@subsection Exit

This option just exits the program. The editor asks for saving if any of the
files under edition were modified but not saved. All the settings are stored
in the desktop file automatically.
@paragraph{}

@refMenu{cmeQuit,Alt+X}

@c --------------------------------------------------------------------------
@section Edit

This menu contains all the edition operations that have a menu shortcut.
@paragraph{}

@c --------------------------------------------------------------------------
@subsection Undo

This option reverts the last edit operation. Upto 32 operations can be
reverted.
@paragraph{}

@refMenu{cmcUndo,Alt+BackSpace}

@c --------------------------------------------------------------------------
@subsection Redo

This option recreats the last operation that was reverted using the
@i{Undo} option. @x{Undo}.
@paragraph{}

@refMenu1{cmcRedo}

@c --------------------------------------------------------------------------
@subsection Cut

The selected text is copied to the clipboard and deleted from the text.
@x{Clipboard}.
@paragraph{}

@refMenu{cmcCut,Shift+Del}

@c --------------------------------------------------------------------------
@subsection Copy

The selected text is copied to the clipboard. @x{Clipboard}.
@paragraph{}

@refMenu{cmcCopy,^Ins}

@c --------------------------------------------------------------------------
@subsection Paste

The text that's currently selected in the clipboard is inserted at the cursor
position. @x{Clipboard}.
@paragraph{}

@refMenu{cmcPaste,Shift+Ins}

@c --------------------------------------------------------------------------
@subsection Show clipboard

This option shows the clipboard window. @x{Clipboard}.
@paragraph{}

@refMenu1{cmeShowClip}

@c --------------------------------------------------------------------------
@subsection Clear

Deletes the selected text. It isn't copied to the clipboard.
@paragraph{}

@refMenu{cmcClear,^Del}

@c --------------------------------------------------------------------------
@subsection Set Local

This option pop-ups the local configuration dialog. All the values selected
in this dialog are valid only for the current editor window.
@paragraph{}

The first group of options are related to the editing modes.
@x{Editing Modes}.
@paragraph{}

The syntax highlight group of options allows to choose the type of highlight.
@x{Syntax Highlight}.
@paragraph{}

Additionally the window allows to indicate the tab size and the column where
the wrap cuts the lines.
@paragraph{}

@refMenu{cmcSetLocalOptions,Alt+L}

@c --------------------------------------------------------------------------
@subsection Set Global

This option pop-ups the global configuration dialog. All the values selected
in this dialog are used as default values. If you exit the dialog using the
@i{Ok} button these values @b{aren't} applied to any of the editor windows,
they just act as default values that are copied to the new opened and created
files. If you exit the dialog using the @i{To all} button these values
are applied to @b{all} the editor windows. To set the options of just one
window @x{Set Local}.
@paragraph{}

The options are related to the editing modes. @x{Editing Modes}.
@paragraph{}

Additionally the window allows to indicate the tab size and the column where
the wrap cuts the lines.
@paragraph{}

@refMenu{cmcSetGlobalOptions,Alt+G}

@c --------------------------------------------------------------------------
@subsection Expand all tabs

This option converts all the tabs in spaces. @x{Real Tabs}.
@paragraph{}

The tabs are expanded to the current tab size, check it before using this
option.
@paragraph{}

@refMenu{cmcExpandAllTabs}

@c --------------------------------------------------------------------------
@subsection Compact text

This option converts all the possible spaces in tabs. @x{Real Tabs}.
@paragraph{}

Be careful, if the tabs size is too small the editor will generate tons of
tabs, even in places where you don't want a tab.
@paragraph{}

@refMenu{cmcCompactBuffer}

@c --------------------------------------------------------------------------
@subsection Copy to Windows Clipoard

Copies the selected text to the Windows clipboard. Of course you must be
running under Windows ;-)). Don't trust too much in this feature, Windows
have bugs in the WinOldAp module (used to make it).
@paragraph{}

@refMenu{cmcCopyClipWin}

@c --------------------------------------------------------------------------
@subsection Paste from Windows Clipboard

Pastes the Windows clipboard content into the cursor position. Of course
you must be running under Windows and have some text in the clipboard.
Don't trust too much in this feature, Windows have bugs in the WinOldAp
module (used to make it).
@paragraph{}

@refMenu{cmcPasteClipWin}

@c --------------------------------------------------------------------------
@section Search

This menu contains the search and replace commands of the editor.
@paragraph{}

@c --------------------------------------------------------------------------
@subsection Find

This command searchs a string in the current editor. The dialog contains the
following fields:
@paragraph{}

@itemize @bullet
  @item Text to find: The text you want to search.
  @item Case sensitive: Use this option is the case of the text to search
is important.
  @item Whole words only: When this option is on the editor searchs for whole
words. If not the text to search can be only part of a word.
  @item Regular expressions: Use this option if the text to search is a
regular expression. A description of the syntax used by regular
expressions can be found in the libc. @x{Regular Expressions}. Three
types of regular expression are supported. @x{Regular Expressions Options}.
  @item Only inside comments: The matchs will be returned only if the first
character is inside a comment. Any kind of comments supported by the syntax
highlight are supported. It doesn't have any sense for plain text.
  @item Only outside comments: The matchs will be returned only if the first
character is outside a comment. If the previous option is also enabled this
option takes precedence.
  @item Scope - Global: The search will be done without taking in count the
selected text.
  @item Scope - Selected text: The search will be done only inside the
selected text.
  @item Origin - From cursor: The search will start from the position of the cursor.
  @item Origin - Entire scope: The search will be start from the beginning of the text.
@end itemize

The regular expressions search is slow and this can be noticed in large
files. Don't use it if the search can be done without it. The editor will
automatically disable the regular expressions search if the
@i{Text to find} contains only alphanumeric characters. This can be disabled
@x{Regular Expressions Options}.
@paragraph{}

To repeat the search use the @i{Search again} command. @x{Search again}.
@paragraph{}

@refMenu{cmcFind,^Q-F}

@c --------------------------------------------------------------------------
@subsubsection Regular Expressions Options

This dialog is accessed from the @code{RegEx Ops} button in the Find or
Replace dialogs. Here you can indicate some important options about the
regular expressions:
@paragraph{}

RegEx style:
@paragraph{}
@itemize @bullet
  @item Basic POSIX: old style POSIX regular expressions.
  @item Extended POSIX: new style POSIX regular expressions.
  @item Perl Compatible: Perl like regex, using the PCRE library.
@end itemize

Replace text:
@paragraph{}
@itemize @bullet
  @item Normal text: the match is replaced by the text in the replace text area.
  @item Dollar tags: the text to replace is parsed searching for @code{$n} tags.
These markers are replaced by the correspondent subexpression. If you
know Perl that's just like using the $0, $1, @i{etc.@:} after a search,
if you never used Perl and know what a subexpression means just play a
little and you'll get the idea, just use $n where n is the desired
subexpression.
@end itemize

Optimize:
@paragraph{}
@itemize @bullet
  @item Try to use normal search: if the editor detects that the search string
contains plain text will use a simple search even when regular expressions
are enabled. That's about ten times faster.
  @item Ever use RegEx: the editor doesn't try to be smart and ever uses what you selected.
@end itemize

For more information about regular expressions @x{Regular Expressions}.

@c --------------------------------------------------------------------------
@subsection Replace

This command searchs portions of text and replaces it with another text.
The options for the search are the same as in the @i{Find} command.
@x{Find}. The replace options are:
@paragraph{}

@itemize @bullet
  @item New text: The text used to replace the matching text.
  @item Prompt on replace: When this option is enabled the editor asks for
confirmation before doing the replace.
  @item Replace all: Use it to replace all the possible ocurrences.
@end itemize

To repeat the search use the @i{Search again} command. @x{Search again}.
@paragraph{}

@refMenu{cmcReplace,^Q-A}

@c --------------------------------------------------------------------------
@subsection Search again

This option repeats the last search.
@paragraph{}

@refMenu{cmcSearchAgain,^L}

@c --------------------------------------------------------------------------
@subsection Jump to function

This option pop-ups a dialog with the list of C functions in your source
file. Then you can choose one to jump in there. The functions are searched
in the source file so you don't need to compile it. As the parser uses an
heuristic it can fail, specially if your code have an unbalanced number of
curly brackets.
@paragraph{}

@refMenu{cmcJumpToFunction,Alt+F2}

@c --------------------------------------------------------------------------
@subsection Go to line

Allows you to indicate to what line you want to jump.
@paragraph{}

@refMenu{cmcGotoEditorLine,^J}

@c --------------------------------------------------------------------------
@section Macro

This submenu have the options to record and replay macros.
@paragraph{}

@c --------------------------------------------------------------------------
@subsection Record (Macro)

Starts recording all the operations that you make in the current editor
window.
@paragraph{}

@refMenu{cmcRecordMacro,Shift+F10}

@c --------------------------------------------------------------------------
@subsection Stop (Macro)

Stops the macro recording.
@paragraph{}

@refMenu{cmcStopMacro,Alt+F10}

@c --------------------------------------------------------------------------
@subsection Play (Macro)

Replays the saved macro. A macro saved in one window can be used in another.
@paragraph{}

@refMenu{cmcPlayMacro,^F10}

@c --------------------------------------------------------------------------
@subsection Choose (Macro)

This option lists all the available @i{sLisp macros} so you can choose one
to execute.
@paragraph{}

To learn more about these macros: @x{sLisp macros}.
@paragraph{}

@refMenu1{cmcChooseMacro}

@c --------------------------------------------------------------------------
@subsection Repeat (Macro)

It re-runs the last selected macro. @x{Choose (Macro)}. That's usefull if the macro
isn't assigned to a key and you need to use it various times.
@paragraph{}

To learn more about these macros: @x{sLisp macros}.
@paragraph{}

@refMenu{cmcRepeatMacro,Shift+F3}

@c --------------------------------------------------------------------------
@subsection Generate Code

This option translates the recorded macro into an @i{sLisp macro}. The
generated code is inserted at the cursor position.
@paragraph{}

To learn how to record a macro: @x{Record (Macro)}.
@paragraph{}

To learn more about these macros: @x{sLisp macros}.
@paragraph{}

@refMenu1{cmcGenCodeForMacro}

@c --------------------------------------------------------------------------
@section Rectangle

This menu contains the rectangular block operations. As they are a little
hard to type and normally this function is ignored by the users I put it in
a very visible menu.
@paragraph{}

@c --------------------------------------------------------------------------
@subsection Start (Rectangle)

Selects the top-left corner of the rectangular area.
@paragraph{}

To learn more about rectangular blocks: @x{Rectangular Blocks}.
@paragraph{}

@refMenu{cmcSelRectStart,^K-Shift+B}

@c --------------------------------------------------------------------------
@subsection End (Rectangle)

Selects the bottom-right corner of the rectangular area.
@paragraph{}

To learn more about rectangular blocks: @x{Rectangular Blocks}.
@paragraph{}

@refMenu{cmcSelRectEnd,^K-Shift+K}

@c --------------------------------------------------------------------------
@subsection Hide (Rectangle)

Hides the rectangular selection.
@paragraph{}

To learn more about rectangular blocks: @x{Rectangular Blocks}.
@paragraph{}

@refMenu{cmcSelRectHide,^K-Shift+H}

@c --------------------------------------------------------------------------
@subsection Copy (Rectangle)

Copies the rectangular selection into the clipboard. This clipboard isn't
the same clipboard used by the normal selections and is overwritted each
time you copy to it.
@paragraph{}

To learn more about rectangular blocks: @x{Rectangular Blocks}.
@paragraph{}

@refMenu{cmcSelRectCopy,^K-Shift+C}

@c --------------------------------------------------------------------------
@subsection Paste (Rectangle)

Inserts the contents of the rectangular clipboard at the cursor position.
@paragraph{}

To learn more about rectangular blocks: @x{Rectangular Blocks}.
@paragraph{}

@refMenu{cmcSelRectPaste,^K-Shift+P}

@c --------------------------------------------------------------------------
@subsection Cut (Rectangle)

Copies the rectangular selection into the clipboard and then deletes the
selected text.
@paragraph{}

To learn more about rectangular blocks: @x{Rectangular Blocks}.
@paragraph{}

@refMenu{cmcSelRectCut,^K-Shift+T}

@c --------------------------------------------------------------------------
@subsection Clear (Rectangle)

Deletes the selected text.
@paragraph{}

To learn more about rectangular blocks: @x{Rectangular Blocks}.
@paragraph{}

@refMenu{cmcSelRectDel,^K-Shift+L}

@c --------------------------------------------------------------------------
@subsection Move (Rectangle)

Moves the selected text to the cursor's position.
@paragraph{}

To learn more about rectangular blocks: @x{Rectangular Blocks}.
@paragraph{}

@refMenu{cmcSelRectMove,^K-Shift+M}

@c --------------------------------------------------------------------------
@subsection To upper (Rectangle)

Converts all the characters inside the rectangle to uppercase. This operation
basically does a cut of the block, then process all the characters and
finally makes a paste of the modified block. As a side effect of this
operations tabs inside or crssing the rectangle boundaries are converted to
spaces.
@paragraph{}

To learn more about rectangular blocks: @x{Rectangular Blocks}.
@paragraph{}

@refMenu1{cmcSelRectToUpper}

@c --------------------------------------------------------------------------
@subsection To lower (Rectangle)

Converts all the characters inside the rectangle to lowercase. This operation
basically does a cut of the block, then process all the characters and
finally makes a paste of the modified block. As a side effect of this
operations tabs inside or crssing the rectangle boundaries are converted to
spaces.
@paragraph{}

To learn more about rectangular blocks: @x{Rectangular Blocks}.
@paragraph{}

@refMenu1{cmcSelRectToLower}

@c --------------------------------------------------------------------------
@section Windows

This menu contains the options to handle the windows in the editor.
@paragraph{}

@c --------------------------------------------------------------------------
@subsection Size/move

You can resize the windows dragging the bottom right corner of the window.
You can move the windows dragging the title line of the window.
@paragraph{}

Additionally this command allows these operations to be done without the
mouse. Once you entered in this mode the border of the window chages its
color and you can move the window using the arrow keys. To resize the window
use the arrow keys holding the @key{Shift}. Additionally @key{Home},
@key{End}, @key{PgUp} and @key{PgDown} can be used to move the window to one
end of the desktop. Ones you finished you can end this mode pressing
@key{ESC} or @key{ENTER}.
@paragraph{}

@refMenu{cmeResize,^F5}

@c --------------------------------------------------------------------------
@subsection Zoom

Changes the size of the window to be as large as the whole desktop. The
second time you use this command the window is resized to your original size.
Is the equivalent of the maximize and restore options of other editors.
@paragraph{}

@refMenu{cmeZoom,F5}

@c --------------------------------------------------------------------------
@subsection Tile

Arranges all the windows in a way that you can see all at the same time.
@paragraph{}

@refMenu1{cmeTile}

@c --------------------------------------------------------------------------
@subsection Cascade

Arranges all the windows overlapping.
@paragraph{}

@refMenu1{cmeCascade}

@c --------------------------------------------------------------------------
@subsection Next (Window)

Selects the next window. The windows are linked in circular list, this
command selects the next window in the list. To change the order you can
directly select a window with the mouse or @key{ALT} plus a number. Doing
that this window will become the current one, and the other will be the
@i{previous} window.
@paragraph{}

Use it to select the most recently selected windows.
@paragraph{}

@refMenu{cmeNext,F6}

@c --------------------------------------------------------------------------
@subsection Previous (Window)

Selects the previous window. The windows are linked in circular list, this
command selects the previous window in the list. To change the order you can
directly select a window with the mouse or @key{ALT} plus a number. Doing
that this window will become the current one, and the other will be the
@i{previous} window.
@paragraph{}

Use it to select the most recently selected windows.
@paragraph{}

@refMenu{cmePrev,Shift+F6}

@c --------------------------------------------------------------------------
@subsection Close

Closes the current window. If the content isn't saved the editor will ask
for saving.
@paragraph{}

@refMenu{cmeClose,Alt+F3}

@c --------------------------------------------------------------------------
@subsection List

Pop-ups the List of Windows dialog. This dialog contains the list of all the
editor windows, the special windows and the closed windows.
@paragraph{}

The editor windows are numbered starting from two and the list is sorted by
number. If a window isn't saved an asterisk is placed between the number and
the name.
@paragraph{}

The special windows are: the message window (the number of lines is
indicated), the project window, the clipboard window (the bytes used by it
is indicated) and the InfView windows.
@paragraph{}

The closed windows list is sorted alphabetically and holds the last closed
windows. The editor stores important information about these windows so if
you close and re-open one of them the size of the window and other values
are restored.
@paragraph{}

You can jump to any of the windows selecting it with the mouse or the
arrow keys and then pressing @key{ENTER} or double clicking or using the
@i{Go} button.
@paragraph{}

Pressing @key{Delete} or using the @i{Delete} button you can delete the
closed windows or close any editor window.
@paragraph{}

@refMenu{cmeListWin,Alt+0}

@c --------------------------------------------------------------------------
@subsection User Screen

Shows the DOS screen. Press any key to go back to the editor.
@paragraph{}

@refMenu{cmeUserScreen,Alt+F5}

@c --------------------------------------------------------------------------
@section Tool&Ops

This menu contains all the configuration submenues and some usefull tools.
@paragraph{}

@c --------------------------------------------------------------------------
@subsection Options

This submenu contains the configuration submenues.
@paragraph{}

@c --------------------------------------------------------------------------
@subsubsection Colors

This command allows to customize the colors used by the editor. Almost all
the colors are configurable.
@paragraph{}

The first list, called @i{Group}, is the list of things used by the editor.
Each entry in the group list have one or more colors in the @i{Item} list.
First select the group you want to customize and then press @key{Tab} to
move the cursor to the items list. To customize a color just select it in the
list of items; the dialog will show a text example in the bottom right corner
and the @i{Foreground} and @i{Background} colors will be indicated. Using the
mouse or moving with @key{Tab} and using the arrow keys you can select any
of the available colors; the sample text will show the resulting combination.
@paragraph{}

Exiting the dialog with @key{ENTER} or with the @i{Ok} button the new colors
will be applied. The colors are stored in the desktop file. If you are using
one centralized desktop file these colors will be used each time you run
the editor, if not the colors will be used only when you run the editor in
this directory.
@paragraph{}

To learn more about the scope of the desktop files and how to indicate
default values: @x{Desktop Files}.
@paragraph{}

If you want to use other colors don't listed in this dialog you must
customize the palette. @x{Color Palette}.
@paragraph{}

@refMenu1{cmeSetColors}

@c --------------------------------------------------------------------------
@subsubsection Color Palette

This option allows to configure the palette of colors used by the editor. I
think you know about palettes but I included a little of explanation, just
in case. @x{Text mode attributes}.
@paragraph{}

The @i{Color} radio buttons are used to select the index you want to
customize. The @i{Red}, @i{Green} and @i{Blue} scroll bars can be used to
customize the color. To modify one of the components use the mouse or use
the @key{R}, @key{G} and @key{B} to increase the values and @key{Shift}+@key{R},
@key{Shift}+@key{G} and @key{Shift}+@key{B} to decrease the values.
@paragraph{}

Exiting the dialog with @key{ESC} restores the values you had before entering
to this option. Choosing the @i{Default} button the colors are configured
with the deafult values used by the VGA cards.
@paragraph{}

These settings are stored in the desktop file. @x{Desktop Files}.
@paragraph{}

@refMenu1{cmeEditPalette}

@c --------------------------------------------------------------------------
@subsubsection Editor General
@cindex backups, enable/disable
@cindex backups, style
@cindex backups, memorize
@cindex desktop files, do not create
@cindex tcedit.dst, do not create
@cindex desktop files, style
@cindex tcedit.dst, style

This option po-ups the general configuration dialog containing several
options.
@paragraph{}

The @i{Save options} groups control various settings about what files creates
the editor and how are created.
@paragraph{}

@itemize @bullet
@item Make backups: When enabled the editor keeps a backup of your files
using the @file{.bkp} extension. It saved me many times.
@item UNIX style backups: When enabled the backups are created appending a
tilde symbol to the file extension. This is recommended only for systems that
supports long file names, not pure DOS.
@item Hidden backups: The backups are created as hidden files, it can be used
to keep backups, but at the same time make them less annoying.
@item Remmember bkps to delete: When you exit with @code{Quit} the editor
deletes backup files. To do it the editor deletes files ending with
@code{bkp}, but if you use UNIX style backups or just edit files in a
directory other than the current is hard to know where these files
are located. For this reason the editor keeps a list of created backup files.
If you exit normally this list is lost, so the next time you use the editor
and exit with @code{Quit} only the backups created during this session will
be deleted. This behavior can be modified choosing this option, when enabled
the editor will store the list in the desktop file and retreive it the next
time you start the editor. By default this option is disabled because users
that doesn't know about this mechanism and uses a centralized desktop file
could end with a very long list of backup files wasting memory and disk
space.
@item Don't create desktop files: When enabled the editor creates only one
desktop file and not one per directory. @x{Desktop Files}.
@item Save desktop files hidden: Just what the name says, that's useful if
you want to create desktop files in each directory but they hinder in
directory listings.
@item Save UNIX files as UNIX: When enabled the editor saves to disk UNIX
files in UNIX format. That means that the conversion is done only
internally and the format of the file in disk isn't altered when you
save.
@item Open only specified files: When enabled and you specify one or more
file names in the command line the editor will close all the files already
opened before opening the files specified by you. It helps to keep the
desktop clean if you use only one global desktop file.
@end itemize

The @i{Clock} group allows to turn on/off the clock and to choose 0 to 24 hs
or AM/PM style. The clock is displayed in the top right corner of the screen.
@paragraph{}

These settings are stored in the desktop file. @x{Desktop Files}.
@paragraph{}

@refMenu1{cmeEdGralOptions}

@c --------------------------------------------------------------------------
@subsubsection Screen Saver
@cindex screen saver

This dialog customize the screen saver. Note the question mark at the end of
the words "screen saver" I did it because the plasma screen saver isn't too
good to be used as a real saver for your screen. You can enable and disable
it, choose the time the editor will wait before starting the screen saver
and the screen saver style. The @b{Test} button can be used to see how the
screen saver looks like.
@paragraph{}

If you left the mouse pointer in the upper right corner of the screen for
some seconds the screen saver is activated. This time is three seconds by
default and can be configured entering the amount of seconds in the second
box labeled @i{Time}.
@paragraph{}

Two types of screen savers are supported: internal and external. Internal
screen savers are hardcoded in the editor. External screen savers are
external programs started from the editor. If you select an external screen
saver from the list the @b{Info} and @b{Help} buttons are enabled. Pressing
these buttons you can get more information about the screen saver. You can
pass additional parameters to the external screen saver filling the
@i{External Saver} box.
@paragraph{}

If you want to write your own screen saver please download the sources of the
editor and read the explanations found in the @i{scrnsave} directory. An
external screen saver is basically a simple program that supports some
special command line options and returns with some specified return values.
@paragraph{}

@refMenu1{cmeScreenSaverOpts}

@c --------------------------------------------------------------------------
@subsubsection SDG Options

These options customize the SDG module (SET's Documentation Generator).
@mxref{Top,SDG Documentation,,SDG,SDG}.
@paragraph{}

@itemize @bullet
@item Format file: Indicates the name of the format file used to generate
the documentation.
@item Intermediate file: The name of the temporal file used in the process.
@item Base output: The base name of the output file. Don't include the
extension.
@item Directory of formats: The place where the editor will search for the
format file.
@item Keep intermediate: When enabled the temporal file isn't deleted so
you can see possible errors on it.
@end itemize

The SDG module uses the files listed in the project to collect the
documentation from the comments. @x{Project}.
@paragraph{}

These settings are stored in the desktop file. @x{Desktop Files}.
@paragraph{}

@refMenu1{cmeSDGDialog}

@c --------------------------------------------------------------------------
@subsubsection Run program (which one)

The editor can run an external program and collect the errors reported by it
just pressing a key (@kbd{^F9}). A good example is the make program. Here
you can select the name of the program. If you need to run more than one
command separate it with @code{;}.
@paragraph{}

The editor will redirect the stderr and stdout of the program and then will
analize the output looking for errors. The algorithm is designed to work
with the GNU tools that reports errors in the form: file:line:error.
@paragraph{}

This setting is stored in the desktop file. @x{Desktop Files}.
@paragraph{}

@refMenu1{cmeConfRunCommand}

@c --------------------------------------------------------------------------
@subsubsection Keyboard

This is a submenu but due to limitations in the documentation tools I was
forced to put it with the rest of the options listed in the @i{Options}
submenu.
@paragraph{}

It contains all the options to customize the keyboard.

@c --------------------------------------------------------------------------
@subsubsection Key assignment

With this command you can fully customize the keys used by the editor windows.
It doesn't include the menues, for that you must edit the @file{menubind.smn}
file.
@paragraph{}

To learn how to use this command consult: @x{How to configure the keyboard}.
@paragraph{}

@refMenu1{cmeEditKeyBind}

@c --------------------------------------------------------------------------
@subsubsection Setup Alt keys

It allows you to select how the editor interpretes the left and right alt
keys. For more information: @x{Alt key configuration}.
@paragraph{}

@refMenu1{cmeSetUpAltKeys}

@c --------------------------------------------------------------------------
@subsubsection Key pad behavior

[DOS]
@paragraph{}

Here you can choose how the keypad is interpreted by the editor. Two options
are provided. One is the BIOS default, in this mode the @key{NumLock} changes
between arrows and numbers. In the other mode the behavior is similar, but
holding shift and pressing a number will behave like an arrow key shifted,
that's very common in DOS applications so that's the default.
@paragraph{}

@refMenu1{cmeKeyPadBehavior}

@c --------------------------------------------------------------------------
@subsubsection Back to defaults

This option restore the default keys assignment of the editor. Use it if you
did a real dissaster in the keyboard configuration and you want to go back
to the original values.
@paragraph{}

@refMenu1{cmeKbBackDefault}

@c --------------------------------------------------------------------------
@subsubsection Consult scan codes

Used to consult the keyboard scan codes: @x{Consulting scan codes}.
@paragraph{}

@refMenu1{cmeSeeScanCodes}

@c --------------------------------------------------------------------------
@subsubsection Screen Options

This command po-ups the screen options configuration dialog. Here you can
customize the video mode, the fonts and the characters encoding. If you are
looking for the screen saver: @x{Editor General}.
@paragraph{}

The @i{Screen Mode} group allows you to select the video mode. The radio
buttons shows the modes fully supported by the editor. If you want to try
an special mode of your video card just enter the number of mode in the
input line located under the modes list. Finally you can choose to set the
mode using an external program. To make that enable the
@i{Use external program} option and enter the name of the program. I use
SVGA Text Mode to setup 108x30 from time to time.
@paragraph{}

The @i{Primary font} and @i{Secondary font} groups are used to indicate the
fonts used by the editor. If you don't know what a secondary font is:
@x{Text mode attributes}. For the primary font you can choose between using
the ROM BIOS fonts or one of the provided fonts. If you choose the ROM BIOS
fonts then the encoding doesn't have any effect and you can't use a secondary
font. For the secondary font you can choose if you want to use it or not.
@paragraph{}

The provided fonts works well with the list of supported video modes and
normally can be used with any video mode, but if you choose a very strange
video mode the editor won't be able to set the font and will use the ROM
BIOS fonts.
@paragraph{}

The @i{Primary encoding} and @i{Secondary encoding} options allows to select
the code page (encoding) used by the editor. Currently the editor supports
twelve encodings. That's usefull if you need to look files with a different
encoding and the encoding isn't supported by DOS or you just don't want to
reconfigure your machine for it. As an example in my country the DOS uses the
CP850 as default, as this code page destroys some graphic chars I never use
it, but there are people using it so if I want to look text written by this
people in the right way I must choose this encoding. Something similar
happends with Windows and Linux texts, they use ISO Latin 1 and that's
totally unsuported by DOS, so if I want to see the accents in the text I
must use this encoding.
@paragraph{}

@refMenu1{cmeSetScreenOps}

@c --------------------------------------------------------------------------
@subsubsection User Words
@cindex syntax highlight, defining user words

This option is used to define reserved words defined by the user. A very
common use is to define @code{typedef}s you normally use in your programs.
The user words are language dependant. They are highlighted with a special
color different than the color used for reserved words.
@paragraph{}

The first dialog is used to select the language, the names are the ones
defined in the syntax highlight file (@x{Syntax Highlight}). Selecting one of
the names and pressing @key{ENTER} the second dialog pop-ups.
@paragraph{}

The next dialog is used to add or remove words to the list. Pressing
@key{ENTER} you confirm the changes and they are saved to disk. If you exit
with @key{ESC} the old list is preserved.
@paragraph{}

The user words are stored in a file called @file{userword.txt} in the same
place where the rest of the configuration files are stored. The editor
doesn't include this file in the distribution because these values must be
defined by the user. You can edit the file by hand if you want, the format is
very simple. The start of a list is marked with @code{.} followed by the name
of the language. The items of the list are marked with @code{+}. Any line
starting with other character will be ignored during the parsing.
@paragraph{}

Note: The menu option is "Tool&Ops|Options|User Words".
@paragraph{}

@refMenu1{cmeEditUserWords}

@c --------------------------------------------------------------------------
@subsubsection Default global edition

To understand how this menu option works you must know some details about the
global options of the editor. @x{Set Global}.
@paragraph{}

The global options are good, but sometimes you want to make some small
differences depending on the kind of file you are editing. For example: I
want the @i{Intelligent C indent} mode enabled for C, but not for most of the
files, I also want to wrap lines for Texinfo files and files without syntax
highlight. That's impossible to achieve just using the global options, here
is when this option is used.
@paragraph{}

The mechanism is like this: each time you open a new file the editor will
copy the default global options to it and select the syntax highlight
according to various things, mainly using the extension. Ones the editor
select the syntax highlight the next step is to transfer some options that
applies only to the selected syntax highlight. By default the list of options
to apply is empty but you can add options using this menu option.
@paragraph{}

The options are associated with a particular syntax highlight and the values
are stored in a file called @file{deflopts.txt}. The list of options
indicates which settings will be enabled, or disabled, in addition to the
global options. That's something very important you must to note, the list
acts in addition to the global options, not instead. So the list will say
things like "also enable the intelligent C indent", "disable the wrap lines",
@i{etc.}
@paragraph{}

The first dialog shows the list of syntax highlight defined in the
@file{syntaxhl.shl} and have three buttons. The @code{Edit} button is the
default button, so pressing @key{ENTER} you'll edit the settings for the
selected syntax highlight. The @code{No SHL} button is used to edit the
options that will be applied for files that doesn't have any syntax highlihgt
applied.
@paragraph{}

Once you selected one syntax highlight a dialog with the list of the settings
associated to it will appear. The first time it will be empty because these
values are filled only by the user, no defaults are provided. In this list
the settings that will be enabled in addition to the global options are
marked with a @code{+} before the name of the option. The options that will
be disabled are marked with a @code{-}. The options are the same described
in the editing modes section. @x{Editing Modes}.
@paragraph{}

The dialog contains an @code{Add} and a @code{Delete} button as other
dialogs. You can also use the @key{Insert} and @key{Delete} keys. When adding
a new setting to the list a dialog containing the list of available settings
is displayed. Note this list contains all the settings that are available,
once you add one of them to the previous dialog it is removed from this list.
@paragraph{}

After selecting one setting to add a new dialog will be displayed. This
dialog will ask information related to this setting. Most settings are flags
that can be @i{added} or @i{substracted} from the global options, but some of
them are just values that will overwrite the global options. Examples of the
last type are the tabs size and the wrap column, in this case the dialog will
ask the value.
@paragraph{}

The values are stored in a very simple format in the @file{deflopts.txt}
file. You can edit this file by hand, but in this case you'll need to know
the names of the settings. The format is very simple, a line starting with
@code{.} starts a section, the stop is followed by the name of the highlight
affected. Flags that will be added (enabled or ored) are marked with a
@code{+} as in the dialog, flags that will be substracted (disabled or anded)
are marked with a @code{-} again like in the dialog, in fact the dialog shows
the same string that is then stored in the file. If the setting is numeric it
will ever start with @code{+} and after the name follows an @code{=} and the
asigned value. Just play a little bit and see the resulting file.
@paragraph{}

@refMenu1{cmeEditDeflOpts}

@c --------------------------------------------------------------------------
@subsubsection File open dialog

This command is used to configure some details of the file open dialog.
@x{File Open}.

@refMenu1{cmeFileOpenOptions}

@c --------------------------------------------------------------------------
@subsection Calculator (command/menu)

This command shows the calculator: @x{Calculator}.
@paragraph{}

@refMenu{cmeCalculator,Alt+F4}

@c --------------------------------------------------------------------------
@subsection SDG

Runs the documentation module: @mxref{Top,SDG Documentation,,SDG,SDG}.
@paragraph{}

To configure the SDG module: @x{SDG Options}.

@refMenu{cmeSDG,F9}

@c --------------------------------------------------------------------------
@subsection Run program

Runs the desired program. To customize what program to run:
@x{Run program (which one)}.
@paragraph{}

@refMenu{cmeRunCommand,Ctrl+F9}

@c --------------------------------------------------------------------------
@subsection Grep

This command pop-ups the @i{Powered Grep} dialog. Grep is a very powerfull
tool to search text in files. To be able to use it you @b{must} have the
grep tool installed in your system. It isn't shipped with the editor.
@paragraph{}

@itemize @bullet
@item Pattern Box: The text you want to search for. You can use regular
expressions here. @x{Regular Expressions}.
@item Files to search: The mask used to select the files where grep will
make the search. Wildcards and some limited basic regular expressions
are supported here.
@item Directories to search: The list of directories where the search will
be performed.
@end itemize

The @i{Source of pattern} options are used to select what text will be
searched:
@paragraph{}

@itemize @bullet
@item Pattern box is the pattern: grep will search the text indicated in the
pattern box.
@item Pattern box is a file name: To search words contained in a text file.
@item Use clipboard selection: Use it to use the clipboard selection instead
of the pattern box text. @x{Clipboard}.
@end itemize

The @i{Type of pattern} option selects how the pattern is interpreted the
options are directly related to the grep switchs @code{-G}, @code{-E} and
@code{-F}. You can select basic regular expressions, extended regular
expressions or just a list of matching values separated by carriage returns.
@x{Regular Expressions}.
@paragraph{}

The @i{Place to search} group is used to select what files are examined in
the search:
@paragraph{}

@itemize @bullet
@item Use files to search: The files to search content is the mask.
@item Search in opened windows: The search is performed in all the opened
text files.
@item Search in project: The search is performed in all the project files.
@x{Project}.
@item Recurse in subdirs: When enabled the editor will run search not only
in the indicated directories but in any subdirectory contained by these
directories. That's the main reason because I call it @b{Powered} Grep.
@end itemize

The @i{Options} group contains various options that are self-explanatory.
They include: case sensitive search, whole word and whole line matching and
inverse matching. The last reports the lines that doesn't match, be careful.
@paragraph{}

After the search the matched lines are displayed in the message window and
pressing @kbd{Alt+F7} and @kbd{Alt+F8} you can examine the matchings.
@paragraph{}

To learn more about the message window @x{Message Window}.
@paragraph{}

@refMenu1{cmeGrepDialog}

@c --------------------------------------------------------------------------
@subsection HTML Accents

It converts all the accents in the text to ISO-Latin-1 HTML tags. That's
usefull when editing html files because you can type accents naturally and
when finished you simply use this option to generate the right tags. It works
for any code page selected.
@paragraph{}

@refMenu1{cmeHTMLAccents}

@c --------------------------------------------------------------------------
@subsection Profile Editor

This option is just used to meassure the speed of the editor. Use large files
and to compare results run it on the same file.
@paragraph{}

@refMenu1{cmcProfileEditor}

@c --------------------------------------------------------------------------
@subsection Delete memorized backups
@cindex backups, delete

Deletes all the memorized backups. It includes all the backups created while
the current project/desktop file was opened. If you want to also delete
backup files created during previous sessions you must enable an special
option that makes the editor keep a list across senssions.
@x{Editor General}.
@paragraph{}

@refMenu1{cmeDeleteBkps}

@c --------------------------------------------------------------------------
@subsection Paste Emacs mode
@cindex syntax highlight, paste mode

Pastes a comment at the start of the file indicating the Emacs mode and the
tab size used for this file. That's very useful if the file doesn't have
extension or the extension is ambiguous. It is also good idea to do it if
you'll send the file to another person and want to indicate which tab size
you used.
@paragraph{}
The editor understands this comment and sets the syntax highlight and tab
size to the value indicated.
@paragraph{}

@refMenu1{cmcPasteEmacsMode}

@c --------------------------------------------------------------------------
@section Project

The project files are used to indicate groups of files. Each project have
your own desktop file so you can have different settings for different
groups of files. @x{Desktop Files}.
@paragraph{}

There are several reasons to use projects:
@paragraph{}

@itemize @bullet
@item If you want to work on a group of files and you will be editing these
files for a long time use a project. Then you will be able to select what
file to edit from the project window, as this window is sorted alphabetically
is easy to make incremental searchs (typing the first letters) to find the
file. Additionally the editor saves the window position and other stuff for
all the files listed in the project, even if they aren't listed in the closed
windows list. I use it for my web site files, they are over than 44 and the
list of windows (@kbd{Alt+0}) doesn't help.

@item If you are using the SDG module it will collect the comments of the
files listed in the project, so you need to use a project to specify the
files.

@item You can use a project to list a set of files to search with grep, then
each time you want to search in these files you open this project and
performe the search.
@end itemize

@c --------------------------------------------------------------------------
@subsection Open (Project)

Opens a project file. To create a new file just enter a new name in the
dialog.
@paragraph{}

@refMenu1{cmeOpenPrj}

@c --------------------------------------------------------------------------
@subsection Close (Project)

Close the project file.
@paragraph{}

@refMenu1{cmeClosePrj}

@c --------------------------------------------------------------------------
@section Help

@c --------------------------------------------------------------------------
@subsection InfView

Well I think you figured it out, that's the help.
@paragraph{}

@refMenu{cmeInfView,F1}

@c --------------------------------------------------------------------------
@subsection Another InfView

It opens another InfView window. The editor @b{ever} opens one window that's
used by the help system. When you close this window the editor just hides it
and when you press @key{F1} the window is un-hided and the help is displayed.
That allows the existence of the @i{Previous help} command. But some times
you could want to brise one or more help files without losing the help
window, in this case you need more than one InfView opened.
@paragraph{}

@refMenu1{cmeAnotherInfView}

@c --------------------------------------------------------------------------
@subsection Tip of the day

Once a day the editor shows a tip when you start. Each tip talks about one
interesting feature that most of the people overlook. Reading one tip by day
you'll discover a lot of interesting things about the editor.
@paragraph{}

Each tip have one or more buttons at the right, each button is a link to a
help topic related to this tip. If you want to learn more about the tip's
topic you can browse the help using the buttons.
@paragraph{}

There are three options at the bottom of the window, they are self
explanatory. The first disables the annoying tips ;-), the second shows the
tips in a dialog box once a day and the third shows the same text in the
message window (once a day of course). The third option is less annoying than
the second but you lose the link buttons.
@paragraph{}

The text displayed by the tips comes from the @file{editor.tip} file. You can
edit it to show anything but be careful because the parser isn't very
tolerant to typos.
@paragraph{}

To learn more about the message window @x{Message Window}.
@paragraph{}

@refMenu1{cmeTipOfTheDay}

@c --------------------------------------------------------------------------
@subsection Syntax help

When programming a language like C you can't remmember the exact name of all
the library functions. The djgpp libc help contains around 650 nodes and the
Allegro help around 400. Placing the cursor over the name of a library
function and pressing @key{^F1} you'll get help about this function. If the
name isn't exactly typed you'll get a list of the closest matches. The
following topics explain how to configure it.

@c --------------------------------------------------------------------------
@subsubsection Options (Syntax help)

This dialog box allows the configuration of the syntax help.
@xref{Syntax help}.
@paragraph{}

The search methode used can be:
@paragraph{}
@itemize @bullet

@item Exact: Only exact matches are reported.
@item Substring: Partial matches are reported.
@item Fuzzy: It uses a special algorithm that reports words similar to the
one you are searching.
@end itemize

The available options are:
@paragraph{}
@itemize @bullet

@item Case sensitive: The search interprets lower case characters as different
than uppercase characters.
@item Sort by score: The matches are sorted by score when reported. When
disabled the sorting criteria is alphabetical. A greater score means the
match is more similar to the word you are searching. A score of 1000
means exact match.
@item Fuzzy value: That's used only when the selected mode is the fuzzy mode.
It indicates what is minimal score a word must have to be displayed as
a possible match. Experiment with different values and see the scores
reported.
@end itemize

@refMenu1{cmeSyntaxHelpOps}

@c --------------------------------------------------------------------------
@subsubsection Files to search (Syntax help)

Here you can indicate in what info files the editor will search the name of
the function. the default is OS dependent. @xref{Syntax help}.
@paragraph{}

You can specify an info node or just the name of the file. In the first case
the editor will read all the cross references found in this node, in the
second the editor will use all the nodes of the file. Normally the node that
contains all the relevant references is called Index, but there are
exceptions one interesting case is libc.
@paragraph{}

In the dialog the editor shows what nodes are used to search. If the name
have a question mark at the left it means the editor didn't read the file
yet, pressing @key{^F1} over any word the editor will search it and hence
will read the help files. If the name have an asterisk it means some error
was encoutered when trying to read this file. Finally if no mark is indicated
it means the editor succesfully read the file, additionally the number of
nodes found is indicated at the right. You can add or remove nodes from the
list.
@paragraph{}

@refMenu1{cmeSyntaxHelpFiles}

@c --------------------------------------------------------------------------
@subsubsection Search (Syntax help)

It makes the syntax search and reports the matches found. If only one match
was found the editor jumps to this node. @xref{Syntax help}.
@paragraph{}

@refMenu{cmeSyntaxHelp,^F1}

@c --------------------------------------------------------------------------
@chapter Editing Modes

  The editor has various settings that control the function and aspect of
the editor.
@paragraph{}

  The settings are:
@paragraph{}

@section Overwrite
@cindex Overwrite

  This setting controls if the typed characters are inserted in the buffer or
if the typed characters replace the original ones. @x{Insert and Delete}
for a detailed explanation.

@section Autoindent
@cindex Autoindent

  This setting controls what happend when you press @key{ENTER}. If this setting
is off the cursor goes to the column 1 of a new line. If the
mode is on the editor will try to keep the indentation of the code
inserting spaces or tabs. @x{Optimal Fill}.

@section Real Tabs
@cindex Real Tabs
@cindex Use Real Tabs
@cindex TABs

  This setting controls what happend when you press @kbd{@key{TAB}}. If this setting
is on the editor will insert an ASCII 9 in this place.
@paragraph{}

  An ASCII 9 is a TAB, that means that the width of this char is enough to
move the cursor to the next tabulator column. In the editor the tabulator
columns are equidistant and the positions are controled by the Tab Size value.
@paragraph{}

  If this setting is off the editor won't put any ASCII 9 in your text.
Instead the editor will insert enough spaces to move the cursor to the
next tab-stop, but if the cursor is positioned on the first character of
the line the editor will insert spaces to move this position to the next
hole in the line over the line where you are. Confused? Sorry for my
English, an example will clarify that:
@paragraph{}

This is a line over the line where you are
@paragraph{}

That's the line where the cursor is, at column one.
@paragraph{}

  After pressing TAB you'll get:
@paragraph{}

This is a line over the line where you are
@paragraph{}

     That's the line where the cursor is, at column one.
@paragraph{}

  Now can ask, Why this? Is that useful? The answer is that's very useful
to keep your code indented, experiment using that under a line with if, for,
@i{etc.}
@paragraph{}

  Another thing controlled by this setting is the behaviour of the
@key{Backspace} key, when the setting is on the key is just 'delete the
character at the left of the cursor' but when the setting is off this
key is the 'Unindent' key.
@paragraph{}

  The editor is much more coherent when you choose to use TABs or not use
TABs. If you mix the two modes you'll get some unexpected things, specially
in the indentation of the blocks.
@paragraph{}

  Is better if you always work in a file without tabs and with this setting
off. Then you'll get much from the editor.
@paragraph{}

  Now you can say: @samp{But I really need tabs because I'm editing a make file!} or
@samp{because I will send the file using an ultra slow link} @samp{and I want the compression
granted by the tabs.} In these cases you can first expand all tabs, then
work without real tabs and at the finish of your work compact all possible
spaces and generate a file with all the tabs that you need.
@x{Miscellaneous} section.
@paragraph{}

@section Persistent Blocks

  This setting controls the behaviour of the selected area.
@paragraph{}
  @x{Block modes} chapter for a detailed explanation.
@paragraph{}

@section Intelligent C indent
@cindex Intelligent C indent

  This mode was designed to be used in jointly with the Pseudo Macros
(@x{Pseudo Macros}) and the Real Tabs mode in off to achieve an
easy way to indent the code making a better work than the Autoindent mode.
@paragraph{}

  In this mode the spaces inserted after pressing @key{ENTER} depend on
the first word in the last line. For example, if you have:
@paragraph{}

@smallexample
if (a==b)_
@end smallexample

  With the cursor in the '_' position and press @key{ENTER} you'll get:
@paragraph{}

@smallexample
if (a==b)
  _
@end smallexample

  Now you can do either of two things, 1) press space and write the code that will
be executed by the if, or 2) if this a multiline code press @{ and @key{ENTER}.
In the last case you'll get:

@smallexample
if (a==b)
  @{
   _
@end smallexample

  Now type your first line of code. Press @key{ENTER}. Write your next line.
Press @key{ENTER} again and then @key{Backspace}:

@smallexample
if (a==b)
  @{
   1st line;
   2nd line;
  _
@end smallexample

  Now type @} and press @key{ENTER} one more time:

@smallexample
if (a==b)
  @{
   1st line;
   2nd line;
  @}
_
@end smallexample

  As you can see the code is perfectly aligned without a significant work
on your part.
@paragraph{}

  I tried to make this mode as smart as possible, but needs more work. If
you have suggestions contact me.
@paragraph{}

  Another important thing is that this indentation has a personal style,
my style ;-), so maybe you don't like it. If that's your case you can
do the following things:
@paragraph{}

@itemize @bullet
  @item Use another way of indentation offered by the editor. For example,
turn on the Real Tabs mode and indent with tabs.
  @item Customize the @file{cpmacros.pmc} file (@x{Pseudo Macros}), actually this
file is coherent with this mode.
  @item The editor isn't configurable like Emacs or Brief using a language,
but is written in C++ and chances that you know C++ are over the
90% so contact me and I'll help you to write the routines that you
need to get an indentation in your own style :-).
@end itemize

@subsection Can you explain to me more about the behavior of this mode?

  I'll try to describe the behaviour of the mode:
@paragraph{}
  Each time you press @key{ENTER} the editor inserts a @samp{\r\n} string in your
text, after that the editor searchs one line located above the new line that
has at least one character inside. This line is taken as reference. The
editor analyzes this line searching for:
@paragraph{}

@itemize @bullet
   @item The first non-blank character on this line.
   @item The first word on this line.
   @item The first parenthesis.
   @item The balance of parentheses on the line.
   @item The last non-blank and non-comment character in the line.
@end itemize

  Now, if the line contains @{ at the start the editor goes to the first
column after the @{.
@paragraph{}
  If the line contains @} at the start the editor will go to the same column
of the @} and then will perform a @key{Backspace}. If the Real Tabs
mode is off, that's an unindent. @x{Real Tabs}.
@paragraph{}
  If the line starts with a C++ comment the effect is the same as in
Autoindent. @x{Autoindent}.
@paragraph{}
  If the line starts with a C comment the editor will try to skip the
comment and analyze the rest of the line, but if the comment doesn't end
on this line the editor will go to the column where the @samp{/} is.
@paragraph{}
  If the line starts with @samp{/} the editor goes to this column.
@paragraph{}
  If the line has more @samp{(} than @samp{)} the editor will go to the column of the
first non-blank after the first @samp{(}.
@paragraph{}
  If the line has more @samp{)} than @samp{(} the editor will search the line where the
number of parentheses is balanced, then will analyze this line. If the whole
line still generates an unbalanced situation the editor will go to the
first used column in the line that was found the first time. But if this
line lets all balanced the editor will take the first word on the line and
will use it as reference.
@paragraph{}
  At last, and according to the word found, the editor will use this
word as reference. The editor recognises the following keywords:
@paragraph{}

@table2_auto{Keyword,Action}
@clear table-set-center
@titem_{@samp{do},+2 but not if @dots{} ;}
@titem_{@samp{if},+2 but not if @dots{} ;}
@titem_{@samp{for},+3 but not if @dots{} ;}
@titem_{@samp{else},+2}
@titem_{@samp{case},+5}
@titem_{@samp{while},+2 but not if @dots{} ;}
@titem_{@samp{switch},+2}
@titem_{@samp{break},unindent}
@titem_{@samp{return},unindent}
@titem_{@samp{default},+5}
@endtable_{}

  The numbers are how many spaces are added with reference to the first letter
of the word.  'not if @dots{} ;' specified means that, if the line ends with
a semicolon, the editor will do the same as for Autoindent. @x{Autoindent}. The
unindent is performed with @key{Backspace}.
@paragraph{}

  Seasick? @x{Do you have more examples?}.
@paragraph{}

  Note: Some of these features were added in v0.2.14 of the editor based on a
suggestion of @email{Bradford L.@: Spencer, stud73@@nortel.ca} about the
behaviour of the mode on a line like this @samp{printf("Num: %d",} with the
rest of the parameters on the next line.
@paragraph{}

@subsection Do you have more examples?

  Well here are some examples. I used a strange convention, like this:
if I say type `a[ENTER]@{', type the letter @kbd{a}, then press @kbd{@key{ENTER}} and
finally press the `@{' key.
@paragraph{}

Example 1: (Is similar to one explained before but is to show the
convention)
@paragraph{}

@smallexample
Type:
if (a==1)[ENTER]@{[ENTER]a=2;[ENTER]b=3;[ENTER][BACKSPACE]@}[ENTER]

You'll get:

if (a==1)
  @{
   a=2;
   b=3;
  @}
[<--- cursor here]
@end smallexample


Example 2: A switch/case example
@paragraph{}

@smallexample
Type:
switch(a)[ENTER]@{[ENTER]case 1:[ENTER]a=2;[ENTER]b=3;[ENTER]break;
[ENTER]case 2:[ENTER]b=5;[ENTER]break;[ENTER][BACKSPACE]@}[ENTER]

You'll get:

switch(a)
  @{
   case 1:
        a=2;
        b=3;
        break;
   case 2:
        b=5;
        break;
  @}
[<--- cursor here]
@end smallexample


Example 3: A call to a function that takes a lot of parameters
@paragraph{}

@smallexample
Type:
printf([SPACE]"Num: %d",[ENTER]a[SPACE]);[ENTER]

You'll get:

printf( "Num: %d",
        a );
[<--- cursor here]
@end smallexample


Example 4: A lot of parentheses
@paragraph{}

@smallexample
Type:
if[SPACE]([SPACE](a==1)[SPACE]||[ENTER](b==2)[SPACE]||[ENTER]
c[SPACE])[ENTER]

You'll get:

if ( (a==1) ||
     (b==2) ||
     c )
  [<--- cursor here]
@end smallexample


Example 5: Comment trying to interfere part 1
@paragraph{}

@smallexample
Type:
/*-a-*/for[SPACE](x=1;x;--x)[ENTER]

You'll get:

/*-a-*/for (x=1;x;--x)
          [<--- cursor here]
@end smallexample


Example 6: Comment trying to interfere part 2
@paragraph{}

@smallexample
Type:
for[SPACE](x=1;x;--x);[SPACE]//-b[ENTER]

You'll get:

for (x=1;x;--x); //-b
[<--- cursor here]
@end smallexample


 Note: Of course you can fool the editor but as you can see it is relatively
smart ;-).
@paragraph{}

@section Column cursor
@cindex Column cursor

  This setting enables an strange feature of the editor, when this mode is
on the column where the cursor is is highlighted. This feature is very good
to check if some part of your code is aligned.
@paragraph{}

  If you like this mode but is very uncomfortable to use all the time
contact me and if I get enough feedback I'll put this thing in a key to be
turned on/off quickly.
@paragraph{}

@section Row cursor
@cindex Row cursor

  This setting is similar to the column cursor but acts on the row
where the cursor is. If you enable the two modes you'll get a cross on the
screen showing where the cursor is.
@paragraph{}

@section Match pair highlight
@cindex Match pair highlight

  This mode acts showing the pairs of (/), [/] and @{/@} on the fly. Each
time you type one of these symbols the editor will search the matching
pair, if the editor finds it and the match is on the screen both will be
highlighted, if the match is outside the screen the editor will inform the
position on the status line, and if there is no match the editor will
inform the situation in the status line too.
@paragraph{}

  That's very useful when you are typing complex parenthetical expressions or
a very nested code. You can use it jointly with the @i{cmcSearchStart},
@i{cmcSearchEnd}, @i{cmcSearchOpPar}, @i{cmcSearchClPar}, @i{cmcSearchOpCor} and
@i{cmcSearchClCor} commands. (@x{Miscellaneous}).
@paragraph{}

@section Transparent Blocks
@cindex Blocks, transparent

  When this mode is on you can see the syntax highlight of selected blocks. Normally
the selection affects the background and foreground colors, but when using transparent
blocks only the background is affected.

@section Optimal Fill
@cindex TABs, indenting with
@cindex Real Tabs when indenting

  This mode was added for the people that uses ASCII 9 tabulators in your code
(@x{Real Tabs}). Normally the editor uses spaces to indent the code or, in general,
to fill any gap in the text. When you enable this mode the editor will use as much
tabs as possible to fill these gaps. That's what the tabs users normally spects.

@section Wrap Words
@cindex wrapping

  Even when the editor is mainly intended for programmers I saw that some users want
it too.
@paragraph{}
  The word wrap added to the editor is a very simple one, it just inserts a new line
if you type a word beyond the wrap column, that's all. You won't get automatic reformat
functions like in text editors intended for love letters (like the one from the Bill
Gates company).
@paragraph{}
  The wrap column box is used to enter the column that triggers the wrap.

@section Do not move the cursor on Paste
@cindex Paste, do not move the cursor

  That's a global setting. When it's on the cursor isn't moved after pasting. Normally
the cursor is moved to the end of the pasted block, but sometimes is better if the
cursor isn't moved.

@section Scroll Lock centers
@cindex centering the screen while typing

  When this mode is on the Scroll Lock key have an special meaning. If the Scroll Lock
led of your keyboard is on then the editor centers the current line in the window. The
effect is very strange but the advantage is that you don't need to follow the movement
of the line with your eyes because it's ever in the same place.

@section See Tabs
@cindex TABs, highlight/see

  In this mode the tabs are highlighted, two colors are used for this purpose,
one for even and the other for odd tabs. In this way you can clearly see where
a tab is located and the size of the tab. The colors can be customized from
the Colors menu option. @xref{Colors}.
@paragraph{}

  This mode was introduced in v0.4.23 and is globally enabled by default.

@section Do not move inside tabs
@cindex TABs, skipping/through
@cindex cursor through tabs

  In this mode the cursor can't be place inside a tab character. This
definition is fuzzy and confusing so here I'll try to explain it better. One
tab character can be expanded to one or more characters when displayed in the
screen. Normally you can place the cursor in any of the spaces that belong to
a tab character. I think this behavior is the best because you are free to
move the cursor to any place you want, but tab's users get confused when they
type and discover they had the cursor in the middle of a tab. It produces a
cursor jump. To avoid this kind of surprises a lot of editors doesn't allow
to position the cursor in these spaces, only in the first space.
@paragraph{}

  This mode was introduced in v0.4.23 and is globally enabled by default.

@section Syntax Highlight
@cindex syntax highlight extensions

  The editor can highlight the syntax of your code. The available modes
are:
@paragraph{}

@itemize @bullet
  @item No highlight, all the code is with the same color.
  @item C/C++ Highlight.
  @item Pascal Highlight.
  @item Clipper Highlight.
  @item User defined. Including already defined for:
  @itemize @bullet
    @item 80x86 AT&T
    @item 80x86 Intel
    @item Ada
    @item BASIC
    @item C/C++
    @item Clipper 5.x
    @item HTML
    @item Modula 2
    @item Pascal
    @item PMacros files
    @item SDG format files
    @item sLisp macros
    @item The syntax highlight file itself
    @item Perl
    @item 8x51 assembler
    @item Java
    @item Environment files
    @item Python
    @item UNIX shell scripts
    @item Texinfo
    @item PIC assembler
@c Currently SDH doesn't support it in other column that 1, sorry.
@end itemize
@end itemize

  The kind of highlight is chosen automatically using the extension of the
file. Additionally the editor supports Emacs like mode selection. Emacs
searchs the name of the editing mode in the first kilobyte and last three
kilobytes of text. The editing mode is delimited by @code{-*-} and the
editor will use it instead of the file extension to select the highlight.
That's very usefull for files without extensions like the new C++ headers.
To add even more flexibility I'm supporting another technique used by some
C++ headers from Silicon Graphics and Hewlett Packard, in these headers the
mode is located in the last lines unsing some special keywords.
@paragraph{}

  The editor also supports the convention used for UNIX script files. If a
file starts with @code{#!} this line indicates the program that must be
executed to interpret the script. The editor reads this line and extracts the
name of this program and searchs it in the @code{ShellScript} definition.
@paragraph{}

  The C/C++ highlight was designed for the GNU C compiler.
@paragraph{}
  The Pascal highlight was designed for the GNU Pascal compiler.
@paragraph{}
  The Clipper highlight was designed for the CA-Clipper 5 compiler.
@paragraph{}

  The highlight can be customized, @x{Syntax Highlight File}.

@chapter Syntax Highlight File

  The highlight can be customized editing the @file{syntaxhl.shl} file. You can add
syntax highlight to almost any kind of files, a good example is the fact that the files
used to configure the editor have your own syntax highlight.
@paragraph{}

  The file declares the settings for each kind of files. Each declaration ends with an
@code{End} marker. The @code{#} acts as a start of command if it appears in the first
column.
@paragraph{}

  Important things you have to know to add a new syntax highlight:
@paragraph{}
@itemize @bullet
  @item In previous versions when adding a new highlight it should be added
at the end of the file now it isn't mandatory.
  @item The editor remmembers various settings of loaded files even after
closing the file. It includes the syntax highlight, so if you add
a new one or just add a new extension to the list and you open a file
that you already opened the editor could remmember the last settings
and don't use the new setting. In this case you must force it by
hand.
  @item If you feel that this new highlight can be used by other users send
it to me and I'll include it in the next release. Many of the
currently included syntax highlights were contributed by users.
@end itemize
@paragraph{}

  If you want to add some keywords to a language for personal use don't do it
in the @code{Keywords} section because you will need to edit this file each
time you install a new release of the editor. The editor provides another
file for it and also a nice user interface to add and delete words defined by
the user. @x{User Words}.
@paragraph{}

  The next sections covers the supported settings.
@paragraph{}

@section AllowedInsideNames

  Some languages includes symbols inside names, you can list these symbols here.
Normally the editor allows letters, digits and underscore. These characters are allowed
inside the names and not at the start of the name. @x{CanStartAName}.

@section CanStartAName

  Some languages includes symbols at the start of names, you can list these symbols
here. Normally the editor allows letters and underscore. These characters are allowed
at the start of the name and not inside. @x{AllowedInsideNames}.

@section Case

  When this setting is 1 all the keywords becomes case sensitive. If the keywords aren't
case sensitive don't use it.
@paragraph{}
  This should be declared as one of the first settings because it affects how
other definitions are loaded in memory. I suggest using it before @code{Name}
and @code{Files} and after the rest.

@section CloseComment1

  Used to indicate the end of a multiline comment. The lenght is limited to four
characters. If the file format have two different ends use @code{CloseComment2} for
the second.
@paragraph{}
  For more information @x{Format of short syntax highlight definitions}.

@section EmacsModes
@cindex syntax highlight, Emacs modes

  It indicates what Emacs modes will use this highlight. The modes must be
separated by commas. The modes are't case sensitive.
@paragraph{}
  As in Emacs the editor looks in the first kilobyte of text and in the last
three kilobytes for the mode delimited by @code{-*-}.
@paragraph{}
  The priority is as follows: @code{EmacsModes}, @code{ShellScript} and
finally the extension (@code{Files}). @x{ShellScript}. @x{Files}.

@section EOLCInFirstCol

  When this setting is on the one line comments starts only if the sequence of
characters is present in the first column.

@section EOLComment1

  Used to indicate the start of a comment that ends at the end of the line. The lenght
is limited to four characters. If the file format have two different ends use
@code{EOLComment2} for the second.
@paragraph{}
  For more information @x{Format of short syntax highlight definitions}.

@section Escape

  Indicates what character acts as escape character inside strings or to concatenate
lines.

@section Files
@cindex syntax highlight, extensions

  It indicates what extensions will use this highlight. The extensions must be
separated by commas. The extensions are case sensitive, be careful.
@paragraph{}
  The editor can also choose the highlight using the Emacs mode or the
program used to execute the file if that's an UNIX script.
@paragraph{}
  The priority is as follows: @code{EmacsModes}, @code{ShellScript} and
finally the extension (@code{Files}). @x{ShellScript}. @x{EmacsModes}.

@section HexMarker

  This setting indicates what prefix is used for hexadecimal numbers. No postfix
supported yet. The lenght is limited to four characters.
@paragraph{}
  For more information @x{Format of short syntax highlight definitions}.

@section Keywords

  It can be used as many times as needed and is used to indicate the reserved keywords
of the language. The separator is the comma.

@section Name

  It sets the name of the syntax highlight. This name is used in the local settings
dialog (cmcSetLocalOptions).

@section NoCheckNumbers

  When this setting is on the numbers aren't highlighted.

@section OpenComment1

  Used to indicate the start of a multiline comment. The lenght is limited to four
characters. If the file format have two different starts use @code{OpenComment2} for
the second.
@paragraph{}
  The maximun length is four characters, for more information about the format:
@x{Format of short syntax highlight definitions}.

@subsection Format of short syntax highlight definitions

  All the characters after the equal sign are taked as part of the field. Blank spaces
after the equal sign are ignored, so @samp{Field= //} is equivalent to @samp{Field=//}.
@paragraph{}
  As the field could start with spaces and spaces at the end of line are invisible
you can quote the test using the double quote sign. If you do it the first character
after the equal sign must be the double quote, if you left an space like this:
@samp{Field= "} the double quote will be interpreted as part of the field.
@paragraph{}
  When quoting text the back slash is the escape character, so it: @samp{Filed="\""}
will be interpreted as asigning @samp{"} to @code{Field}.

@section PartialKeywords

  When this setting is enabled the list of the editor will highlight partial matchs of
the keywords. For example, suppose a keyword is defined as @samp{key} and you type
@samp{keytable}, in this case the editor will highlight the @samp{key} part of the
word. This feature is experimental and makes the highlight much more slow.

@section PMacros

  Indicates the name of the pseudo macros file used for this kind of files. Using
different files for different formats you can assign common triggers to different
actions. For example, you can use i( to trigger an if() @{@} else @{@} in C and an if then
else in BASIC. @x{Pseudo Macros}.

@section Preprocessor

  Indicates what symbol starts a preprocessor line.

@section RelaxNumberCheck

  This is used when a number can start a name and that isn't a wrong
situation. Normally the editor takes it as a wrong number but when this
option is enabled the numbers check is relaxed and they aren't highlighted as
wrong values.

@section ShellScript
@cindex syntax highlight, shell scripts

  It indicates what scripts will be highlighted. You must indicate the names
of the programs associated with this script. The names are case sensitive.
@paragraph{}
  The editor looks for the @code{#!} characters at the start of the file, if
found the name of the program is extracted and searched in this list.
@paragraph{}
  The priority is as follows: @code{EmacsModes}, @code{ShellScript} and
finally the extension (@code{Files}). @x{EmacsModes}. @x{Files}.

@section ShortString

  Used to indicate the start and end of strings, used for small strings or characters.
The string ends at the end of line if not explicitly closed.

@section SpecialSymbol

  That's used to mark pairs of characters that forms a particular symbol that will
generate problems if the editor sees them as separated symbols. It was created to
avoid problems with @samp{$#} in Perl and bash scripts and with @samp{@@@@} in Texinfo
files. You can define more than one character here.
@paragraph{}
  The characters that can be combined with it are specified using the
@code{SpecialSymbolCont} definition.

@section String1

  Used to indicate the start and end of strings, used for long strings. You can specify
more than one character in this case any of them can open or close the string.
@paragraph{}
  The editor supports upto three diferent strings declared as @code{String1},
@code{String2} and @code{String3}.

@section Symbols1

  Used to indicate what characters are allowed symbols, normally used for boolean and
arithmetic symbols.

@section Symbols2

  Used to indicate what characters are allowed symbols, normally used for flow control
and subindex symbols.

@section UseInternal

  That's optional. When a highlight have this setting the editor will use the internal
routines and will ignore almost all the settings. Only the extensions (@x{Files}) and
pseudo macros (@x{PMacros}) settings are used.
@paragraph{}
  The value assigned can be: 1 for GNU C highlight, 2 for standard Pascal and 3 for
Clipper.

@chapter Pseudo Macros
@cindex Pseudo Macros
@cindex cpmacros.pmc

  This feature is very useful to save some keystrokes. With this feature you
can create a lot of shortcuts to make your life easier.
@paragraph{}

@section Please enlighten me - what is that?

  So now, What's a Pseudo Macro? It's like a macro but is triggered by two
things: one the text behind the cursor, and two the @kbd{^Space} combination.
@paragraph{}

  And what's the result? The result is customizable, but by default there are
some predefined behaviours. For example, type in a C source window the following
two characters: @kbd{#i} and the press @kbd{^Space} @dots{} (to create an empty
file with .c extension go to File|Open and type a new name, foo.c for example).
@paragraph{}

  Surprised? I bet! You got: #include <.h> and the cursor just in the right
place to write the name of the header.
@paragraph{}
Now write the famous stdio word, press @kbd{@key{End}}, then @kbd{@key{Enter}} twice and now write
the following two letters: @kbd{ma} and then @kbd{^Space} @dots{}
@paragraph{}

  I bet this time you predicted better what will happen so you aren't so
surprised ;-). Anyways, Surprise! Now type @kbd{pr} and the magic keys and @dots{}
@code{printf("");} appears. To end the happy history now type "Hello world!" That's
all. You wrote the hello world program at a very good speed.
@paragraph{}

  Now you know what I mean when I say pseudo-macros.
@paragraph{}

@section How can I customize that?

  Is very easy. Each syntax highlight have your own pseudo macros file. Which
file belongs to each syntax highlight is indicated in the @file{syntaxhl.shl}
file. @xref{Syntax Highlight File}. In the case of C/C++ the file is called
@file{cpmacros.pmc} and is located in the same directory where the rest of the
configuration files are installed. This file contains the definitions for each
pseudo macro that can be triggered in C/C++ files. You can define as many
pseudo macros as you want.
@paragraph{}

  Important: If you are using RHIDE consult the RHIDE documentation to know
where is stored the @file{cpmacros.pmc} file.
@paragraph{}

  The @file{cpmacros.pmc} file is a very good example and is self-explained but
I'll include here one example.
@paragraph{}

@format
Trigger: "i("
Mode: 0,1,0,1,0
 "if (@@0)\n"
 "  @{@@1\n"
   "@}\n"
 "\belse\n"
 "  @{@@2\n"
   "@}"
@end format

  The Trigger keyword defines the two letter behind the cursor that will
trigger the pseudo macro.
@paragraph{}
  The Mode keyword indicates the mode that the editor will use when inserting
the text. The modes are:
@paragraph{}

@itemize @bullet
  @item Overwrite               @x{Overwrite}
  @item Autoindent              @x{Autoindent}
  @item Use Tabs                @x{Real Tabs}
  @item Persistent blocks       @x{Block modes}
  @item Intelligent C indent    @x{Intelligent C indent}
@end itemize

  Each mode can be 0 or 1. The editor will return to the original mode after
expanding the pseudo macro. In this case the macro is expanded in the No
overwrite, autoindent, don't use tabs, the blocks are persistent
and don't be smart when indenting.
@paragraph{}

  The rest is the code to insert surrounded by ". You can use \b to indicate
backspace, \n for newline and \\ to indicate a simple \. If you want to
insert a @@ you have to type it twice @@@@, because this character
has a special meaning (see below).
@paragraph{}

  After the insertion the cursor is positioned in the place marked with @@0.
Don't forget to signal this point or the cursor will positioned at the
beginning of the file. The places marked with @@1, @@2 and @@3 are saved in
the markers 7, 8 and 9.
@paragraph{}

  Currently I defined pseudo macros only for C/C++ and Perl. I did it in a way
that you can use the same pseudo macro for both languages. For example:
@code{#i} is expanded to @code{#include <.h>} for C/C++ files and to
@code{request "";} for Perl files. If you write similar pseudo macros for other
languages please send me the file and I'll add it to the next release.
@paragraph{}

@chapter sLisp macros
@cindex macros from menu
@cindex menues and macros

  The editor uses a lisp like language to store macros. The macros are stored in a file
called @file{macros.slp}.
@paragraph{}

  The macros can be assigned to keys (@x{How to configure the keyboard}), selected
from the @i{Macro} menu or from the menu. From the @i{Macro} menu you can choose a
macro from the list and then if you want to repeat it make it with one keystroke.
@paragraph{}

  To add a new macro to the list you must edit the @file{macros.slp} file. You can
write the new macro by hand or you can use the @i{Macro} menu to record a macro and
then generate the sLisp code for this macro.
@paragraph{}

  To assign a macro to a menu entry you must edit the @file{menubind.smn}. The macros
are called using @code{cm(name)} where @i{name} is the name of the macro you want to
trigger.
@paragraph{}

@section How to write a sLisp macro

  I'll show an example and then I'll explain each part of the example:
@paragraph{}

@example
(defmacro 'Testing 1 2 3 ;-)'
 (eval
  (SendCommands cmcLineEnd)
  (InsertText (+ 'Hi!' CR 'How are you?'))
  (SendCommands cmcLineUp cmcLineEnd)
 )
)
@end example

  That defines a macro called "Testing 1 2 3 ;-)" that will be expanded to all the code
inside of the @code{eval} sentence. The @code{SendCommands} command sends one or more
commands to the editor. The @code{InsertText} command inserts one string in the code.
To concatenate strings use the @code{+} operator. Currently you can use the @code{\n}
escape sequence inside a string to indicate a carriage return but in the example I'm
showing how to concatenate strings. The @code{CR} is a defined constant.
@paragraph{}

@section How strings are parsed

  sLisp strings can be delimited by single or double quotes (@code{"} or
@code{'}). Currently both produce the same result but in the future it could
change to be similar to Perl.
@paragraph{}

  A few C escape sequences are supported inside strings. It means the
@code{\} character have an special meaning. Here are the values supported:

@table2{Character,Interpreted as}
@titem_{n,an OS dependant carriage return (\r\n for DOS and \n for UNIX)}
@titem_{l,simple line feed (ASCII 10 for DOS and UNIX)}
@titem_{r,simple carriage return (ASCII 13 for DOS and UNIX)}
@titem_{t,tab (ASCII 9 for DOS and UNIX)}
@endtable_{}

  In strings that will be inserted in the text you should use the @code{\\n}
escape sequence to maintain compatibility across different OSs. You can also
use the build in constant called @code{CR}.

@section Running programs with a macro

  There are a sLisp command called @code{RunProgram}. It takes an string as
parameter it can contain one or more programs separated by @code{;} or the
commands separator used by your command shell.
@paragraph{}

  The standard output and error are redirected and the results are sent to
the Message Window. If the program is a GNU tool and reported errors the
editor will parse these errors and allow you to directly jump to the file
and line where the error was reported.
@paragraph{}

To learn more about the message window @x{Message Window}.
@paragraph{}

@c ************************************************************************************
@section Editor specific commands

  This section describes commands specifically related to files under edition.
@paragraph{}

@c --------------------------------------------------------------
@subsection ComplChoose

  (ComplChoose @var{options} @var{delimiter} [@var{flags}])
@paragraph{}

  Brings a floating drop-down list with the options. The
@var{options} parameter is a delimited string, the delimiter is
specified by the @var{delimiter} parameter.
@paragraph{}

  The function returns the option selected by the user or an empty string if
the user aborted.
@paragraph{}

  The list is sorted alphabetically, the user can choose the item using the
cursors or doing an incremental search. Only characters allowed for reserved
words are accepted, any symbol will choose the currently selected item other
characters will abort.
@paragraph{}

  The @var{flags} parameter fine tunes the behavior of the routine. Currently
only one thing can be changed. By default the string returned contains the
character that produced the selection appended at the end of the string.
Passing 1 for @var{flags} the character isn't concatenated.
@paragraph{}

@c --------------------------------------------------------------
@subsection defmacro

  (defmacro @var{name} @var{expression})
@paragraph{}

  Defines a new editor macro called @var{name}. When this macro is called the
@var{expression} is evaluated. @x{How to write a sLisp macro}.
@paragraph{}

@c --------------------------------------------------------------
@subsection getenv

  (getenv @var{name})
@paragraph{}

  This command returns the content of the environment variable called
@var{name}. Internal variables of the editor are also accessable. I the
variable doesn't exist an empty string is returned.
@paragraph{}

@c --------------------------------------------------------------
@subsection GetSelection

  (GetSelection)
@paragraph{}

  This command returns the selected text in the editor as a sLisp string.
@x{How to write a sLisp macro}.
@paragraph{}

@c --------------------------------------------------------------
@subsection InsertText

  (InsertText @var{string} [@var{selected} [@var{move}]])
@paragraph{}

  Inserts the @var{string} at the cursor's position. By default the cursor is moved
after the insertion and the inserted text isn't selected. If @var{selected} is 1
the text is selected. If the @var{move} parameter is 0 the cursor isn't moved and if
the parameter is 1 the action depends on the current editor's setings.
@paragraph{}

@c --------------------------------------------------------------
@subsection RunProgram

  (RunProgram @var{program_name} [@var{flags}])
@paragraph{}

  Calls the desired program. You can pass more than one using the @code{;}
separator or any separator supported by your shell. Under DOS @code{;} is ok
even when command.com doesn't support it. The stderr and stdout are
redirected and captured by the message window of the editor.
@paragraph{}

  Use the operator @code{+} to concatenate strings and pass arguments.
@paragraph{}

  Using 1 for the @var{flags} argument the editor will redraw the screen
after running the external program.
@paragraph{}

  To learn more about the message window @x{Message Window}.
@paragraph{}

@c --------------------------------------------------------------
@subsection RunProgramRedir

  (RunProgramRedir @var{program_name})
@paragraph{}

  This function is similar to RunProgram, but the result isn't dumped to
the message window, instead the output of the program is returned as a
string.
@paragraph{}

  Be careful, that's a very powerful command, but very dangerous too.
@paragraph{}

@c --------------------------------------------------------------
@subsection SendCommands

  (SendCommands @var{command} ...)
@paragraph{}

  Sends all the listed commands to the editor. The editor commands are sLisp constants
that starts with @code{cmc}. These commands are the same explained in the keyboard
section as @code{cmcXXXXX}.
@paragraph{}

@c --------------------------------------------------------------
@subsection ShowInStatusLine

  (ShowInStatusLine @var{string})
@paragraph{}

  Shows the desired string in the status line of the current editor. Tabs
are converted to one space and the message stops in the first carriage
return or line feed. That's a very good way to show a result to the user.
@paragraph{}

@c --------------------------------------------------------------
@subsection WhichEditor

  (WhichEditor [@var{option}])
@paragraph{}

  This command takes one optional parameter and returns the file name of the current
file under edition.
@paragraph{}

  The optional parameter can be:
@paragraph{}

@table3{Parameter,Meaning,Example}
@titem_{0,Full name and path,\@samp\{c:/temp/test.txt\}}
@titem_{1,Same as 0 but without extension,\@samp\{c:/temp/test\}}
@titem_{2,Path for the file,\@samp\{c:/temp/\}}
@titem_{3,Disk drive,\@samp\{c:\}}
@titem_{4,File extension,\@samp\{.txt\}}
@titem_{5,Name without extension,\@samp\{test\}}
@endtable_{}


@c --------------------------------------------------------------
@subsection WordUnderCursor

  (WordUnderCursor [@var{max_length} [@var{options}]])
@paragraph{}

  This command takes one optional parameter and returns the word that's
located under the cursor. That's very useful for things like searching
help about the function the user is typing or things like that.
@paragraph{}

  The maximun length is optional and if you don't specify it 256 is used.
Values under 4 or over 32768 are adjusted to fit this range for security
issues.
@paragraph{}

  The @var{options} parameter is 0 by default. Passing 1 the editor will
return the word located at the left of the cursor if the cursor is located
in the first character after this word.
@paragraph{}


@c ************************************************************************************
@section General sLisp commands

  This section describes general sLisp commands that can be used from the editor and
the SDG configuration files.
@paragraph{}

@c --------------------------------------------------------------
@subsection and

  (and @var{exp1} @var{exp2} ...)
@paragraph{}

  Returns the logical and of the provided expressions.
@paragraph{}

  (and 20 "hello" 4)@*
  Returns 4.
@paragraph{}

@c --------------------------------------------------------------
@subsection eval

  (eval @var{expression} ...)
@paragraph{}

  This command is used to specify more than one action where just one is spected.
Additionally you could construct sLisp code in a string and then evaluate it. The
expressions are evaluated from left to right, the last evaluated result is returned.
@paragraph{}

@c --------------------------------------------------------------
@subsection gstr

  (gstr @var{string} @var{position})
@paragraph{}

  Returns the @var{position}th character of the @var{string}. The first character is in
the 0 position.
@paragraph{}

  (gstr "hello" 4)@*
  Returns "o".
@paragraph{}

@c --------------------------------------------------------------
@subsection if

  (if @var{condition} @var{statement_1} [@var{statement_2}])
@paragraph{}

  It evaluates @var{condition} if the boolean value of it is true then
@var{statement_1} is evaluates. If the value is false and if you provided a
second statement then @var{statement_2} is evaluated. If the value is false
and the second statement is missing nothing is evaluated and the resulting
value is 0.
@paragraph{}

  (if "hello" 4)@*
  Returns 4.
@paragraph{}

  (if "" 4 3)@*
  Returns 3.
@paragraph{}

  (if 0 4)@*
  Returns 0.
@paragraph{}

@c --------------------------------------------------------------
@subsection left

  (left @var{string} @var{number})
@paragraph{}

  Returns the first @var{number} characters of the @var{string}.
@paragraph{}

  (left "hello" 4)@*
  Returns "hell".
@paragraph{}

@c --------------------------------------------------------------
@subsection not

  (not @var{value})
@paragraph{}

  Returns the @var{value} negated.
@paragraph{}

  (not "hello")@*
  Returns 0.
@paragraph{}

  (not "")@*
  Returns 0xFFFFFFFF.
@paragraph{}

  (not 1)@*
  Returns -2.
@paragraph{}

@c --------------------------------------------------------------
@subsection or

  (or @var{exp1} @var{exp2} ...)
@paragraph{}

  Returns the logical or of the provided expressions.
@paragraph{}

  (or 20 4 2)@*
  Returns 22.
@paragraph{}

@c --------------------------------------------------------------
@subsection Operator +

  (+ @var{value1} @var{value2} ...)
@paragraph{}

  Returns the result of adding all the parameters. The type of the result is determined
by the first parameter. Currently you can't mix strings and integers but if you bug me
enough I'll add it. Adding strings means concatenation.
@paragraph{}

  (+ "hel" "lo")@*
  Returns "hello".
@paragraph{}

  (+ 3 5)@*
  Returns 8.
@paragraph{}

  (+ "hello" 1)@*
  Gives syntax error.
@paragraph{}

@c --------------------------------------------------------------
@subsection right

  (right @var{string} @var{number})
@paragraph{}

  Returns the last @var{number} characters of the @var{string}.
@paragraph{}

  (right "hello" 3)@*
  Returns "llo".
@paragraph{}

@c --------------------------------------------------------------
@subsection setv

  (setv @var{variable} @var{value})
@paragraph{}

  Assigns @var{value} to the @var{variable}. If the @var{variable} wasn't yet defined
the variable is created. The @var{variable} parameter must be a string representing
the name of the variable, it could be an expression.
@paragraph{}

  (setv "counter" 1)@*
  Assigns 1 to the @var{counter} variable, if @var{counter} doesn't exist counter is created.
@paragraph{}

  (setv (+ "counter" "1") 1)@*
  Assigns 1 to the @var{counter1} variable, if @var{counter1} doesn't exist counter is
created.
@paragraph{}

@c --------------------------------------------------------------
@subsection sstr

  (sstr @var{string} @var{position} @var{value})
@paragraph{}

  Changes the @var{position}th character of @var{string} by the first character of
@var{value}. The first character is in the 0 position.
@paragraph{}

  (sstr "hello" 1 "a")@*
  Returns "hallo".
@paragraph{}

@c --------------------------------------------------------------
@subsection strxlt

  (strxlt @var{string} @var{search} @var{replace})
@paragraph{}

  Searchs for the character listed in @var{search} in the passed @var{string}
replacing each ocurrence by the correponding value found in @var{replace}.
@paragraph{}

  (sstr "hello" "eo" "12")@*
  Returns "h1ll2".
@paragraph{}

@c --------------------------------------------------------------
@subsection substr

  (substr @var{string} @var{position} [@var{len}])
@paragraph{}

  Returns @var{len} characters of @var{string} starting at the indicated @var{position}.
If @var{len} is omitted all the characters in the string starting at @var{position} are
returned. The first character is in the 0 position.
@paragraph{}

  (substr "hello" 1 3)@*
  Returns "ell".
@paragraph{}

  (substr "hello" 2)@*
  Returns "llo".
@paragraph{}

@c --------------------------------------------------------------

@chapter Calculator

  The calculator inside the editor was made by Laszlo Molnar. Laszlo is a
friend of mine from Hungary and is the author of the great DJP progam (a
djgpp exe's compressor and now UPX, the best EXE compressor in all the
categories).
@paragraph{}
  The sources of the calculator are in the @file{parser.c} file. They are
free and you can use it for any purpose.
@paragraph{}
  Here is the documentation of the calculator written by Laszlo:
@paragraph{}

  The purpose of this program, to provide a simple but powerful
'calculator' for programmers, to help with coding and debugging, where GDB's
expression evaluator is not enough.
@paragraph{}

  You may say "Hey, I can write a better one with @i{flex} and @i{bison}", and you
may be right. I can make a better one too. But it'll be 4-5 times longer!
This calculator is only 10 kbytes of C code. What I think? It's not that bad.
@paragraph{}

  The parser algorithm I use is called 'Operator Precedence Parsing'
(I translated this from Hungarian, so I may be wrong ;-). It
works with 'operator precedence grammars' (a subset of LR(1) grammars),
which means that there can't be two non-terminating tokens next to each other
on the right side of your grammar rules. It's ideal for expression
evaluation.
@paragraph{}

  With this parser you can use numbers, operators, parentheses and functions
like in C.
@paragraph{}

Here are the operators in decreasing precedence:
@paragraph{}

@enumerate
@item
@code{~} unary not
@code{-} unary minus
@item
@code{**} power
@item
@code{*} multiplication
@code{/} division
@code{%} modulo
@item
@code{+} plus
@code{-} binary minus
@item
@code{@lt{}@lt{}} shift left
@code{@gt{}@gt{}} shift right
@item
@code{&} logical and
@item
@code{^} logical xor
@item
@code{|} logical or
@end enumerate
@paragraph{}

  The calculator includes the following functions:
@i{sin\, cos\, tan\, sinh\, cosh\, tanh\, asin\, acos\, atan\, log\, log10\, exp\, abs\,
sqrt\, ceil} and @i{floor}.  They work as you expected.  Additionally the
calculator provides some radix conversion routines: @i{bin\, oct\, dec} and @i{hex}.
@paragraph{}

  The calculator uses doubles, but you can use numbers in the usual integer
formats also: 0x@dots{} for base 16, 0b@dots{} for base 2 and 0@dots{} for
base 8.  The result of the calculation is displayed as a double for base 10,
and converted to long long format for the other radixes.
@paragraph{}

Error codes:
@paragraph{}

@table2{Number,Meaning}
@titem_{-1,yylex()   failed @i{e.g.@:}  \@samp\{1+#\}}
@titem_{-3,yyparse() failed @i{e.g.@:}  \@samp\{1+2)\}}
@titem_{-4,floating point exception @i{e.g.@:} \@samp\{sqrt(-1)\}}
@endtable_{}

@chapter How to contact me
@cindex How to contact me

  If you have any suggestions or bug report contact me at the address shown
in the author section. @x{About the Author}.
@paragraph{}

@section Bugs
@cindex Bugs

  If you find a bug please contact me, the Undo thing is the most complex
one and I know that needs some work on it.
@paragraph{}

  When reporting a bug please don't tell me: Some times some strange thing
happend @dots{} Try to find a pattern to the problem. What situation triggers
the problem? @dots{} with which file(s)? Then send me the file and the description.
@paragraph{}

  When sending to me a file UUEncode it to avoid problems related with the
e-mail.
@paragraph{}

@chapter Miscellaneous

@section Clipboard

The clipboard is just another editor window where you put text using the
@code{Cut} and @code{Copy} commands to then retreive it with the @code{Paste}
command.
@paragraph{}

Unlike the windows clipboard the one provided with the editor doesn't lose
the old contents when you copy to it. This approach have the important
advantage that you can copy text from various parts to the clipboard and then
paste all the text in one place and with just one operation. To do it select
the clipboard window and then select the text to paste, the editor pastes the
text selected in the clipboard window.
@paragraph{}

The disadvantage is that all the texts copied to the clipboard remains there
and if you are running in a machine with low memory and handling huge files
you can fill all the memory. To avoid it check the clipboard size (with
@kbd{Alt+0}) and exit the program if it gets huge. That normally isn't needed
in machines with enough free disk that can be used as swap.
@paragraph{}

@section Time and date modifiers formats

This values are the same used by the @code{strftime} function of the standard
@file{libc}. The editor uses it in the printing module. @x{Print Setup}.
@paragraph{}

@table @code
@item %A
The full weekday name (@code{Friday})
@item %a
The abbreviated weekday name (@code{Fri})
@item %B
The full month name (@code{October})
@item %b, %h
The abbreviated month name (@code{Oct})
@item %C
Short for @code{%a %b %e %H:%M:%S %Y} (@code{Fri Oct  1 15:30:34 1993})
@item %c
Short for @code{%m/%d/%y %H:%M:%S} (@code{10/01/93 15:30:34})
@item %e
The day of the month, blank padded to two characters (@code{ 2})
@item %D
Short for @code{%m/%d/%y} (@code{10/01/93})
@item %d
The day of the month, zero padded to two characters (@code{02})
@item %H
The hour (0-24), zero padded to two characters (@code{15})
@item %I
The hour (1-12), zero padded to two characters (@code{03})
@item %j
The Julian day, zero padded to three characters (@code{275})
@item %k
The hour (0-24), space padded to two characters (@code{15})
@item %l
The hour (1-12), space padded to two characters(@code{ 3})
@item %M
The minutes, zero padded to two characters (@code{30})
@item %m
The month (1-12), zero padded to two characters (@code{10})
@item %n
A newline (@code{\n})
@item %p
AM or PM (@code{PM})
@item %R
Short for @code{%H:%M} (@code{15:30})
@item %r
Short for @code{%I:%M:%S %p} (@code{03:30:35 PM})
@item %S
The seconds, zero padded to two characters (@code{35})
@item %T, %X
Short for @code{%H:%M:%S} (@code{15:30:35})
@item %t
A tab (@code{\t})
@item %U
The week of the year, with the first week defined by the first Sunday of
the year, zero padded to two characters (@code{39})
@item %W
The week of the year, with the first week defined by the first Monday of
the year, zero padded to two characters (@code{39})
@item %w
The day of the week (0-6) (@code{5})
@item %x
Short for @code{%m/%d/%y} (@code{10/01/93})
@item %y
The year (00-99) of the century (@code{93})
@item %Y
The year, zero padded to four digits (@code{1993})
@item %Z
The timezone abbreviation (@code{EDT})
@item %%
A percent symbol (@code{%})
@end table

@section Regular Expressions

The editor supports regular expressions in the search and replace commands,
here is a description of the syntax.
@paragraph{}

Regular expressions (@dfn{RE}s), as defined in POSIX 1003.2, come in two
forms: modern REs (roughly those of @code{egrep}; 1003.2 calls these
@emph{extended} REs) and obsolete REs (roughly those of @code{ed};
1003.2 @emph{basic} REs).  Obsolete REs mostly exist for backward
compatibility in some old programs; they will be discussed at the end.
1003.2 leaves some aspects of RE syntax and semantics open; `(*)' marks
decisions on these aspects that may not be fully portable to other
1003.2 implementations.
@paragraph{}

A (modern) RE is one(*) or more non-empty(*) @emph{branches}, separated
by @samp{|}.  It matches anything that matches one of the branches.
@paragraph{}

A branch is one(*) or more @emph{pieces}, concatenated.  It matches a
match for the first, followed by a match for the second, etc.
@paragraph{}

A piece is an @emph{atom} possibly followed by a single(*) `*', `+',
`?', or @emph{bound}.
An atom followed by `*' matches a sequence of 0 or more matches of the atom.
An atom followed by `+' matches a sequence of 1 or more matches of the atom.
An atom followed by `?' matches a sequence of 0 or 1 matches of the atom.
@paragraph{}

A @emph{bound} is `@{' followed by an unsigned decimal integer, possibly
followed by `,' possibly followed by another unsigned decimal integer,
always followed by `@}'.  The integers must lie between 0 and
@code{RE_DUP_MAX} (255(*)) inclusive, and if there are two of them, the
first may not exceed the second.  An atom followed by a bound containing
one integer @samp{i} and no comma matches a sequence of exactly @samp{i}
matches of the atom.  An atom followed by a bound containing one integer
@samp{i} and a comma matches a sequence of @samp{i} or more matches of
the atom.  An atom followed by a bound containing two integers @samp{i}
and @samp{j} matches a sequence of @samp{i} through @samp{j} (inclusive)
matches of the atom.
@paragraph{}

An atom is a regular expression enclosed in `()' (matching a match for the
regular expression), an empty set of `()' (matching the null string(*)),
a @emph{bracket expression} (see below), `.' (matching any single
character), `^' (matching the null string at the beginning of a line),
`$' (matching the null string at the end of a line), a `\\' followed by
one of the characters `^.[$()|*+?@{\\' (matching that character taken as
an ordinary character), a `\\' followed by any other character(*)
(matching that character taken as an ordinary character, as if the `\\'
had not been present(*)), or a single character with no other
significance (matching that character).  A `@{' followed by a character
other than a digit is an ordinary character, not the beginning of a
bound(*).  It is illegal to end an RE with `\\'.
@paragraph{}

A @emph{bracket expression} is a list of characters enclosed in `[]'.
It normally matches any single character from the list (but see below).
If the list begins with `^', it matches any single character (but see
below) @emph{not} from the rest of the list.  If two characters in the
list are separated by `-', this is shorthand for the full @emph{range}
of characters between those two (inclusive) in the collating sequence,
e.g. `[0-9]' in ASCII matches any decimal digit.  It is illegal(*) for
two ranges to share an endpoint, e.g. `a-c-e'.  Ranges are very
collating-sequence-dependent, and portable programs should avoid relying
on them.
@paragraph{}

To include a literal `]' in the list, make it the first character
(following a possible `^').  To include a literal `-', make it the
first or last character, or the second endpoint of a range.  To use a
literal `-' as the first endpoint of a range, enclose it in `[.' and
`.]' to make it a collating element (see below).  With the exception of
these and some combinations using `[' (see next paragraphs), all other
special characters, including `\\', lose their special significance
within a bracket expression.
@paragraph{}

Within a bracket expression, a collating element (a character, a
multi-character sequence that collates as if it were a single character,
or a collating-sequence name for either) enclosed in `[.' and `.]'
stands for the sequence of characters of that collating element.  The
sequence is a single element of the bracket expression's list.  A
bracket expression containing a multi-character collating element can
thus match more than one character, e.g. if the collating sequence
includes a `ch' collating element, then the RE @samp{[[.ch.]]*c} matches
the first five characters of ``chchcc''.
@paragraph{}

Within a bracket expression, a collating element enclosed in `[=' and
`=]' is an equivalence class, standing for the sequences of characters
of all collating elements equivalent to that one, including itself.
(If there are no other equivalent collating elements, the treatment is
as if the enclosing delimiters were `[.' and `.]'.)  For example, if o
and \o'o^' are the members of an equivalence class, then `[[=o=]]',
`[[=\o'o^'=]]', and `[o\o'o^']' are all synonymous.  An equivalence
class may not\(dg be an endpoint of a range.
@paragraph{}

Within a bracket expression, the name of a @emph{character class}
enclosed in `[:' and `:]' stands for the list of all characters
belonging to that class.
Standard character class names are:
@paragraph{}

@example
alnum	digit	punct
alpha	graph	space
blank	lower	upper
cntrl	print	xdigit
@end example

These stand for the character classes defined by @code{isalnum},
@code{isdigit}, @code{ispunct}, @code{isalpha}, @code{isgraph}
, @code{isspace} (@code{blank} is the same as @code{space}),
@code{islower}, @code{isupper}, @code{iscntrl}, @code{isprint},
and @code{isxdigit}, respectively.  A locale may provide others.
A character class may not be used as an endpoint of a range.
@paragraph{}

There are two special cases(*) of bracket expressions: the bracket
expressions `[[:<:]]' and `[[:>:]]' match the null string at the
beginning and end of a word respectively.  A word is defined as a
sequence of word characters which is neither preceded nor followed by
word characters.  A word character is an @code{alnum} character (as
defined by @code{isalnum} library function) or an underscore.  This is
an extension, compatible with but not specified by POSIX 1003.2, and
should be used with caution in software intended to be portable to other
systems.
@paragraph{}

In the event that an RE could match more than one substring of a given
string, the RE matches the one starting earliest in the string.  If the
RE could match more than one substring starting at that point, it
matches the longest.  Subexpressions also match the longest possible
substrings, subject to the constraint that the whole match be as long as
possible, with subexpressions starting earlier in the RE taking priority
over ones starting later.  Note that higher-level subexpressions thus
take priority over their lower-level component subexpressions.
@paragraph{}

Match lengths are measured in characters, not collating elements.  A
null string is considered longer than no match at all.  For example,
@samp{bb*} matches the three middle characters of @samp{abbbc}, 
@samp{(wee|week)(knights|nights)} matches all ten characters of
@samp{weeknights}, when @samp{(.*).*} is matched against @samp{abc} the
parenthesized subexpression matches all three characters, and when
@samp{(a*)*} is matched against `bc' both the whole RE and the
parenthesized subexpression match the null string.
@paragraph{}

If case-independent matching is specified, the effect is much as if all
case distinctions had vanished from the alphabet.  When an alphabetic
that exists in multiple cases appears as an ordinary character outside a
bracket expression, it is effectively transformed into a bracket
expression containing both cases, e.g. `x' becomes `[xX]'.  When it
appears inside a bracket expression, all case counterparts of it are
added to the bracket expression, so that (e.g.) `[x]' becomes `[xX]' and
`[^x]' becomes `[^xX]'.
@paragraph{}

No particular limit is imposed on the length of REs(*).  Programs
intended to be portable should not employ REs longer than 256 bytes,
as an implementation can refuse to accept such REs and remain
POSIX-compliant.
@paragraph{}

Obsolete (@emph{basic}) regular expressions differ in several respects.
`|', `+', and `?' are ordinary characters and there is no equivalent
for their functionality.  The delimiters for bounds are `\\@{' and
`\\@}', with `@{' and `@}' by themselves ordinary characters.  The
parentheses for nested subexpressions are `\(' and `\)', with `(' and
`)' by themselves ordinary characters.  `^' is an ordinary character
except at the beginning of the RE or(*) the beginning of a parenthesized
subexpression, `$' is an ordinary character except at the end of the RE
or(*) the end of a parenthesized subexpression, and `*' is an ordinary
character if it appears at the beginning of the RE or the beginning of a
parenthesized subexpression (after a possible leading `^').
Finally, there is one new type of atom, a @emph{back reference}:
`\\' followed by a non-zero decimal digit @emph{d} matches the same
sequence of characters matched by the @emph{d}th parenthesized
subexpression (numbering subexpressions by the positions of their
opening parentheses, left to right), so that (e.g.) @samp{\\([bc]\\)\\1}
matches `bb' or `cc' but not `bc'.
@paragraph{}

@section Desktop Files

Each time you run the editor it searchs for a desktop file in the current
directory, if the editor can find any desktop file it searchs in the
directory indicated by the enviroment variable @code{SET_FILES}. If no
desktop files are found the editor uses internal default values. As you can
see creating a desktop file in the @code{%SET_FILES%} directory you'll
indicate default values. To create a desktop file in this directory just
run the editor in the directory, customize it and leave the editor. This
feature is very usefull to customize things like: Colors, Palette, Global
editor options, @i{etc.}
@paragraph{}

When you exit from the editor it saves all the settings, windows positions,
@i{etc.@:} to a desktop file stored in the current directory. Some prople
doesn't like it for this reason there is special mode where the editor
stores just one desktop file in the @code{%SET_FILES%} directory and not
in each directory. This approach have the advantage of saving disk space, but
you don't have local settings. If you use this approarch and want to keep
a local configuration in a directory use a project. @x{Project}. To store
only one centralized desktop file: @x{Editor General}.
@paragraph{}

The destop files have @file{.dst} as extension.
@paragraph{}

@section Text mode attributes

Text modes uses up to 16 colors for forground and 16 colors for background,
that's because the attributes of each character are stored in a 1 byte
allowing just 256 combinations. So four bits are dedicated to the background
color giving 16 combinations and the other four bits for the foreground.
@paragraph{}

As we have only 16 colors there are a big chance that our predilect colors
aren't included. For this reason the VGA chip uses a palette of colors. That
means that these 16 colors aren't fixed and you can indicate what color
is. The values are just index values and you can assign to it any color.
@paragraph{}

The VGA chip supports 18 bits per color giving 262,144 combinations. The
colors are created using the RGB (Red Green and Blue) methode. That's simply
because the CRT (Cathode Rays Tube) of the monitor uses this methode to
create the colors. You have 6 bits per component giving 64 different levels.
@paragraph{}

There are a little more of complexity added to the VGA card. The most
significant bit of the background is used to create blinking text. The editor
avoids this mode because it restricts the background combinations to 8 and
the editor doesn't need blinking text. The other funny thing of the attribute
is the most significant bit of the foreground color. It have an special
meaning even when using it doesn't reduce the number of combinations. That
means that this bit can select two things at the same time. By now you'll be
asking: What? This bit can be used to select a second font, in this way you
can have upto 512 different characters on the screen. The editor can exploit
it but you must understand that this bit is used for the foreground color
too. You can customize the palette to reduce the number of foreground
combinations to 8 just defining the 9th color with the same value as the
0th color and so on. Then you can assign different colors and different fonts
to the things in the editor. You can for example use a font for the menues
and other for the text, or a font for the code and other for the comments.
The editor goes even further allowing different code page encodings for each
font. I really never saw it in any editor. You can use it for example to
write your code using a font with the ISO Latin 1 encoding (used by Linux
and Windows in USA and part of Europe) and have your comments in russian
(using cyrilic characters).
@paragraph{}

To learn how to customize the palette: @x{Color Palette}.@*
To learn how to assign colors to the things used in the editor: @x{Colors}.@*
To learn how to select a font and an encoding: @x{Screen Options}.@*

@section File Open

This dialog is used to select a file in various places. Even when it have
different names and purposes the dialog is ever the same.
@paragraph{}

The dialog is similar to the one used by most of the T/GUI programs so I'll
focus in special details and particularities.
@paragraph{}

All the files and directories are shown together, the directories have a
slash at the end. The current directory and selected file information is
shown at the bottom of the dialog.
@paragraph{}

To select a different disk, in DOS of course, you can simply type the drive
letter followed by a colon in the text input area and press @key{Enter}. You
can specify a mask in the text area too. Even under DOS a single asterisk
matchs with any filename, the *.* mask won't match with a filename that lacks
extension. You can use some asterisk and question marks in the mask, they
work like in most of the shells (DOS command.com included). Additionally the
mask can contain brackets, if your shell doesn't use it and you never used
it here is an example: @code{*.[ch]*} will match with test.c, test.h,
test.cc, test.cpp, @i{etc.@:} the brackets indicates the posible characters
that will match, in this case the first character after the point should be c
or h.@*
Pressing the down arrow while you are in the text input area you'll get a
list of the paths from where you selected files in past. That's very useful
when you load files from two or more directories very differents.
@paragraph{}

The @code{Home} changes the directory to the one from where you started the
editor, that's very useful when you navigate a lot and you want to quickly
return to the directory from where you started.
@paragraph{}

The editor remmembers the last place where you selected a file the last time
you used it. This information is stored in the desktop file. This information
is unique for the following selections: open a file to edit, save a file,
open a help file, save a block of text, open/save a project, open an MP3 file
and save an MP3 file. In this way you can be opening files from a directory
and saving newlly created files to another at the same time without
indicating the directory each time you open/save a file.
@paragraph{}

@subsection Sort of the files and directories in the dialog

By default the sorting criteria is the following:
@paragraph{}

@itemize @bullet
   @item Names sorting is case insensitive.
   @item Directories are listed after files.
   @item The parent directory (@code{..}) is the last entry.
@end itemize

But this can be customized with the @i{File open dialog} menu option. It
brings a dialog with the following options:
@paragraph{}

@itemize @bullet
 @item Sort type: controls how the names are sorted.
 @itemize @bullet
  @item Alphabetical: both, directories and file names, are mixed.
  @item Directories first: the directories are listed first.
  @item Files first: file names are listed first.
@end itemize
 @item Case style: controls if the capital letters are different or not.
 @itemize @bullet
  @item Capital letters goes first: the names are sorting according to the
ASCII table
  @item Case insensitive: the names are sorted lexicographically.
@end itemize
 @item Parent directory: this option controls where is located the parent
directory link (@code{..}). It doesn't affect the @i{Alphabetical} sorting.
 @itemize @bullet
  @item First in the list: the parent is the first entry in the list.
  @item At the end of the list: the parent is the last entry in the list.
@end itemize
@end itemize

Something very important that you must know is how the @key{Shift} key is
interpreted.
@paragraph{}

When the sorting is @i{Alphabetical} and the list is case
sensitive (@i{Capital letters goes first}) the shift key affects the case of
the typed letters so you must be careful, specially with the state of
@key{Caps Lock}.
@paragraph{}

When the sorting isn't @i{Alphabetical} the @key{Shift} have an special
meaning. If you press shift while typing the first letter of the name then
the search will be done in the list of directories instead of the list of
file names. Once you are in one of the list the rest of the searchs are done
in this list. If the list is case sensitive it creates an interesting
conflict because you could need to press shift for some file name and then
the search will be done in the directories list. Don't forget it.
@paragraph{}

@section Message Window
@cindex message window
@cindex windows, message

This window is used to show important information that you could want to have
at hand. Some examples are: the results of a printing operation, the errors
collected from an external program, the hits of the powered grep, the tip of
the day, the output of an external program, etc.
@paragraph{}

The message window doesn't have a number but can be accessed from the list of
windows (usually @kbd{Alt+0}).
@paragraph{}

If the messages are errors or hits from grep you can use @kbd{Alt+F7} and
@kbd{Alt+F8} to quickly jump to the next/previous line. You can also just
select any of the error/hits. This works with the output of any program that
emits line numbers with the GNU convention.
@paragraph{}

You can also delete entries in the message window pressing @key{Delete}. To
add more flexibility the content of the message window can be stored in a
file or copied to the clipboard, to do it just use the menu.
@paragraph{}

@chapter Index

@conindex{cindex.idx,cindex.tdx}

@chapter Index of key commands

@keyindex{kindex.idx,kindex.tdx}

@contents

@bye

