BSD 4_4 development
[unix-history] / usr / src / contrib / emacs-18.57 / etc / CCADIFF
CommitLineData
6bb9aa03
C
1Differences between GNU Emacs and CCA Emacs.
2Copyright (c) 1985 Richard M. Stallman
3
4 Permission is granted to anyone to make or distribute verbatim copies
5 of this document as received, in any medium, provided that the
6 copyright notice and permission notice are preserved,
7 and that the distributor grants the recipient permission
8 for further redistribution as permitted by this notice.
9
10* GNU Emacs Lisp vs CCA Elisp.
11
12GNU Emacs Lisp does not have a distinction between Lisp functions
13and Emacs functions, or between Lisp variables and Emacs variables.
14The Lisp and the editor are integrated. A Lisp function defined
15with defun is callable as an editor command if you put an
16interactive calling spec in it; for example,
17 (defun forward-character (n)
18 (interactive "p")
19 (goto-char (+ (point) n)))
20defines a function of one argument that moves point forward by
21a specified number of characters. Programs could call this function,
22as in (forward-character 6), or it could be assigned to a key,
23in which case the "p" says to pass the prefix numeric arg as
24the function's argument. As a result of this feature, you often
25need not have two different functions, one to be called by programs
26and another to read arguments from the user conveniently; the same
27function can do both.
28
29CCA Elisp tries to be a subset of Common Lisp and tries to
30have as many Common Lisp functions as possible (though it is still
31only a small fraction of full Common Lisp). GNU Emacs Lisp
32is somewhat similar to Common Lisp just because of my Maclisp
33and Lisp Machine background, but it has several distinct incompatibilities
34in both syntax and semantics. Also, I have not attempted to
35provide many Common Lisp functions that you could write in Lisp,
36or others that provide no new capability in the circumstances.
37
38GNU Emacs Lisp does not have packages, readtables, or character objects
39(it uses integers to represent characters).
40
41On the other hand, windows, buffers, relocatable markers and processes
42are first class objects in GNU Emacs Lisp. You can get information about them
43and do things to them in a Lispy fashion. Not so in CCA Emacs.
44
45In GNU Emacs Lisp, you cannot open a file and read or write characters
46or Lisp objects from it. This feature is painful to support, and
47is not fundamentally necessary in an Emacs, because instead you
48can read the file into a buffer, read or write characters or
49Lisp objects in the buffer, and then write the buffer into the file.
50
51On the other hand, GNU Emacs Lisp does allow you to rename, delete, add
52names to, and copy files; also to find out whether a file is a
53directory, whether it is a symbolic link and to what name, whether
54you can read it or write it, find out its directory component,
55expand a relative pathname, find completions of a file name, etc.,
56which you cannot do in CCA Elisp.
57
58GNU Emacs Lisp uses dynamic scope exclusively. This enables you to
59bind variables which affect the execution of the editor, such as
60indent-tabs-mode.
61
62GNU Emacs Lisp code is normally compiled into byte code. Most of the
63standard editing commands are written in Lisp, and many are
64dumped, pure, in the Emacs that users normally run.
65
66GNU Emacs allows you to interrupt a runaway Lisp program with
67Control-g.
68
69* GNU Emacs Editing Advantages
70
71GNU Emacs is faster for many things, especially insertion of text
72and file I/O.
73
74GNU Emacs allows you to undo more than just the last command
75with the undo command (C-x u, or C-_). You can undo quite a ways back.
76Undo information is separate for each buffer; changes in one buffer
77do not affect your ability to undo in another buffer.
78
79GNU Emacs commands that want to display some output do so by putting
80it in a buffer and displaying that buffer in a window. This
81technique comes from Gosling Emacs. It has both advantages and
82disadvantages when compared with the technique, copied by CCA Emacs
83from my original Emacs which inherited it from TECO, of having "type
84out" which appears on top of the text in the current window but
85disappears automatically at the next input character.
86
87GNU Emacs does not use the concept of "subsystems". Instead, it uses
88highly specialized major modes. For example, dired in GNU Emacs has
89the same commands as dired does in other versions of Emacs, give or
90take a few, but it is a major mode, not a subsystem. The advantage
91of this is that you do not have to "exit" from dired and lose the
92state of dired in order to edit files again. You can simply switch
93to another buffer, and switch back to the dired buffer later. You
94can also have several dired buffers, looking at different directories.
95
96It is still possible to write a subsystem--your own command loop--
97in GNU Emacs, but it is not recommended, since writing a major mode
98for a special buffer is better.
99
100Recursive edits are also rarely used, for the same reason: it is better
101to make a new buffer and put it in a special major mode. Sending
102mail is done this way.
103
104GNU Emacs expects everyone to use find-file (C-x C-f) for reading
105in files; its C-x C-v command kills the current buffer and then finds
106the specified file.
107
108As a result, users do not need to think about the complexities
109of subsystems, recursive edits, and various ways to read in files
110or what to do if a buffer contains changes to some other file.
111
112GNU Emacs uses its own format of tag table, made by the "etags"
113program. This format makes finding a tag much faster.
114
115Dissociated Press is supported.
116
117
118* GNU Emacs Editing Disadvantages.
119
120GNU Emacs does not display the location of the mark.
121
122GNU Emacs does not have a concept of numbers of buffers,
123or a permanent ordering of buffers, or searching through multiple
124buffers. The tags-search command provides a way to search
125through several buffers automatically.
126
127GNU Emacs does not provide commands to visit files without
128setting the buffer's default directory. Users can write such
129commands in Lisp by copying the code of the standard file
130visiting commands and modifying them.
131
132GNU Emacs does not support "plus options" in the command
133arguments or in buffer-selection commands, except for line numbers.
134
135GNU Emacs does not support encryption. Down with security!
136
137GNU Emacs does not support replaying keystroke files,
138and does not normally write keystroke files.
139
140
141* Neutral Differences
142
143GNU Emacs uses TAB, not ESC, to complete file names, buffer names,
144command names, etc.
145
146GNU Emacs uses ESC to terminate searches, instead of
147the C-d uses by CCA Emacs. (Actually, this character is controlled
148by a parameter in GNU Emacs.) C-M-s in GNU Emacs is an interactive
149regular expression search, but you can get to a noninteractive
150one by typing ESC right after the C-M-s.
151
152In GNU Emacs, C-x s asks, for each modified file buffer, whether
153to save it.
154
155GNU Emacs indicates line continuation with "\" and line
156truncation (at either margin) with "$".
157
158The command to resume a tags-search or tags-query-replace in
159GNU Emacs is Meta-Comma.