Mode Assistant Help
Name: | Mode Assistant |
Version: | 1.0 |
Last update: | 2019-10-17 13:29:10 |
Introduction
The Mode Creation Assistant is an interface to assist you in
creating a new mode for Alpha. Through a series of screens, it asks you to
provide some information about your mode and then it generates the
appropriate code in a file. The file is installed in the right location so
that Alpha can automatically recognize and handle the new mode.
Once the file is created, you have a basis for introducing more
functionalities in your mode if you wish. The idea is that you have a
starting point for further development. You can edit the file later and
make any changes you like.
In order to launch the Mode Creation Assistant, select the
Alpha ↣ Global Setup ↣ Create New Mode menu
item.
User interface
This section describes the successive panels of the Mode Creation
Assistant window. The only required information is the name of your
mode. All the rest can be left blank and edited later.
All the panels have Next and Previous buttons to
navigate forwards or backwards respectively. At any point, you may display
a panel again and make changes.
The Welcome screen
In this panel you enter the name of the mode.
It must be 1-4 characters long string without spaces.
You also enter the file patterns used for this mode, separated by
spaces. For instance, if your mode is associated with files having the
.xyz extension, you specify the file pattern as *.xyz
.
Whenever Alpha encounters a file with these extensions/patterns, it will
automatically use your mode. You may enter as many such patterns as you
like. Note the extensions are case-sensitive.
The Identity screen
In this panel you may enter some information about the mode's
maintainer, a contact e-mail and possibly a web site.
The Mode Help screen
In this panel you enter a help text about the mode. You may leave it
as is to serve as a placeholder and edit the help information later. This
information will be offered to users when they access Help for your
new mode.
The Mode Menu screen
If you want a menu to be attached to your mode, this screen will help you
declare it. The assistant will make all the necessary declarations so that
the menu is properly related to the mode: later, when a document is opened
in the new mode, the corresponding menu will automatically be inserted in
the menu bar.
An application may also be specified here in case your mode is
related to some external software.
In that case, Alpha proposes to insert two menu items:
- Switch To appName
- Send Window To appName
where appName is the name of the associated application. For
example, when editing .html files, it is convenient to have a menu
containing commands to send the current .html window to your web
browser.
Additionnally, the mode assistant will insert a menu item called Some Command to serve as a placeholder. You may later edit your file
and change this command, add others etc.
The Keywords screen
In this panel you specify a list of keywords associated with your
mode. This is used for syntax coloring. These are the words which will be
recognized by Alpha and be colored.
The Comments screen
In this panel you specify symbols which should be considered as
comment characters for your mode. For example C++ and Java have //
for a single line comment, and /* */
for multi-line comments.
The Wrap And Mark screen
In this panel you may specify some regular expressions that will be
used to populate the Parse Functions popup menu. For more
information about these expressions, see The Parse Functions popup menu in the file Extending Alpha.
The Confirmation screen
In this final panel you may press the Create New Mode button
to have Alpha generate the file containing the Tcl instructions that will
define the new mode. This terminates the mode creation. At this point, the
window is deleted and your settings are not recorded.
On the contrary, if you press the Cancel button, the Mode Creation Assistant window is closed but all your settings are
recorded. If you select the Alpha ↣ Global Setup ↣ Create New Mode menu item, the window will be displayed again with
all your previous settings.
The new mode file is located in the Modes subfolder of the user's
Application Support folder.
Known problems
Please report any problem or bug you encounter to
Alpha's Bug Tracker.
License and Disclaimer
Copyright (c) 2000-2019, the Alpha Community.
All rights reserved.
The modeAssistant package is free software and distributed under
the terms of the new BSD license:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- Neither the name of the Alpha Community nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ALPHA COMMUNITY BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
This document has been placed in the public domain.