ViewVC logotype

Contents of /climacs/Doc/climacs-user.texi

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1.2 - (hide annotations)
Mon Sep 12 22:43:54 2005 UTC (8 years, 7 months ago) by rstrandh
Branch: MAIN
Changes since 1.1: +82 -1 lines
File MIME type: application/x-texinfo
moving by words, editing files.
1 rstrandh 1.1 \input texinfo @c -*-texinfo-*-
2     @c %**start of header
3     @setfilename climacs-user
4     @settitle Climacs User Manual
5     @c %**end of header
7     @copying
8     The Climacs User manual
10     Copyright @copyright{} 2005 Robert Strandh.
12     @end copying
14     @titlepage
15     @title Climacs User Manual
16     @sp 2
17     @author Robert Strandh
19     @page
20     @vskip 0pt plus 1filll
21     @insertcopying
23     @end titlepage
25     @contents
27     @macro climacs{}
28     Climacs
29     @end macro
31     @macro cl{}
32     Common Lisp
33     @end macro
35     @node Top
36     @top
38     @menu
39     * Introduction::
40     * Conventions::
41     * Concepts::
42     * Basic editing commands::
43     * Different editing modes::
44     * Kill ring::
45     * Key Index::
46     * Concept Index::
47     @end menu
50     @node Introduction
51     @chapter Introduction
53     @climacs{} is a text editor in the Emacs family. However, @climacs{}
54     differs from Emacs in various ways.
56     For one thing, @climacs{} is written in Common Lisp rather than Emacs
57     Lisp. Common Lisp is a much more complete language than Emacs Lisp
58     with essential features such as packages, classes, etc.
60     Moreover, @climacs{} uses the Common-Lisp Interface Manager (CLIM) as its
61     substrate for managing everything that has to do with user
62     interaction, including event handling, text rendering, and
63     multi-windowing (called panes in CLIM terminology).
65     Also, since @climacs{} uses CLIM, there is no need for @climacs{} itself to
66     serve as the basis for other applications such as news readers, mail
67     readers, directory editors, web browsers, etc. the way it is done with
68     Emacs. Instead, such applications are better written as stand-alone
69     CLIM applications that can then communicate with @climacs{} using CLIM
70     and Common Lisp as the common substrate.
72     The main purpose of @climacs{} is not to replace Emacs. Instead, it is
73     primarily intended as a text editor for Common Lisp developers.
74     Notice that this is not the same as a text editor for Common Lisp
75     @emph{development}, since Common Lisp developers might need other
76     features such as editing HTML or spell checking, etc., not directly
77     related to Common Lisp development.
79     @node Conventions
80     @chapter Conventions
82     Many @climacs{} commands are invoked by typing a sequence of
83     keystrokes. A complete sequence of keystrokes invokes a
84     @climacs{} @emph{command} which has a @emph{name}. Sometimes it is
85     useful to know that name, even though the command is usually invoked
86     by typing the key sequence. For that reason, in this manual we often
87     give the corresponding command name together with the key sequence to
88     invoke it.
90     @node Concepts
91     @chapter Concepts
93     In order to use @climacs{} effectively, you need to know some concepts
94     that are used by it, and referred to in this manual.
96     @menu
97     * Buffer::
98     * Window and pane::
99     * Mark and point::
100     * Key sequence::
101     @end menu
103     @node Buffer
104     @section Buffer
106     A @climacs{} @emph{buffer}
107     @cindex buffer
108     is an editable sequence of arbitrary @cl{} objects. If the buffer
109     contains text, most of those objects will be @emph{Unicode
110     characters}.
111     @cindex character
112     @cindex Unicode
114     @node Window and pane
115     @section Window and pane
117     A @climacs{} buffer may or may not be on display. If it is, it is on
118     display in a @emph{pane}
119     @cindex pane
120     or a @emph{window}.
121     @cindex window
123     @node Mark and point
124     @section Mark and point
126     Positions into a @climacs{} buffer are determined by @emph{marks}
127     @cindex mark
128     which can be either @emph{left sticky},
129     @cindex left sticky
130     meaning that if an object is inserted where such a mark is, it ends up
131     @emph{to the left} of the newly inserted object, or @emph{right
132     sticky},
133     @cindex right sticky
134     meaning that if an object is inserted where such a mark is, it ends up
135     @emph{to the right} of the newly inserted object.
137     A distinguished mark that is associated with each @climacs{} pane is
138     called the @emph{point}.
139     @cindex point
140     There is a point associated with each window. Each of several windows
141     that display the same buffer has its own point. In addition, a buffer
142     that is not on display has a point that is taken over by the first
143     window that displays the buffer. Points are right-sticky marks, even
144     when a language such as Arabic is edited, simply because by
145     convention, the @climacs{} buffer is considered as being organized
146     from left to right. It is question of @emph{rendering} as to whether
147     the objects in the buffer are actually displayed from left to right,
148     from right to left, or in any other appropriate order.
150     @node Key sequence
151     @section Key sequence
153     Typically, @climacs{} is operated by @emph{key sequences}
154     @cindex key sequence
155     issued by the user. A key sequence is a sequence of key strokes,
156     where a key stroke can be a simple character such as @kbd{f} or
157     @kbd{&}, or a key with one or more @emph{modifiers}
158     @cindex modifier
159     such as @key{Control}, @key{Shift}, @key{Meta}, etc.
161     Some key sequences result in the execution of a @climacs{}
162     @emph{command}.
163     @cindex command
164     Such a key sequence is called a @emph{complete key sequence}
165     @cindex complete key sequence or an @emph{order}.
166     @cindex order
168     @node Basic editing commands
169     @chapter Basic editing commands
171     The basic editing commands of @climacs{} are identical or at least
172     similar to the corresponding Emacs commands. This is deliberate. We
173     do not believe in introducing gratuitous differences where such
174     differences have little or no importance. A typical Emacs user
175     should therefore feel quite comfortable with the basic editing
176     commands of @climacs{}.
178     @menu
179     * Entering and exiting @climacs{}::
180     * Numeric arguments::
181     * Entering and deleting text::
182     * Moving around::
183     * Extended commands::
184 rstrandh 1.2 * Editing the contents of a file::
185 rstrandh 1.1 @end menu
187     @node Entering and exiting @climacs{}
188     @section Entering and exiting @climacs{}
190     The typical way of entering @climacs{} is to type a @cl{}
191     @emph{expression} at the prompt of a @cl{} @emph{listener} such as:
193     @lisp
194     CL-USER> (climacs:climacs)
195     @end lisp
197     You exit from @climacs{} by typing @kbd{C-x C-c} (@command{Quit}).
198     @kindex C-x C-c
199     If you have buffers
200     associated with files that have not been saved to their respective
201     files, @climacs{} will ask whether you would like those buffers
202     saved. In addition, if you answer no to any of those questions, you
203     will be asked to confirm that you want to quit @climacs{} anyway. The
204     reason for this pestering on the part of @climacs{} is that currently
205     when you quit @climacs{}, the buffer contents is lost.
207     @node Numeric arguments
208     @section Numeric arguments
210     Many @climacs{} commands allow the use of a @emph{numeric argument}.
211     @cindex numeric argument
212     A numeric argument is used as a prefix to a @climacs{} command, and
213     modifies the behavior of that command in some useful way which varies
214     from command to command.
216     Typically, a numeric argument prefix makes the command repeat its
217     action a number of times indicated by the numeric argument prefix.
218     For instance, the command @command{Delete Object}, usually associated
219     with the order @kbd{C-d}, normally deletes a single object from the
220     buffer. However, if given a numeric argument, it deletes that many
221     objects.
223     Other commands modify their behavior according to whether a numeric
224     argument has been given, but do not take into account the specific
225     numeric value indicated. For instance, the command @command{Delete
226     Horizontal Space}, when given no numeric argument, deletes whitespace
227     both before and after point. With a numeric argument, it deletes only
228     whitespace @emph{before} point.
230     Yet other commands may both modify what they do and repeat according
231     to the numeric value of the argument. For instance, the command
232     @command{Kill Line}, when given no numeric argument, kills to the end
233     of the line if point is not already at the end of the line, but does
234     not kill the newline character at the end of the line and kills the
235     newline character if point is at the end of a line. However, if given
236     a numeric argument, @command{Kill Line} kills that many lines.
238     There are two ways of giving a numeric argument to a @climacs{}
239     command. One way is to first type @kbd{C-u},
240     @kindex C-u
241     then a sequence of
242     decimal digits, and finally the order that invokes the command. For
243     instance, to delete the next 15 objects after point, you could type
244     @kbd{C-u 1 5 C-d}. The other way is to hold down the @key{Meta} key
245     (usually the one marked @key{Alt}) while typing the decimal digits, as
246     in @kbd{M-1 M-5 C-d}.
248     Some commands accept negative numeric arguments. In that case, start
249     the sequence with the minus sign as in @kbd{C-u - 1 5 C-d}, which in
250     this case will delete buffer objects @emph{before} the point rather
251     than after.
253     @node Entering and deleting text
254     @section Entering and deleting text
256     @menu
257     * Entering text::
258     * Deleting by objects::
259     * Deleting by words::
260     * Deleting by lines::
261     @end menu
263     @node Entering text
264     @subsection Entering text
266     In contrast to other text editors such as VI, @climacs{} does not have
267     a specific @emph{insert mode}. Instead, @climacs{} is always in
268     insert mode, in that characters that are typed on the keyboard
269     immediately get inserted at the @emph{point}.
271     @node Deleting by objects
272     @subsection Deleting by objects
274     To erase objects that have been inserted, you can use the
275     @key{Backspace} (@command{Backward Delete Object}
276     key, which deletes the object immediately to the left of the point.
277     To delete an object @emph{to the right} of the point, use the
278     @kbd{C-d}
279     @kindex C-d
280     (@command{Delete Object}) order. When used with a numeric
281     argument, these commands delete that many objects.
283     @node Deleting by words
284     @subsection Deleting by words
286     It is also possible to delete larger chunks of buffer contents. The
287     order @kbd{M-d}
288     @kindex M-d
289 rstrandh 1.2 (@command{Kill Word}) is used to delete the @emph{word}
290     @cindex word
291 rstrandh 1.1 @emph{following} point. If point is not at the beginning of a word,
292     then the part of the word that follows point is deleted. The order
293     @kbd{M-@key{Backspace}}
294     @kindex M-@key{Backspace}
295     (@command{Backward Kill Word}) is used to
296     delete the word @emph{preceding} point. If point is not at the end of
297     a word, then the part of the word that precedes point is deleted.
298     When used with a numeric argument, these commands delete that many
299     words. Since these command names contain the word @emph{kill}, they
300     use the kill-ring (@pxref{kill-ring}).
302     @node Deleting by lines
303     @subsection Deleting by lines
305     @climacs{} allows you to delete buffer objects one or more lines at a
306     time. The order @kbd{C-k}
307     @kindex C-k
308     (@command{Kill Line}) lets you do this. When point is @emph{not} at
309     the end of a line, then this command kills the buffer contents from
310     point up to, but not including the following newline object. When
311     instead point @emph{is} at the end of a line, only the following
312     newline object is removed.
314     When used with a numeric argument, this command is not simply repeated
315     that many times. Instead, the number of lines indicated by the
316     numerid argument are removed.
318     Because this command name contains the word @emph{kill} it saves the
319     deleted objects on the @emph{kill ring} (@pxref{kill-ring}).
321     @node Moving around
322     @section Moving around
324     @menu
325     * Moving by objects::
326     * Moving by words::
327     * Moving by lines::
328     @end menu
330     @node Moving by objects
331     @subsection Moving by objects
333     @climacs{} allows you to move around in the buffer in various ways.
334     The most frequent way of moving around is by one buffer position at a
335     time.
337     The order @kbd{C-f}
338     @kindex C-f
339     (@command{Forward Object}) allows you to
340     advance the position of point by one position. If given a numeric
341     argument, it advances by that many positions. The @command{Forward
342     Object} command is also associated with the @emph{right-arrow key}.
344     The order @kbd{C-b}
345     @kindex C-b
346     (@command{Backward Object}) allows you to move the
347     position of point backward by one position. If given a numeric
348     argument, it moves back by that many positions. The @command{Backward
349     Object} command is also associated with the @emph{left-arrow key}.
351     @node Moving by words
352     @subsection Moving by words
354 rstrandh 1.2 @climacs{} will allow you to move around by larger unites than
355     objects.
357     The order @kbd{M-f}
358     @kindex M-f
359     (@command{Forward Word}) lets you move forward over the @emph{word}
360     @cindex word
361     following point. With a numeric argument, this command moves point
362     forward that many words.
364     The order @kbd{M-b}
365     @kindex M-b
366     (@command{Backward Word}) lets you move backward over the @emph{word}
367     @cindex word
368     preceding point. With a numeric argument, this command moves point
369     backward that many words.
371     Notice the analogy between the commands for moving by objects
372     (@kbd{C-f}, @kbd{C-b}) and those for moving by words (@kbd{M-f},
373     @kbd{M-b}).
375 rstrandh 1.1 @node Moving by lines
376     @subsection Moving by lines
378     @climacs{} has commands to move by one or several @emph{lines} at a
379     time.
381     The order @kbd{C-p}
382     @kindex C-p
383     (@command{Previous Line}) allows you to
384     move point @emph{up} to the previous line. If given a numeric
385     argument, it moves up by that many lines. The command
386     @command{Previous Line} is also associated with the @emph{up-arrow
387     key}.
389     The order @kbd{C-n}
390     @kindex C-n
391     (@command{Next Line}) allows you to
392     move point @emph{down} to the next line. If given a numeric
393     argument, it moves down by that many lines. The command
394     @command{Next Line} is also associated with the @emph{down-arrow
395     key}.
397     When you move by lines, @climacs{} tries to be smart about what
398     @emph{column} point ends up in, in the following way: when a sequence
399     of commands that move by lines is given, the initial column of point
400     is remembered (this is called the @emph{goal column}). @climacs{}
401     then tries to position point in that column of the target line. If
402     the target line has fewer than that many columns, point is positioned
403     at the end of the target line. The goal column is discarded when the
404     sequence of commands is interrupted by some unrelated command.
406     @node Extended commands
407     @section Extended commands
409     In order to make editing as efficient as possible, many @climacs{}
410     commands can be invoked by key sequences. It is, however, possible to
411     invoke most @climacs{} commands by using the order @kbd{M-x} which
412     invokes the command @command{Extended Command} which lets you type the
413     @emph{name} of the command in the minibuffer at the prompt.
414     In general, you do not have to type the full name of the command,
415     because @climacs{} uses CLIM's completion mechanism so that you can
416     complete the name by typing some prefix and then use the @key{TAB} key
417     to complete.
419     Some @climacs{} commands @emph{must} be invoked through the use of
420     @command{Extended Command}. The reason for this is that key sequences
421     are a precious resource, and for rarely-used commands, it is better
422     not to waste a key sequence.
423 rstrandh 1.2
424     @node Editing the contents of a file
425     @section Editing the contents of a file
427     Transfering the contents of a text file into a @climacs{} buffer is
428     referred to as @emph{finding} the file.
429     @cindex finding a file
431     There are two ways of transfering the contents of a buffer to a file.
432     One is to @emph{save} the buffer, which means to transfer the contents
433     to the file that is already associated with the buffer. The other is
434     to @emph{write} the buffer, which means to transfer the contents to a
435     different file than that associated with the buffer, or to write the
436     contents of a buffer that has no associated file to some file.
438     @menu
439     * Finding a file:: Moving text from a file to a @climacs{} buffer
440     * Saving a buffer:: Moving text from a buffer to the associated file
441     * Writing a buffer:: Moving text from a buffer to a different file
442     @end menu
444     @node Finding a file
445     @subsection Finding a file
447     To find a file, use the order @kbd{C-x C-f}
448     @kindex C-x C-f
449     (@command{Find File}).
451     @climacs{} will prompt for the name of a file. For typing the file
452     name, you can use @emph{completion} (using the @key{TAB} key), or you
453     can use the right mouse button to get a list of all the files that
454     match the prefix you typed.
456     The result of finding a file is that a @emph{buffer} will be created
457     that has the name of the file, and the file will be associated with
458     that buffer when the contents is saved.
460     @node Saving a buffer
461     @subsection Saving a buffer
463     To save a buffer, use the order @kbd{C-x C-s}
464     @kindex C-x C-s
465     (@command{Save Buffer}).
466     The contents of the buffer will be transfered to the file associated
467     with the buffer if there is one. If the buffer has no file name
468     associated with it, then this command behaves just like @command{Write
469     Buffer} (@pxref{write-buffer}).
471     @node Writing a buffer
472     @subsection Writing a buffer
473     @anchor{write-buffer}
475     To write a buffer to a file, use the order @kbd{C-x C-w}
476     @kindex C-x C-w
477     (@command{Write Buffer}). @climacs{} will prompt for the name of a
478     file to save the buffer contents in. Completion (by using the
479     @key{TAB} key, or by using the right mouse button) can be used if the
480     name is that of an existing file.
481 rstrandh 1.1
482     @node Different editing modes
483     @chapter Different editing modes
485     @menu
486     * Overwrite mode::
487     @end menu
489     @node Overwrite mode
490     @section Overwrite mode
492     Normally, typing ordinary characters to @climacs{} results in these
493     characters being @emph{inserted} at point. Sometimes, however, it is
494     useful to treat a line of objects as being of @emph{fixed length}, and
495     have @climacs{} @emph{replace} objects as new ones are begin typed.
497     This is exactly the purpose of @climacs{} @emph{overwrite mode}. This
498     mode alters the insert commands so that the object after point is
499     first deleted.
501     You can toggle between the normal mode of operation and overwrite mode
502     by using the @key{Insert}
503     @kindex @key{Insert}
504     (@command{Toggle Overwrite Mode}) key.
506     @node Kill ring
507     @chapter Kill ring
508     @anchor{kill-ring}
510     Many @climacs{} commands that remove objects from a buffer save these
511     objects on a global @emph{kill ring}.
512     @cindex kill ring
515     @node Key Index
516     @unnumbered Key Index
518     @printindex ky
520     @node Concept Index
521     @unnumbered Concept Index
523     @printindex cp
525     @bye

  ViewVC Help
Powered by ViewVC 1.1.5