home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 2
/
FFMCD02.bin
/
useful
/
lib
/
emacs
/
18.59
/
etc
/
diff
< prev
next >
Wrap
Text File
|
1988-08-17
|
31KB
|
780 lines
How is this Emacs different from all other Emacses? -*-Outline-*-
(Actually, from Twenex Emacs)
* Copyright (c) 1985 Richard M. Stallman
Permission is granted to anyone to make or distribute verbatim copies
of this document as received, in any medium, provided that the
copyright notice and permission notice are preserved,
and that the distributor grants the recipient permission
for further redistribution as permitted by this notice.
Permission is granted to distribute modified versions
of this document, or of portions of it,
under the above conditions, provided also that they
carry prominent notices stating who last changed them.
* Fundamental concepts.
** There is no concept of "typeout" in GNU Emacs.
Any time that a command wants to display some output,
it creates a buffer (usually with a name surrounded by asterisks)
and displays it in a window.
This provides some advantages:
you can edit some more while looking at the output;
you can copy parts of the output into other buffers.
It also has a disadvantage that you must type a command
in order to make the output disappear.
You can use C-x 1 to get rid of all windows except the
selected one. To be more selective, you can switch to
the window you want to get rid of and then type C-x 0
(delete-window).
You also need to type a command to scroll the other
window if not all the output fits in it. Meta-Control-v
will usually do the job.
** There is no concept of a "subsystem" in GNU Emacs.
Where Twenex Emacs would use a subsystem, GNU Emacs
instead creates a buffer and redefines commands in it.
For example, when you send mail in GNU Emacs, you use
a buffer named *mail* which is in Mail Mode. You can
switch away from this buffer to any other buffer and
resume normal editing; then switch back and resume
composing mail. You do not have to "exit" from
composing mail in order to do ordinary editing.
This has many advantages, but it also has a disadvantage:
Subsystems in Emacs tend to have "exit" commands that return you
to whatever you were doing before entering the subsystem.
In GNU Emacs the idea of what to return to is not well defined,
so it is not clear what an "exit" command should do.
The only way to "exit" in general is to type C-x b, C-x C-f, or
some other suitable command to switch buffers. Some
subsystem-like major modes, such as Info and Mail mode, provide
commands to "exit" by switching to the previously selected
buffer.
** Files are always visited in their own buffers.
Beginning users of Twenex Emacs were told how to edit
using a single buffer and reading one file after another
into that buffer. Use of a new buffer for each file was
regarded as a more advanced mode.
In GNU Emacs, the idea of using a single buffer for various
files, one by one, has been dropped, given that the address
space is expected to be large enough for many buffers. C-x
C-f (find-file), which behaves nearly the same as in Twenex
Emacs, is in GNU Emacs the canonical way for all users to
visit files.
Various commands need to read files into Emacs in the course
of their execution. In Twenex Emacs the user must tell them
whether to reuse buffers or create new ones, using the variable
Tags Find File. In GNU Emacs, these commands always use
C-x C-f.
The command C-x C-v does still exist; it kills the current
buffer and reads the specified file into a new buffer.
It is equivalent to kill-buffer followed by find-file.
Since there is no reusing of buffers, there is no point in
calling the initial buffer "main". So the initial buffer
in GNU Emacs is called "*scratch*" and is intended for typing
Lisp expressions to be evaluated.
** File name defaulting.
GNU Emacs records a separate working directory for each buffer.
Normally this is the directory on which the buffer's file
resides; for buffers not visiting any file, it is copied from
the buffer that was current when it was created. The current buffer's
working directory can be printed with M-x pwd and set with M-x cd.
GNU Emacs shows you the default directory by inserting it in
the minibuffer when a file name is being read. You can type
the filename you want at the end of the default as if the
default were not there, or you can edit and alter the default.
If you want file /lose/big when the default /foo/defaultdir/
has been inserted for you, you need not kill the default; simply
type at the end of it: /foo/defaultdir//lose/big. Such a file
name is not ordinarily considered valid, but GNU Emacs
considers it equivalent to /lose/big.
Likewise, if you want file quux in your home directory, just add
~/quux to the end of the supplied text, to get
/foo/defaultdir/~/quux. GNU Emacs sees "/~" and throws away
everything before the "~".
You can refer to environment variables also within file names.
$ followed by the environment variable name is replaced by the
variable's value. The variable name should either be followed
by a nonalphanumeric character (which counts as part of the
file name) or be surrounded by braces {...} (which do not count
as part of the file name). Thus, if variable USER has value "rms",
"x/$USER-foo" is expanded to "x/rms-foo", and "x${USER}foo"
is expanded to "xrmsfoo". Note that this substitution is not
performed by the primitive file operation functions of GNU Emacs,
but rather by the interactive file name reader. It is also
available as a separate primitive, in the function
substitute-in-file-name.
** Exit commands C-z, C-x C-c and C-x C-z.
There are two ways to exit GNU Emacs: killing and suspending.
Killing is like what Control-c does to ordinary Unix programs.
In GNU Emacs, you type C-x C-c to kill it. (This offers to
save any modified file buffers before really killing Emacs.)
Suspending is like what Control-z does to ordinary Unix programs.
To suspend GNU Emacs, type C-x C-z, or type just C-z.
Note that C-z suspends ordinary programs instantly, but
Emacs does not suspend until it reads the C-z.
Usually it is better to suspend: once a system is smart
enough to have job control, why ever kill an editor?
You'll just have to make a new one in a minute.
This is why the convenient command C-z is provided for
suspending.
C-c is used as a prefix key for mode-specific commands and for users'
own commands. We deliberately do not make C-c ever kill Emacs,
because it should not be so easy to do something irreversible.
** Quitting with C-g.
If you type C-g while GNU Emacs is waiting for input, it
is an ordinary command (which is defined to beep). If you
type C-g while Lisp code is executing, it sets a flag which
causes a special signal, nearly the same as an error, to
happen atthe next safe place in Lisp execution. This usually
has the effect of aborting the current command in a safe way.
Because at times there have been bugs causing GNU Emacs to loop
without checking the quit flag, a special feature causes
GNU Emacs to be suspended immediately if you type a second C-g
while the flag is already set. So you can always get out
of GNU Emacs. Normally GNU Emacs recognizes and clears the quit flag
quickly enough to prevent this from happening.
When you resume GNU Emacs after a suspension caused by multiple C-g, it
asks two questions before resuming execution:
Checkpoint?
Dump core?
Answer each one with `y' or `n' and a Return.
`y' to Checkpoint? causes immediate auto-saving of all
buffers in which auto-saving is enabled.
`y' to Dump core? causes an illegal instruction to be executed.
This is to enable a wizard to figure out why GNU Emacs was
looping without checking for quits. Execution does not continue
after a core dump. If you answer `n', execution continues.
With luck, GNU Emacs will ultimately check the quit flag,
and quit normally. If not, and you type another C-g, it
is suspended again.
If GNU Emacs is not really hung, just slow, you may invoke
the double C-g feature without really meaning to. Then just
resume and answer `n' to both questions, and you will
arrive at your former state. Presumably the quit you
wanted will finish happening soon.
These questions are not asked if you suspend GNU Emacs with the C-z
command. Continuing GNU Emacs after a C-z