home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crawly Crypt Collection 2
/
crawlyvol2.bin
/
apps
/
text_ed
/
documnts
/
st_emacs.doc
< prev
next >
Wrap
Text File
|
1992-07-19
|
45KB
|
894 lines
Using Emacs 18.58
on the Atari ST/TT
family of
Personal Computers
Scott J. Kolodzieski (1)
(scott@sparc1.stevens-tech.edu)
July 12, 1992
(1) I am greatly in debt to a number of people who have made Emacs
a real winner on the ST/TT. They are Jwahar Bammi, Edgar Roeder,
Michal Jaegermann, Lewis Lasser and many other people in the
ST(internet) community who have given me a great deal of technical
assistance, bug reports, and general suggestions.
Contents
1 Prerequisites 2
2 Introduction 2
3 The Design Philosophy of Emacs 2
3.1 Implementation ...... .......................................... 2
3.2 The "dumping" concept .......................................... 3
4 Installation of Emacs 3
4.1 Required Files and Directories ................................. 4
4.2 Setting the Environment ........................................ 4
4.3 Creating a Dumped Emacs ........................................ 5
4.4 Running Emacs .................................................. 5
5 Customization 6
5.1 Example "emacs.rc" file ........................................ 6
5.2 Hard Key Bindings .............................................. 7
6 Differences from UNIX Emacs 8
7 Advanced ST/TT features 8
7.1 Spawning External commands with output to a buffer ............. 8
7.2 Compilation of source code from within Emacs ................... 8
7.3 Suspending Emacs ................................................ 9
7.4 Dos-Mode files ................................................ 10
8 Changes from previous versions 10
8.1 Since version 18.57 ............................................ 10
9 Suggestions, Comments and Bug Reports 11
10 Wish list for future versions 11
11 References 11
Appendices 12
Appendix I - Unixmode ............................................. 12
Appendix II - Memory Usage ........................................ 13
Appendix III - Disk Space Requirements ............................ 13
Appendix IV - Manual Dumping ...................................... 14
1
1 Prerequisites
This brief document is intended as an introduction to the Emacs
editor, including its installation and usage, on the Atari ST/TT
family of computers. It is written for users who have some
familiarity with ideas and concepts such as Unix, Command Line
Interpreter, Shell, Environment Variables and the like. If you are
not familiar with these concepts then I am afraid that this document
may not be self explanatory.
At the end of this manual there is a brief introduction to the
Unixmode extended file naming convention (Appendix I). It is a good
idea to become familiar with this extension to the Atari filesystem
(it can be very useful), so it is suggested that you read Appendix I
on the Unixmode standard before continuing.
2 Introduction
Emacs is a totally customizable, self documenting editor that was
developed in the mid- seventies by Richard M. Stallman (rms) at MIT.
Because of its extreme flexibility and power it quickly became the
editor of choice at a large number of college and university computing
centers. Over the past two decades Emacs has grown and changed to
adapt to the needs of programmers worldwide. The most popular of the
many versions of Emacs is known as GNU-Emacs, and is freely
distributed by the Free Software Foundation (FSF). GNU-Emacs is
currently at version 18.58, and that is the version that has been
ported to the Atari ST/TT, and is described in this document. From
this point on Emacs will refer to the Atari ST/TT port of GNU-Emacs
18.58. (See the section on changes from previous versions, mainly
version 18.57)
Emacs allows simple editing of files, and much more. One can
simultaneously edit several files, each in separate windows,
manipulate characters, words, lines, and paragraphs all with relative
ease. Emacs also has custom modes that enable programmers to edit
text files containing source code written in any of the more popular
programming languages in a language sensitive manner. It allows the
programmer the flexibility of compiling programs without leaving the
editor, and of having compiler error messages appear, along with the
corresponding source code to a program currently under development, in
a split window environment. If all this is not enough Emacs allows
the user almost infinite flexibility in defining new modes and
commands to customize the editor in any way that one desires. It
should be made clear that, in general, this is not a skill that one
can learn overnight. While the basics of editing in Emacs (it comes
with a tutorial) can be mastered rather quickly, the advanced features
and the customization of Emacs requires serious study of the editor.
3 The Design Philosophy of Emacs
3.1 Implementation
Emacs is implemented using a two tier program structure. The most
fundamental parts of Emacs are written in C, while many of the more
sophisticated editor commands and
2
language-mode extensions are written in "e-lisp". "e-lisp" is a
dialect of the programming language Lisp that is particularly well
suited for data handling. One can argue that Emacs is actually a fast
"e-lisp" interpreter that was designed with the handling of windows
and screens in mind. It is this two tier design philosophy, basic
commands in the C source, and most editor features written in
"e-lisp", that makes Emacs so powerful and easy to extend.
One should not have to modify the C source code to do
customizations, that would necessitate a recompilation of the source
code for the changes to take effect. Instead the run-time loadable
"e-lisp" functions allow for the extension and embellishment of Emacs
without the need to deal directly with the compilation process.
3.2 The "dumping" concept
Many of the more sophisticated commands in Emacs are implemented in
"e-lisp" code and are not part of the actual Emacs source code. For
example the incremental search command of Emacs is nothing but a call
to an "e-lisp" function defined in the "isearch.el" file. Since such
a large part of Emacs, roughly 150k, is external "e-lisp" functions
which are not part of the basic Emacs executable, the loading of these
functions at run-time can take a considerable amount of time and
system resources. For this reason Emacs must be Dumped. This dumping
process need only be performed once during the installation of the
editor.
Dumping is a process where Emacs is run non-interactively, then
after it has loaded all the supporting "e-lisp" code, a complete dump
of the memory occupied by Emacs, and all the "e-lisp" code it loaded,
is written out to disk. Ideally one would like to now be able to
execute this dumped image of Emacs since it contains all the
pre-loaded "e-lisp" code. This is in fact what happens, but with one
small proviso. For technical reasons (the relocation of addresses),
this dumping procedure must be done twice. Then the two resulting
memory images will be compared to produce a executable Emacs that has
all the required "e-lisp" code built into it. This at first may seem
like a rather sizable task for the installation of an editor, but it
is a small price to pay for the host of advanced features that are
available in Emacs. With the Atari ST/TT version of Emacs come two
support programs that actually make this dumping process almost
effortless for the end user. Instructions on how to use these
programs to produce a working dumped Emacs are found in the next
section "Installing Emacs".
4 Installation of Emacs
This section will lead you through all the steps needed to get a
working, dumped Emacs up and running on the Atari ST/TT. Once again I
suggest you read the appendix on the Unixmode standard since I will
use many of its features in the following examples and descriptions.
[Note: the two main Unixmode features that I use are: (1) the use of
"/" instead of "\" as a directory separator, and (2) the use of /dev/X
instead of X: to reference drive X.]
3
4.1 Required Files and Directories
Emacs uses three subdirectories to store all of its related files. I
shall call these directories e-bin/, e-lisp/, and e-etc/ in this
manual. In the next section you will see how to name these
directories in environment variables so they can be rooted on any
filesystem (drive) and have whatever names you choose.
o e-bin/ - This directory holds the undumped raw Emacs
executable file called "temacs". The two support files
"dumpemac.ttp" and "dumpfix.ttp", that are only used in the
dumping process, are also stored here.
o e-lisp/ - This directory and it subdirectories, e-lisp/term/
and e-lisp/st/, hold all the "e-lisp" code that defines both
the basic and advanced features found in the Emacs editor.
It should be noted that some of the files in this directory
are only used in the dumping of Emacs but others are loaded
and used in the normal execution of the dumped Emacs image.
If you are short on disk space some of these "e-lisp" files
may be deleted (see Appendix III-Disk Space Requirements).
o e-etc/ - This directory holds the on-line Emacs
documentation file along with a number of other document
files and utility programs for document generation.
It should be noted that the binary distribution of Emacs 18.58
contained in the distribution archive "1858b-d3.zoo", has the above
directory structure built into it, and all files will be placed in the
correct directories if extracted with the command "zoo -extract
1858b-d3.zoo".
4.2 Setting the Environment
Essential Environment Variables
o EMACSLOADPATH = <full path to e-bin/ directory>
o EMACSLIB = <full path to e-lisp/ directory>
o EMACSDOC = <full path to e-etc/ directory>
o HOME = <full path to users home directory>
o UNIXMODE = .,/LAHdb
Optional Environment variables
o TERMCAP = <full path to termcap file>
o TERM = <an entry in the above termcap file>
4
The reason that the TERM and TERMCAP variables are optional is
that Emacs, by default, has a built-in vt52 terminal description that
was designed to work with the Atari. However, if you like, you can
set these variables to use your personal terminal descriptions, a
feature which can be rather useful for the advanced user. There is a
sample termcap file distributed with Emacs (directory examples/) to
serve as an example of some of the possible customizations.
As an example, I use the following environment variable setting
on my system. In fact they are set in my login script under Bash so
that whenever I enter my shell Emacs is ready to go.
EMACSLOADPATH=/dev/D/gnu/e-bin
EMACSLIB=/dev/D/gnu/e-lisp
EMACSETC=/dev/D/gnu/e-etc
TERMCAP=/dev/C/etc/termcap
TERM=vt52
UNIXMODE=/.,rCLAHdb
HOME=/dev/F/usr/sjk
4.3 Creating a Dumped Emacs
Please now read Appendix II on memory usage so you can determine an
appropriate stack size for your dumped Emacs. The stack size may be
altered before dumping.
Once the correct environment variables are set, it is very easy
to create a dumped version of Emacs. Just change to the directory
e-bin/ and run the program "dumpemac.ttp". This program will do the
two dumps of Emacs then call "dumpfix.ttp", which must also be in this
directory, to produce a fully functional executable version of Emacs.
After "dumpemac.ttp" is finished there will be three new files in
your binary directory, "emacs.ttp", "xemacs.1", and "xemacs.2". The
latter two may be deleted as they were created by the dump procedure
and are no longer needed. The file "emacs.ttp" is the fully
functional Emacs executable.
4.4 Running Emacs
The HOME environment variable must be set in order for Emacs to find
its default customization file. Whenever Emacs is executed it
attempts to load and execute the user customizations found in the file
"$HOME/emacs.rc". In the directory examples/ is a sample "emacs.rc"
file that should be copied into your home directory before you execute
Emacs. See the section on customization for more information
concerning the contents of the "emacs.rc" file.
It should be mentioned that the ".rc" in "emacs.rc" stands for
"read commands" and is a subject of Unix folklore. Also it is
possible do customizations in a slightly different place. If there is
a file called "e-lisp/default.el", then any commands contained in this
file will be executed as soon as Emacs starts and before "emacs.rc" is
read. The difference
5
between the two methods is that with the "emacs.rc" one has slightly
more control over the customizations in that one may have several
"emacs.rc" files in different directories and choose the one to load
before executing Emacs by setting the HOME environment variable to
point to the correct place.
Now all you have to do is execute the file "emacs.ttp" and you
should be set. I usually create an alias in my shell of the form
"alias emacs=/dev/D/gnu/e-bin/emacs.ttp" so that I do not have to add
the e-bin/ directory to my path. As an alternative, you can copy
"emacs.ttp" into a directory you have in your shells PATH environment
variable, or add the e-bin/ directory to your path.
NOTE: I have not tried to run "emacs.ttp" from the desktop
directly, nor do I ever intend to try this. It should work if all the
correct environment variables are set, however I make no promises or
guarantees.
5 Customization
There is a complete description of all the "e-lisp" commands that are
available for customization of the editor along with a description of
the internal workings of the "e-lisp" interpreter in a 500+ page
"Emacs Lisp Reference Manual" that is available from the public
internet site prep.ai.mit.edu. Also at this site is the raw (non
ST/TT specific) source code to Emacs and a "Emacs Users Manual".
There are several ST/TT specific "e-lisp" functions that have
been written to take advantage of certain facets of the Atari ST/TT.
These ST/TT specific extensions are covered in the section on advanced
features, however simple customizations may be done in the "emacs.rc"
file. Most often these customizations take the form of simple key
bindings. Let us look at a sample "emacs.rc" file before discussing
key bindings any further.
5.1 Example "emacs.rc" file
;; emacs.rc -- initialization file for gnu-emacs
;;
(setq default-major-mode 'text-mode) ; major mode is text mode
(setq ctl-arrow "dummy") ; non-nil for 8 bit chars
(setq meta-flag 't) ; Allow <alt> to be <meta>
(load "/dev/D/gnu/e-lisp/term/atari.el") ; define function keys
(load "/dev/D/gnu/e-lisp/st/dos-mode.el"); load messy-dos-mode
;; define utility functions
;;
(defun toggle-dos-mode () ; used in binding of DOS mode to F10
(interactive)
(setq dos-mode (not dos-mode))
(set-buffer-modified-p (buffer-modified-p)))
6
(defun display-mem ()
(interactive)
(message "Memory usage: %d bytes free, %d bytes used (%d%%)"
data-bytes-free data-bytes-used
(/ (* data-bytes-used)
(/ (+ data-bytes-used data-bytes-free) 100))))
;; Do keyboard binadings, Must be done after term/atari is loaded
;;
(define-key function-keymap "\C-a" 'display-mem) ; F1 key
(define-key function-keymap "\C-b" 'goto-line) ; F2 key
(define-key function-keymap "\C-c" 'what-line) ; F3 key
(define-key function-keymap "\C-j" 'toggle-dos-mode) ; F10 key
(define-key function-keymap "I" 'overwrite-mode) ; Ins key
Unless one is familiar with the Lisp programming language then
most of the preceding file will not make much sense. However one
important part of this file is the binding of arbitrary commands to
the function keys. This will be discussed in the next section.
5.2 Hard Key Bindings
In this section we will discuss how hard keys, i.e. the function keys,
arrow keys and right keypad keys, may be easily bound to any command
available in Emacs.
The first thing to do is to examine the file
"e-lisp/term/atari.el", which is autoloaded by the sample "emacs.rc"
file. In this file the only important thing to note is the one
character code that is assigned to each hard key. The code is the
character following the ? in the section that starts with the command
"setup-terminal-keymap st-map". An excerpt from this file looks likes
this:
(setup-terminal-keymap st-map
'(("H" . ?u) ; up arrow
("P" . ?d) ; down-arrow
("M" . ?r) ; right-arrow
("K" . ?l) ; left-arrow
("G" . ?h) ; Home
...
(";" . ?\C-a) ; F1
("<" . ?\C-b) ; F2
...
("\C-r" . ; C-Insert -> insert line key
("R" . ?I) ; Insert
("\C-p" . ?N) ; C-downarrow -> next page key
("\C-h" . ?P) ; C-uparrow -> prev page key
("a" . ?U))) ; Undo
Note that the entry for the Insert key is ("R". ?I) so the
assigned code (It is an internal Emacs code), is "I".
Secondly we will examine an excerpt from the "emacs.rc" file. At
the bottom of the file you will see some code that looks like:
7
(define-key function-keymap "\C-a" 'display-mem) ; F1 key
(define-key function-keymap "\C-b" 'goto-line) ; F2 key
(define-key function-keymap "\C-c" 'what-line) ; F3 key
(define-key function-keymap "\C-j" 'toggle-dos-mode) ; F10 key
(define-key function-keymap "I" 'overwrite-mode) ; Insert key
These (define-key ... ) statements are used to bind Emacs
commands to hard-keys. The general syntax for a command of this form
is:
(define-key function-keymap "<internal code>" 'command)
The sample from "emacs.rc" given above shows five examples of bindings
of this sort. So to bind a key add a line to the bottom of the
"emacs.rc" file with the correct values for the internal code and the
command.
The general rule for customizations is, "Get the E-Lisp Reference
Manual", read, and experiment. The manual contains a vast wealth of
useful commands and is essential for any serious and nontrivial
customizations.
6 Differences from UNIX Emacs
The only real difference between Emacs running on a Unix based system
and one running on the the Atari ST/TT is the lack of support for
asynchronous processes. This means that Emacs cannot start a process
(another program) and do input and output with the process at the same
time. The Atari ST/TT version of Emacs can, however, start an
external process and receive output from it, optionally placing this
output in an Emacs buffer. This will be elaborated in the next
section on advanced features. Also it may be noted that the default
cutomization file "emacs.rc" is called ".emacs" on Unix systems. The
name was changed to make it TOS conformant.
7 Advanced ST/TT features
There are several advanced features of Emacs that have been shaped
into a more Atari friendly form. For Emacs to take advantage of these
features one must use the "e-lisp" files that are distributed with
this Atari ST/TT port of Emacs. There have been numerous changes and
additions to the standard "e-lisp" files that come with the raw FSF
version of Emacs. Also, several "e-lisp" files have changed since my
last port of Emacs 18.57 for the Atari ST/TT, so be sure to install
the "e-lisp" files that come in the distribution archive
"1858b-d3.zoo".
7.1 Spawning External commands with output to a buffer
This is done via the "M-x shell-command" command. After typing "M-x
shell-command <return>" you will be prompted for a command to execute
in an inferior shell. An example of a command might be "ls -la
<return>". After doing this, Emacs should launch the command in the
inferior shell, and when the command has finished, put all of its
output
8
into a Emacs buffer named "*Shell Command Output*". A requirement for
this feature to work is that you set the environment variable SHELL to
be the full path, including file name, of a valid command line
interpreter. I personally use the command:
export SHELL=/dev/D/gnu/bin/bash.ttp
The power of executing shell commands from within Emacs should
not be underestimated. The only thing that you must be aware of is
that the command that you execute should not require any interactive
input or Emacs will become terminally confused.
7.2 Compilation of source code from within Emacs
This feature is most useful if you have at least four megabytes of
memory and do a lot of programming in C. There is a command for
compiling a C program that you are currently working on in Emacs. The
beauty of this is that not only do you not have to leave the editor
but Emacs will put all compilation error messages on the bottom of the
Emacs screen while the source code to your program resides in the
upper portion of the screen. In addition, there is also a command
that examines the errors reported by the C compiler and places the
cursor on the offending line in your source code. All of this is best
illustrated by an example.
First make sure your shell is set up correctly so that the
compiler would run in a normal fashion if invoked from the shell.
This usually involves correctly setting certain environment variables.
Now suppose that you are editing a a C program called "test.c"
and you want to compile it from within Emacs. Just type the command
"M-x compile <return>" and you will be prompted by a line of the form:
Compile Command: gcc
Just type the command line to "gcc" that you would type from your
SHELL, e.g. "Compile Command: gcc -o test test.c -lpml <return>". This
should immediately create a new window that states that the
compilation is in progress. When compilation is complete, the new
window will either contain the error messages generated by the
compiler, or a message saying that compilation was successful. In the
former case the cursor will be left on the offending line in the
source window. To move to the next error use the command "M-x
next-error".
At the "Compile Command: gcc" prompt one can delete the "gcc"
part and instead type "make" if that option is required.
7.3 Suspending Emacs
If your SHELL environment variable is correctly set to a valid command
line interpreter, Emacs may be temporarily suspended at any time
during editing by simple hitting the "^z" key. This will launch a new
copy of your shell and leave you in it. You may operate in this
subshell for as long as you want, then simply exit the shell to return
to Emacs.
9
7.4 Dos-Mode files
Many people in the Atari ST/TT community use text files that use
<cr><lf> as line terminators instead of the Unix standard <lf>. There
is a compatibility mode that allows almost effortless conversion
between the two modes. In the "emacs.rc" file that comes with this
distribution of Emacs there is a file called "dos-mode.el" that is
always loaded on startup. This file supports an automatic detection
of files that are line delimited by <cr><lf> and sets up Emacs to
handle such files in a transparent manner. If you load such a file it
will look normal in the editor window, but in the Emacs status line on
the bottom of the screen you will see the word DOS. It is possible to
manually force a file to be written with <cr><lf>'s as end of line
delimiters by entering DOS mode manually once the file is loaded into
Emacs. There is a convenient key binding in the distributed
"emacs.rc" file that does this, the binding is "F10", and this
function key toggles between standard and DOS modes.
8 Changes from previous versions
Since this document describes Emacs version 18.58, I will enumerate
the major differences from previous versions. For the technical
details on the changes made to the C source code, get the source
distribution archive and read the file "chng-log" from the source code
directory. For changes in the "e-lisp" code see the file
"e-lisp/chng-log".
8.1 Since version 18.57
o Screen update speed has been improved by a factor of three.
o Much improved memory management. This includes Emacs
tracking used and available memory and reporting warnings to
the user at the 75, 85, and 95 percent used levels.
o All support files found in the e-lisp/ directory, have had
their names truncated to meet the 8.3 specifications of the
Atari file system. This should ensure that Emacs runs even
if Unixmode is not active.
o A bug has been fixed where spawned external commands that
wrote to stderr were not being redirected properly.
o Support for "M-x compile" and "M-x grep" commands, along
with general support for launching external programs
directly, without the need for an interactive shell. See
the support files "e-lisp/st/compile.el" and
"e-lisp/st/process.el" for in depth information.
o Switch Termcap support from Emacs internal routines to
"termcap.olb" that comes with the port of Gnu C for the
Atari ST/TT. This has the advantage of having a default
termcap entry built in. Also this termcap library supports
termcap files that have either <lf> or <cr><lf> as line
delimiters.
10
o Paths in all environment variables may now be specified in
either of the two formats, X:\<path> or /dev/X/<path>.
o When Emacs launches external executables it now searches for
the files along the PATH environment variable and checks for
files with the standard Atari ST/TT extensions (".ttp",
".tos", and " .prg").
o The custimation file ".emacs" has been renamed to "emacs.rc"
for TOS file name compatibility.
9 Suggestions, Comments and Bug Reports
I will entertain most suggestions and comments that are not of the
form: "Emacs should more fully support the special features of MiNT.".
A fully MiNT and Unixmode aware version of Emacs would be ideal, thus
this is the direction that this port will most likely move in. However
there is no rush for me to do this, as this version of Emacs works
perfectly under MiNT, although there is no support for MiNT's ability
to handle asynchronous processes.
Please send me a report on any bugs that you find. If it is
truly a bug and not a feature then I will do my best to fix it. I
find Emacs to be very stable. I use it extensively for program
development, text entry and even some lisp programming and find that
it is relatively easy to use and customize.
10 Wish list for future versions
o Make Emacs run in TT-ram. It is a puzzle to me why this
does not currently work. I will however continue to look
into this and hopefully have a solution in the not so
distant future.
o Add some sort of mouse support to Emacs on the Atari. This
should not be too hard, but I am not so sure as to what the
mouse buttons should do? Any comments would be appreciated.
o Make Emacs auto detect MiNT, thus do the right thing when
the multitasking kernel is loaded but remain backward
compatible to plain TOS. Note that keeping Emacs Unixmode
aware is a big plus in my eyes.
o Get a TeX mode up and running. It would be easy if one
could run TeX with a switch that only prints errors and does
not stop for input on errors.
11 References
The following references may prove helpful:
o "GNU Emacs Manual, Sixth Edition, Version 18 for Unix Users",
February 1988, Richard Stallman.
11
o "Emacs Lisp Reference Manual, Version 18 for Unix Users",
June 1989, Edition 0.1 beta, Bil Lewis, Dan LaLiberte, and
the GNU Manual Group.
o "Reference Card for GNU Emacs Version 18 on Unix Systems", 1987,
Stephen Gildea.
Appendices
Appendix I - The Unixmode standard
Because the native TOS operating system on the Atari ST/TT limits the
naming of files to a maximum of 11 characters, (an 8 character file
name, followed by a `.', then an optional 3 character extension), a
software extension to this file system has been implemented in the Gnu
C run time support library (hereby referred to as the RTL). What this
amounts to is the following, when a program that has been compiled
with the RTL is executed, the C startup code checks the system for the
presence of an environment variable named Unixmode. If found, it then
modifies the standard C file/directory functions based on the contents
of the Unixmode environment variable. The Unixmode environment
variable may contain a series of characters, each character (or
sequence of characters) indicates how the standard C file/directory
functions are modified. A complete specification of the Unixmode
environment variable looks as follows : UNIXMODE="/.<x>r<y>LAHdb"
where <x> and <y> represent single characters. The meanings of these
options are described briefly in the following table.
_________________________________________________________________________
| character sequence | meaning |
|_______________________|_______________________________________________|
| / | allow / or \ to separate subdirectories.|
|_______________________|_______________________________________________|
| .<x> | use <x> as replacement for `.' in filenames |
| | with more than one `.' in their name. |
|_______________________|_______________________________________________|
| r<y> | use <y> as the root drive. |
|_______________________|_______________________________________________|
| L | allow symbolic links. |
|_______________________|_______________________________________________|
| A | allow auto creation of links. |
|_______________________|_______________________________________________|
| H | hide the special `.dir' file. |
|_______________________|_______________________________________________|
| d | allow /dev/<x> in addition to <x>: |
|_______________________|_______________________________________________|
| b | open files in binary mode |
|_______________________|_______________________________________________|
A few points should be made before continuing with our discussion
of the Unixmode extension. First, all of these options need not
always be set. One usually just picks the extensions that are
required, puts the relevant characters into the Unixmode variable and
then executes the desired program. Of course there is no harm in
setting Unixmode once, with all possible options. In fact one can set
up Unixmode for maximum Unix compatibility and forget about it. The
second point that should be made is that the entire Unixmode standard
is implemented in software, It is only an extension to the high level
i/o subsystem of the C runtime library. The TOS level bios/gemdos
calls do not know about the Unixmode extensions! This is not a
problem as Emacs 18.58 is fully Unixmode
12
aware. This port of Emacs will create/edit long file names, and
follow Unixmode symbolic links with no difficulty. However for ease
of installation all file required by Emacs have been renamed in a
consistent manner so they conform to the ST/TT's native 8+3 file
naming requirement.
The above options are best described by an example. Suppose
Unixmode is set to the string "/.,rCLAHdb", before one starts some
program compiled with the RTL. That program may now use extended file
names, even those with multiple occurrences of the "." character, the
RTL will do the necessary file name conversions to keep TOS happy.
Because of the presence of the "/" character one may refer to files as
"c:\path\foo" as "c:/path/foo", also because of the "C" following the
"r", "C:" was selected as the root drive, thus the above path could
even be abbreviated as "/path/foo". The presence of the "d" character
in the Unixmode variable allows one to access drive <X> as /dev/<x>/
instead of the more conventional X:\.
For the other options that are not described in the above example
I refer you to the documentation that comes with the RTL source code.
This source is freely available from atari.archive.umich.edu
Appendix II - Memory Usage
Emacs is big. There is nothing that can be done about that. There is
absolutely no hope of running it in 512k of ram. One megabyte is the
absolute minimum memory configuration. The executable is 550k and may
eat up between 128k and 3500k in additional space depending on the
memory configuration you choose.
The raw undumped "temacs" executable is set to have a 512k stack
space. If nothing fancy is being done in Emacs this should be
adequate and it can be left unmodified. If you like you may use the
program "fixstk.ttp" distributed with Emacs to change the stack size
before you create your dumped version. The format for this command
is:
fixstk <xxx>k temacs
Where <xxx> iws a number between 128 and 3500 representing the size
(in k) of the stack. There is also the option of setting <xxx> to -1
thus telling emacs to use all the available memory for its stack when
it is run. This option (-1), does not allow any process creation to
be done by Emacs so most of the items in the section on Advanced
Features will not work. I personally suggest a stack size of 512k, if
you have at least two megabytes of ram.
There is a memory tracking feature built into Emacs. It will
provide warnings to you if, in the course of editing a large document,
you use up the majority of the working memory. The warnings are
issued at the 75, 85, and 95 percent used levels. If you get one of
these warnings follow the instructions printed on the screen.
Also in the distributed "emacs.rc" file the <F1> is bound to a
command that displays the amount of memory available and the amount
used. This can be an invaluable tool.
13
Appendix III - Disk Space Requirements
The distribution file "1858b-d3.zoo" when unpacked, expands to roughly
two and a half megabytes on disk. The whole installation process
requires approximately another one and a half megabytes, but most of
that is reclaimed after the installation is complete (in the instal-
lation section it is mentioned that some files can be deleted after
the run of "dumpemac.ttp").
If you do not have enough free space then you may be forced to
prune back the number of "e-lisp" files in the "e-lisp/" directory.
First delete any files named "<something>.elc" that have a
corresponding "<something>.el" version also. The ".elc" version is a
byte compiled version of the ".el" files. They are functionally
equivalent, but the ".elc" loads and executes a bit faster. As a note
any ".el" can be used to produce a byte compiled version ".elc" from
within Emacs by using the "M-x byte-compile-file" command. If you
still do not have enough space, then read the next appendix on
manually dumping Emacs.
Appendix IV - Manual Dumping
This appendix is to help out those who are really tight on disk space.
The process of dumping Emacs, as described in the body of this
document, makes use of a program called "dumpemac.ttp". This program
is called two times, each time reading in the file "temacs" and
producing a file called "xemacs.<x>", where <x> is either a "1" or a
"2" depending on which dump it is doing. After "dumpemac.ttp"
finishes producing these two memory dumps, it calls a program called
"dumpfix.ttp" that reads in the two memory dumps, "xemacs.1" and
"xemacs.2" to produce the final executable file "emacs.ttp". The only
problem with using "dumpemac.ttp" is that it requires an additional
one and a half megabytes of storage (roughly 600k for "xemacs.1" and
"xemacs.2" and a little less for "emacs.ttp") in order to create
Emacs.
It is possible to dump Emacs manually with as little as 700k of
free space on your hard disk, however one must perform all the above
steps manually. Here is an outline of how to do proceed:
1. Change directory to "e-bin/".
2. Execute the command ".\temacs -batch -l loadup.el dump",
this will produce a file roughly 600k in size called
"xemacs".
3. Rename the file "xemacs" to "xemacs.1" and place it on a
blank diskette. It may now be deleted from your hard disk.
4. Start a new copy of whatever shell you are using. Yes, this
sounds strange, but you must do it.
5. Repeat step 2, producing another "xemacs" file.
6. Rename the file "xemacs" to "xemacs.2". You should now move
the file "temacs" to another blank disk as it is not needed
any more. It is not a good idea to delete the file "temacs"
as you never know when you may want to again dump an Emacs.
14
7. Now exit from the second shell you started in step 4.
8. Execute the command ".\dumpfix -n a:\xemacs.1 xemacs.2
emacs.ttp". This will produce a fully dumped version of
Emacs called "emacs.ttp".
9. Remove the file "xemacs.2" from you hard disk, and now you
are done.
10. Go to the store and buy a larger hard disk.
15