/[climacs]/climacs/Doc/climacs-user.texi
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (hide annotations)
Sun Jul 2 19:55:45 2006 UTC (7 years, 9 months ago) by thenriksen
Branch: MAIN
Changes since 1.11: +25 -12 lines
File MIME type: application/x-texinfo
Fleshed out the definitions for the buffer and pane concepts.
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
6    
7     @copying
8     The Climacs User manual
9    
10     Copyright @copyright{} 2005 Robert Strandh.
11    
12     @end copying
13    
14     @titlepage
15     @title Climacs User Manual
16     @sp 2
17     @author Robert Strandh
18    
19     @page
20     @vskip 0pt plus 1filll
21     @insertcopying
22    
23     @end titlepage
24    
25     @contents
26    
27     @macro climacs{}
28     Climacs
29     @end macro
30    
31     @macro cl{}
32     Common Lisp
33     @end macro
34    
35     @node Top
36     @top
37    
38     @menu
39     * Introduction::
40     * Conventions::
41     * Concepts::
42     * Basic editing commands::
43     * Different editing modes::
44     * Kill ring::
45 rstrandh 1.3 * Advanced editing commands::
46 rstrandh 1.4 * Getting help::
47 rstrandh 1.7 * Proposal for new buffer/pane relations::
48 rstrandh 1.1 * Key Index::
49     * Concept Index::
50     @end menu
51    
52    
53     @node Introduction
54     @chapter Introduction
55    
56     @climacs{} is a text editor in the Emacs family. However, @climacs{}
57     differs from Emacs in various ways.
58    
59     For one thing, @climacs{} is written in Common Lisp rather than Emacs
60     Lisp. Common Lisp is a much more complete language than Emacs Lisp
61     with essential features such as packages, classes, etc.
62    
63     Moreover, @climacs{} uses the Common-Lisp Interface Manager (CLIM) as its
64     substrate for managing everything that has to do with user
65     interaction, including event handling, text rendering, and
66     multi-windowing (called panes in CLIM terminology).
67    
68     Also, since @climacs{} uses CLIM, there is no need for @climacs{} itself to
69     serve as the basis for other applications such as news readers, mail
70     readers, directory editors, web browsers, etc. the way it is done with
71     Emacs. Instead, such applications are better written as stand-alone
72     CLIM applications that can then communicate with @climacs{} using CLIM
73     and Common Lisp as the common substrate.
74    
75     The main purpose of @climacs{} is not to replace Emacs. Instead, it is
76     primarily intended as a text editor for Common Lisp developers.
77     Notice that this is not the same as a text editor for Common Lisp
78     @emph{development}, since Common Lisp developers might need other
79     features such as editing HTML or spell checking, etc., not directly
80     related to Common Lisp development.
81    
82     @node Conventions
83     @chapter Conventions
84    
85     Many @climacs{} commands are invoked by typing a sequence of
86     keystrokes. A complete sequence of keystrokes invokes a
87     @climacs{} @emph{command} which has a @emph{name}. Sometimes it is
88     useful to know that name, even though the command is usually invoked
89     by typing the key sequence. For that reason, in this manual we often
90     give the corresponding command name together with the key sequence to
91     invoke it.
92    
93     @node Concepts
94     @chapter Concepts
95    
96     In order to use @climacs{} effectively, you need to know some concepts
97     that are used by it, and referred to in this manual.
98    
99     @menu
100     * Buffer::
101     * Window and pane::
102     * Mark and point::
103     * Key sequence::
104     @end menu
105    
106     @node Buffer
107     @section Buffer
108    
109     A @climacs{} @emph{buffer}
110     @cindex buffer
111 thenriksen 1.12 is a named, editable sequence of arbitrary @cl{} objects. If the buffer
112 rstrandh 1.1 contains text, most of those objects will be @emph{Unicode
113 thenriksen 1.12 characters}. When editing a file, the contents of the file will be
114     loaded into a buffer with a name corresponding to the name of the file
115     (creating the buffer in the process), and all editing operations will be
116     performed on the buffer. Upon saving, the contents of the buffer will be
117     written to the file associated with it. @xref{Editing the contents of a
118     file}. A buffer does not necessarily have a file associated with it, for
119     example, the @emph{*scratch*} buffer automatically created upon
120     @climacs{} startup is not associated with any file.
121 rstrandh 1.1 @cindex character
122     @cindex Unicode
123    
124     @node Window and pane
125     @section Window and pane
126    
127     A @climacs{} buffer may or may not be on display. If it is, it is on
128 thenriksen 1.12 display in a @emph{pane}
129 rstrandh 1.1 @cindex pane
130     or a @emph{window}.
131     @cindex window
132 thenriksen 1.12 A pane does not necessarily contain a buffer, it may just be a pane
133     containing output from Climacs. These panes are known as @emph{typeout
134     panes},
135     @cindex typeout pane
136     and their contents are lost when they are destroyed.
137 rstrandh 1.1
138     @node Mark and point
139     @section Mark and point
140    
141     Positions into a @climacs{} buffer are determined by @emph{marks}
142     @cindex mark
143     which can be either @emph{left sticky},
144     @cindex left sticky
145     meaning that if an object is inserted where such a mark is, it ends up
146     @emph{to the left} of the newly inserted object, or @emph{right
147     sticky},
148     @cindex right sticky
149     meaning that if an object is inserted where such a mark is, it ends up
150     @emph{to the right} of the newly inserted object.
151    
152     A distinguished mark that is associated with each @climacs{} pane is
153     called the @emph{point}.
154     @cindex point
155     There is a point associated with each window. Each of several windows
156     that display the same buffer has its own point. In addition, a buffer
157     that is not on display has a point that is taken over by the first
158     window that displays the buffer. Points are right-sticky marks, even
159     when a language such as Arabic is edited, simply because by
160     convention, the @climacs{} buffer is considered as being organized
161 rstrandh 1.6 from left to right. It is a question of @emph{rendering} as to whether
162 rstrandh 1.1 the objects in the buffer are actually displayed from left to right,
163     from right to left, or in any other appropriate order.
164    
165     @node Key sequence
166     @section Key sequence
167    
168     Typically, @climacs{} is operated by @emph{key sequences}
169     @cindex key sequence
170     issued by the user. A key sequence is a sequence of key strokes,
171     where a key stroke can be a simple character such as @kbd{f} or
172     @kbd{&}, or a key with one or more @emph{modifiers}
173     @cindex modifier
174     such as @key{Control}, @key{Shift}, @key{Meta}, etc.
175    
176     Some key sequences result in the execution of a @climacs{}
177     @emph{command}.
178     @cindex command
179     Such a key sequence is called a @emph{complete key sequence}
180 rstrandh 1.6 @cindex complete key sequence
181     or an @emph{order}.
182 rstrandh 1.1 @cindex order
183    
184     @node Basic editing commands
185     @chapter Basic editing commands
186    
187     The basic editing commands of @climacs{} are identical or at least
188     similar to the corresponding Emacs commands. This is deliberate. We
189     do not believe in introducing gratuitous differences where such
190     differences have little or no importance. A typical Emacs user
191     should therefore feel quite comfortable with the basic editing
192     commands of @climacs{}.
193    
194     @menu
195 rstrandh 1.5 * Entering and exiting Climacs::
196 rstrandh 1.1 * Numeric arguments::
197     * Entering and deleting text::
198     * Moving around::
199     * Extended commands::
200 rstrandh 1.2 * Editing the contents of a file::
201 rstrandh 1.1 @end menu
202    
203 rstrandh 1.5 @node Entering and exiting Climacs
204     @section Entering and exiting Climacs
205 rstrandh 1.1
206     The typical way of entering @climacs{} is to type a @cl{}
207     @emph{expression} at the prompt of a @cl{} @emph{listener} such as:
208    
209     @lisp
210 thenriksen 1.8 CL-USER> (climacs-gui:climacs)
211 rstrandh 1.1 @end lisp
212    
213     You exit from @climacs{} by typing @kbd{C-x C-c} (@command{Quit}).
214     @kindex C-x C-c
215     If you have buffers
216     associated with files that have not been saved to their respective
217     files, @climacs{} will ask whether you would like those buffers
218     saved. In addition, if you answer no to any of those questions, you
219     will be asked to confirm that you want to quit @climacs{} anyway. The
220     reason for this pestering on the part of @climacs{} is that currently
221 rstrandh 1.6 when you quit @climacs{}, the buffer contents are lost.
222 rstrandh 1.1
223     @node Numeric arguments
224     @section Numeric arguments
225    
226     Many @climacs{} commands allow the use of a @emph{numeric argument}.
227     @cindex numeric argument
228     A numeric argument is used as a prefix to a @climacs{} command, and
229     modifies the behavior of that command in some useful way which varies
230     from command to command.
231    
232     Typically, a numeric argument prefix makes the command repeat its
233     action a number of times indicated by the numeric argument prefix.
234     For instance, the command @command{Delete Object}, usually associated
235     with the order @kbd{C-d}, normally deletes a single object from the
236     buffer. However, if given a numeric argument, it deletes that many
237     objects.
238    
239     Other commands modify their behavior according to whether a numeric
240     argument has been given, but do not take into account the specific
241     numeric value indicated. For instance, the command @command{Delete
242     Horizontal Space}, when given no numeric argument, deletes whitespace
243     both before and after point. With a numeric argument, it deletes only
244     whitespace @emph{before} point.
245    
246     Yet other commands may both modify what they do and repeat according
247     to the numeric value of the argument. For instance, the command
248     @command{Kill Line}, when given no numeric argument, kills to the end
249     of the line if point is not already at the end of the line, but does
250     not kill the newline character at the end of the line and kills the
251     newline character if point is at the end of a line. However, if given
252     a numeric argument, @command{Kill Line} kills that many lines.
253    
254     There are two ways of giving a numeric argument to a @climacs{}
255     command. One way is to first type @kbd{C-u},
256     @kindex C-u
257     then a sequence of
258     decimal digits, and finally the order that invokes the command. For
259     instance, to delete the next 15 objects after point, you could type
260     @kbd{C-u 1 5 C-d}. The other way is to hold down the @key{Meta} key
261     (usually the one marked @key{Alt}) while typing the decimal digits, as
262     in @kbd{M-1 M-5 C-d}.
263    
264     Some commands accept negative numeric arguments. In that case, start
265     the sequence with the minus sign as in @kbd{C-u - 1 5 C-d}, which in
266     this case will delete buffer objects @emph{before} the point rather
267     than after.
268    
269     @node Entering and deleting text
270     @section Entering and deleting text
271    
272     @menu
273     * Entering text::
274     * Deleting by objects::
275     * Deleting by words::
276     * Deleting by lines::
277     @end menu
278    
279     @node Entering text
280     @subsection Entering text
281    
282     In contrast to other text editors such as VI, @climacs{} does not have
283     a specific @emph{insert mode}. Instead, @climacs{} is always in
284     insert mode, in that characters that are typed on the keyboard
285     immediately get inserted at the @emph{point}.
286    
287     @node Deleting by objects
288     @subsection Deleting by objects
289    
290     To erase objects that have been inserted, you can use the
291     @key{Backspace} (@command{Backward Delete Object}
292     key, which deletes the object immediately to the left of the point.
293     To delete an object @emph{to the right} of the point, use the
294     @kbd{C-d}
295     @kindex C-d
296     (@command{Delete Object}) order. When used with a numeric
297     argument, these commands delete that many objects.
298    
299     @node Deleting by words
300     @subsection Deleting by words
301    
302     It is also possible to delete larger chunks of buffer contents. The
303     order @kbd{M-d}
304     @kindex M-d
305 rstrandh 1.2 (@command{Kill Word}) is used to delete the @emph{word}
306     @cindex word
307 rstrandh 1.1 @emph{following} point. If point is not at the beginning of a word,
308     then the part of the word that follows point is deleted. The order
309     @kbd{M-@key{Backspace}}
310     @kindex M-@key{Backspace}
311     (@command{Backward Kill Word}) is used to
312     delete the word @emph{preceding} point. If point is not at the end of
313     a word, then the part of the word that precedes point is deleted.
314     When used with a numeric argument, these commands delete that many
315     words. Since these command names contain the word @emph{kill}, they
316     use the kill-ring (@pxref{kill-ring}).
317    
318     @node Deleting by lines
319     @subsection Deleting by lines
320    
321     @climacs{} allows you to delete buffer objects one or more lines at a
322     time. The order @kbd{C-k}
323     @kindex C-k
324     (@command{Kill Line}) lets you do this. When point is @emph{not} at
325     the end of a line, then this command kills the buffer contents from
326     point up to, but not including the following newline object. When
327     instead point @emph{is} at the end of a line, only the following
328     newline object is removed.
329    
330     When used with a numeric argument, this command is not simply repeated
331     that many times. Instead, the number of lines indicated by the
332 rstrandh 1.6 numeric argument are removed.
333 rstrandh 1.1
334     Because this command name contains the word @emph{kill} it saves the
335     deleted objects on the @emph{kill ring} (@pxref{kill-ring}).
336    
337     @node Moving around
338     @section Moving around
339    
340     @menu
341     * Moving by objects::
342     * Moving by words::
343     * Moving by lines::
344     @end menu
345    
346     @node Moving by objects
347     @subsection Moving by objects
348    
349     @climacs{} allows you to move around in the buffer in various ways.
350     The most frequent way of moving around is by one buffer position at a
351     time.
352    
353     The order @kbd{C-f}
354     @kindex C-f
355     (@command{Forward Object}) allows you to
356     advance the position of point by one position. If given a numeric
357     argument, it advances by that many positions. The @command{Forward
358     Object} command is also associated with the @emph{right-arrow key}.
359    
360     The order @kbd{C-b}
361     @kindex C-b
362     (@command{Backward Object}) allows you to move the
363     position of point backward by one position. If given a numeric
364     argument, it moves back by that many positions. The @command{Backward
365     Object} command is also associated with the @emph{left-arrow key}.
366    
367     @node Moving by words
368     @subsection Moving by words
369    
370 rstrandh 1.6 @climacs{} will allow you to move around by larger units than
371 rstrandh 1.2 objects.
372    
373     The order @kbd{M-f}
374     @kindex M-f
375     (@command{Forward Word}) lets you move forward over the @emph{word}
376     @cindex word
377     following point. With a numeric argument, this command moves point
378     forward that many words.
379    
380     The order @kbd{M-b}
381     @kindex M-b
382     (@command{Backward Word}) lets you move backward over the @emph{word}
383     @cindex word
384     preceding point. With a numeric argument, this command moves point
385     backward that many words.
386    
387     Notice the analogy between the commands for moving by objects
388     (@kbd{C-f}, @kbd{C-b}) and those for moving by words (@kbd{M-f},
389     @kbd{M-b}).
390    
391 rstrandh 1.1 @node Moving by lines
392     @subsection Moving by lines
393    
394     @climacs{} has commands to move by one or several @emph{lines} at a
395     time.
396    
397     The order @kbd{C-p}
398     @kindex C-p
399     (@command{Previous Line}) allows you to
400     move point @emph{up} to the previous line. If given a numeric
401     argument, it moves up by that many lines. The command
402     @command{Previous Line} is also associated with the @emph{up-arrow
403     key}.
404    
405     The order @kbd{C-n}
406     @kindex C-n
407     (@command{Next Line}) allows you to
408     move point @emph{down} to the next line. If given a numeric
409     argument, it moves down by that many lines. The command
410     @command{Next Line} is also associated with the @emph{down-arrow
411     key}.
412    
413 rstrandh 1.6 When you move by lines, @climacs{} tries to be smart about which
414 rstrandh 1.1 @emph{column} point ends up in, in the following way: when a sequence
415     of commands that move by lines is given, the initial column of point
416     is remembered (this is called the @emph{goal column}). @climacs{}
417     then tries to position point in that column of the target line. If
418     the target line has fewer than that many columns, point is positioned
419     at the end of the target line. The goal column is discarded when the
420     sequence of commands is interrupted by some unrelated command.
421    
422     @node Extended commands
423     @section Extended commands
424    
425     In order to make editing as efficient as possible, many @climacs{}
426     commands can be invoked by key sequences. It is, however, possible to
427     invoke most @climacs{} commands by using the order @kbd{M-x} which
428     invokes the command @command{Extended Command} which lets you type the
429     @emph{name} of the command in the minibuffer at the prompt.
430     In general, you do not have to type the full name of the command,
431     because @climacs{} uses CLIM's completion mechanism so that you can
432     complete the name by typing some prefix and then use the @key{TAB} key
433     to complete.
434    
435     Some @climacs{} commands @emph{must} be invoked through the use of
436     @command{Extended Command}. The reason for this is that key sequences
437     are a precious resource, and for rarely-used commands, it is better
438     not to waste a key sequence.
439 rstrandh 1.2
440     @node Editing the contents of a file
441     @section Editing the contents of a file
442    
443     Transfering the contents of a text file into a @climacs{} buffer is
444     referred to as @emph{finding} the file.
445     @cindex finding a file
446    
447     There are two ways of transfering the contents of a buffer to a file.
448     One is to @emph{save} the buffer, which means to transfer the contents
449     to the file that is already associated with the buffer. The other is
450     to @emph{write} the buffer, which means to transfer the contents to a
451     different file than that associated with the buffer, or to write the
452     contents of a buffer that has no associated file to some file.
453    
454     @menu
455     * Finding a file:: Moving text from a file to a @climacs{} buffer
456     * Saving a buffer:: Moving text from a buffer to the associated file
457     * Writing a buffer:: Moving text from a buffer to a different file
458     @end menu
459    
460     @node Finding a file
461     @subsection Finding a file
462    
463     To find a file, use the order @kbd{C-x C-f}
464     @kindex C-x C-f
465     (@command{Find File}).
466    
467     @climacs{} will prompt for the name of a file. For typing the file
468     name, you can use @emph{completion} (using the @key{TAB} key), or you
469     can use the right mouse button to get a list of all the files that
470     match the prefix you typed.
471    
472     The result of finding a file is that a @emph{buffer} will be created
473     that has the name of the file, and the file will be associated with
474 rstrandh 1.6 that buffer when the content is saved.
475 rstrandh 1.2
476     @node Saving a buffer
477     @subsection Saving a buffer
478    
479     To save a buffer, use the order @kbd{C-x C-s}
480     @kindex C-x C-s
481     (@command{Save Buffer}).
482     The contents of the buffer will be transfered to the file associated
483     with the buffer if there is one. If the buffer has no file name
484     associated with it, then this command behaves just like @command{Write
485     Buffer} (@pxref{write-buffer}).
486    
487     @node Writing a buffer
488     @subsection Writing a buffer
489     @anchor{write-buffer}
490    
491     To write a buffer to a file, use the order @kbd{C-x C-w}
492     @kindex C-x C-w
493     (@command{Write Buffer}). @climacs{} will prompt for the name of a
494     file to save the buffer contents in. Completion (by using the
495     @key{TAB} key, or by using the right mouse button) can be used if the
496     name is that of an existing file.
497 rstrandh 1.1
498     @node Different editing modes
499     @chapter Different editing modes
500    
501     @menu
502     * Overwrite mode::
503     @end menu
504    
505     @node Overwrite mode
506     @section Overwrite mode
507    
508     Normally, typing ordinary characters to @climacs{} results in these
509     characters being @emph{inserted} at point. Sometimes, however, it is
510     useful to treat a line of objects as being of @emph{fixed length}, and
511 rstrandh 1.6 have @climacs{} @emph{replace} objects as new ones are being typed.
512 rstrandh 1.1
513     This is exactly the purpose of @climacs{} @emph{overwrite mode}. This
514     mode alters the insert commands so that the object after point is
515     first deleted.
516    
517     You can toggle between the normal mode of operation and overwrite mode
518     by using the @key{Insert}
519     @kindex @key{Insert}
520     (@command{Toggle Overwrite Mode}) key.
521    
522     @node Kill ring
523     @chapter Kill ring
524     @anchor{kill-ring}
525    
526     Many @climacs{} commands that remove objects from a buffer save these
527     objects on a global @emph{kill ring}.
528     @cindex kill ring
529    
530 rstrandh 1.3 @node Advanced editing commands
531     @chapter Advanced editing commands
532    
533     @menu
534     * Keyboard macros::
535     * Searching and replacing::
536     @end menu
537    
538     @node Keyboard macros
539     @section Keyboard macros
540    
541     Sometimes, it is useful to be able to repeat a sequence of keystrokes
542 rstrandh 1.6 several times. @climacs{} allows you to do this through a feature
543 rstrandh 1.3 called @emph{keyboard macros}.
544     @cindex keyboard macro
545     @climacs{} does this by @emph{recording} whatever the user types on
546 rstrandh 1.6 the keyboard, and then making it possibly to @emph{replay} the
547 rstrandh 1.3 recorded sequence.
548    
549     To start recording a sequence of keystrokes, use the order @kbd{C-x (}
550     @kindex C-x (
551     (@command{Start Kbd Macro}). You will see the word @samp{Def}
552     appearing on the mode line, indicating that a keyboard macro is being
553     defined. As long as recording is in effect, every keystroke will be
554     saved for later use.
555    
556     To stop recording a sequence of keystrokes, use the order @kbd{C-x )}
557     @kindex C-x )
558     (@command{End Kbd Macro}). The word @samp{Def} will disappear from
559     the mode line, indicating that keystrokes are no longer being
560     recorded.
561    
562     To replay a previously recorded sequence of keystrokes, use the order
563     @kbd{C-x e}
564     @kindex C-x e
565     (@command{Call Last Kbd Macro}). When used with a numeric argument,
566     this command will repeat the sequence of keystrokes that many times.
567    
568     @node Searching and replacing
569     @section Searching and replacing
570 rstrandh 1.4
571 thenriksen 1.11 @climacs{} has a number of useful searching and replacing commands. The
572 thenriksen 1.10 replacing commands come in two flavors - querying commands and
573     non-querying commands. The former will unconditionally replace all
574     matches, while the latter will query before each replacement. Note that
575     the searching and replacing commands only affect the buffer contents
576     after point.
577    
578     @menu
579     * Simple search::
580     * Incremental search::
581     * The isearch command loop::
582     * Replacing single strings::
583     * Replacing multiple different strings::
584     * The query-replace command loop::
585     @end menu
586    
587     @node Simple search
588     @subsection Simple search
589    
590     The simplest search command is @command{String Search}. It prompts for a
591     string and moves point to after the next occurrence of the
592     string. @command{Reverse String Search} is similar, but searches
593     backwards from point, and puts point before the first occurrence of the
594     string.
595    
596     The commands @command{Word Search} and @command{Reverse Word Search} are
597     very similar to @command{String Search} and @command{Reverse String
598     Search}, but only finds matches that are whole words.
599    
600     The commands @command{Regex Search Forward} and @command{Regex Search
601     Backward} are similar to @command{String Search} and @command{Reverse
602     Word Search}, but do not search for plain strings. Instead, they ask the
603     user to enter a regular expression and attempts to find a match in the
604     buffer.
605    
606     You can use the command @command{How Many} to count the number of
607     matches in the buffer for a given regular expression. When invoked, the
608     command will ask for a regular expression, and then proceed to search
609     through the buffer, counting each match for the regular expression, and
610     finally print the number of matches to the minibuffer.
611    
612     @node Incremental search
613     @subsection Incremental search
614    
615     Incremental search, or @emph{isearch} in common speech, is different
616     from string search, in that point is moved to matches in the buffer,
617     while the search string is being entered, thus, the user receives
618     immediate feedback while entering the search string. Incremental search
619     is controlled through a command loop. @xref{The isearch command loop}.
620    
621     Incremental search can be entered via two orders, @kbd{C-s}
622     @kindex C-s
623     (@command{Isearch Forward}) and @kbd{C-r}
624     @kindex C-r
625     (@command{Isearch Backward}). These commands starts a command loop that
626     searches forwards and backwards by default, respectively. Note that the
627     search direction can be changed from inside the command loop, no matter
628     which of these commands were used to start it.
629    
630     @node The isearch command loop
631     @subsection The isearch command loop
632    
633     The isearch command loop consists of the user typing in characters for
634 thenriksen 1.11 the search string, and @climacs{} moving point ahead to the most immediate
635 thenriksen 1.10 instance of the provided string, while the user is typing. Apart from
636     simply entering text, the user can manipulate the command loop by
637     entering the following orders:
638    
639     @table @kbd
640     @item C-s
641     Move to next match for current search string and set the search
642     direction to forward.
643     @item C-r
644     Move to previous match for current search string and set the search
645     direction to backward.
646     @item C-j
647     Append a ``newline'' character to the current search string.
648     @item C-w
649     Append the word at point to the current search string.
650     @item C-y
651     Append the line at point to the current search string.
652     @item M-y
653     Append the head of the kill ring to the search string.
654     @item @key{Backspace}
655     Delete the last element of the search string. This is not the same as
656     deleting the last character - for example, if the word at point has been
657     appended to the search string via @kbd{C-w}, this order will delete the
658     entire word, not just the last character of the word.
659     @item @key{Newline}
660     Exit the isearch command loop.
661     @end table
662    
663     @node Replacing single strings
664     @subsection Replacing single strings
665    
666     The basic string-replacement command can be accessed through the order
667     @kbd{C-x e}
668     @kindex C-x e
669     (@command{Replace String}). This command will prompt for two strings,
670     and replace all instances of the first string following point in the
671     current buffer, with the second string. This command is not querying,
672     and will thus not prompt before each replacement, so if you desire this
673     behavior, use the order @kbd{M-%}
674     @kindex M-%
675     (@command{Query Replace}) instead. @xref{The query-replace command loop}.
676    
677     @node Replacing multiple different strings
678     @subsection Replacing multiple different strings
679    
680     It is often desirable to be able to replace multiple, different strings
681     with one command - for instance, you might want to replace all
682     occurrences of ``foo'' with ``bar'' and all occurrences of ``bar'' with
683     ``baz'', without having the replacements affect each other. For this,
684 thenriksen 1.11 @climacs{} provides the command @command{Multiple Query Replace}, which
685 thenriksen 1.10 will prompt for pairs of strings, replacing the first with the second.
686     Entering an empty search string stops the prompting and starts the
687     query-replace command loop. It is also possible to use @command{Multiple
688     Query Replace From Buffer}, which will read the string pairs from a
689     buffer provided by the user.
690    
691     If you wish to exchange two strings for one another, use the command
692     @command{Query Exchange}, which will prompt for two strings, and replace
693     them for each other in the current buffer.
694    
695     @node The query-replace command loop
696     @subsection The query-replace command loop
697    
698     When invoking one of the querying replace commands, you will enter a
699     command loop with specialized commands for manipulating the replacement
700     process.
701    
702     The command loop will loop across the buffer, and for each match, the
703     command loop will read an order from the user. The following orders and
704     their corresponding commands are available:
705    
706     @table @kbd
707     @item y, @key{Space}
708     Replace the current match with the provided string, go to next
709     match.
710     @item n, @key{Rubout}, @key{Backspace}
711     Do not replace the current match, go to next match.
712     @item q, @key{Newline}
713     Quit the command loop, preserving all replacements already made.
714     @item .
715     Replace the current match with the provided string and quit the
716     command loop.
717     @item !
718     Replace all matches with the provided replacement strings.
719     @end table
720    
721 rstrandh 1.4 @node Getting help
722     @chapter Getting help
723    
724     In addition to this manual, @climacs{} contains an online help
725     facility. There are several different topics that you can get help
726     with. Most of these topics are obtained by some order using the
727     @kbd{C-h}
728     @kindex C-h
729 thenriksen 1.9 prefix key. The key following @kbd{C-h} determines what kind of help
730 rstrandh 1.4 information is displayed.
731    
732     @menu
733 thenriksen 1.10 * Help with a command::
734 rstrandh 1.4 * Help with a key binding::
735     * Help with a particular key sequence::
736 thenriksen 1.10 * Help finding a command::
737 rstrandh 1.4 * Help finding an order for a command::
738     @end menu
739    
740 thenriksen 1.9 @node Help with a command
741     @section Help with a command
742    
743     To get documentation about a particular command, use the order @kbd{C-h
744     f}
745     @kindex C-h f
746 thenriksen 1.12 (@command{Describe Command}). You will be prompted for the name of a
747     command, and if you provide a valid command name, a typeout pane
748 thenriksen 1.9 containing information about which function the command calls, which
749     gestures the command can be invoked through, as well as a description of
750     the command, will be displayed.
751    
752 rstrandh 1.4 @node Help with a key binding
753     @section Help with a key binding
754    
755     To obtain a list of all orders and the associated commands that are
756     valid in a particular context, use the order @kbd{C-h b}
757     @kindex C-h b
758     (@command{Describe Bindings}). A table with each command name and
759     associated order (if any) is displayed in a new window.
760    
761     @node Help with a particular key sequence
762     @section Help with a particular key sequence
763    
764     To obtain a description of what some putative order will do, use the
765 thenriksen 1.10 order @kbd{C-h c}p
766 rstrandh 1.4 @kindex C-h c
767 rstrandh 1.6 (@command{Describe Key Briefly}). You will be prompted for a key
768 rstrandh 1.4 sequence. If the key sequence you type is bound to a command, the
769 rstrandh 1.6 command name will be displayed in the minibuffer. Otherwise, a message
770 rstrandh 1.4 indicating that the key is not bound to a command will be displayed.
771    
772 thenriksen 1.9 For more detailed information, use the order @kbd{C-h c}
773     @kindex C-h k
774     (@command{Describe Key}). You will be prompted for a key sequence, and
775     if the key sequence you provide is bound to a command, documentation for
776     that command, as well as any arguments the given key binding calls the
777 thenriksen 1.12 command with, will be shown in a typeout pane.
778 thenriksen 1.9
779     @node Help finding a command
780 thenriksen 1.12 @section Help finding a command
781 thenriksen 1.9
782     If you do not know which commands are applicable to a given situation,
783     you can use the order @kbd{C-h a}
784     @kindex C-h a
785     (@command{Apropos Command}) to perform a keyword-based search for
786 thenriksen 1.12 commands. You will be prompted for a keyword, after which @climacs{}
787     will search through the available commands for commands that are
788     connected to the keyword. If commands are found, they will be displayed
789     in a typeout pane along with the gestures you can use to invoke
790     them. You can also click on the names of the commands to get more
791     thorough documentation.
792 thenriksen 1.9
793 rstrandh 1.4 @node Help finding an order for a command
794     @section Help finding an order for a command
795    
796     Sometimes, you know the name of a command, and would like to find out
797     whether it is bound to any order, and if so, which one(s). For that,
798     you can use the order @kbd{C-h w}
799     @kindex C-h w
800     (@command{Where Is}). You will be prompted for a command name
801     (completion can be used as usual), and if the command name given is
802     bound to an order, that order will displayed in the minibuffer.
803     Otherwise, a message indicating that the command is not bound to any
804     order will be displayed.
805 rstrandh 1.7
806     @node Proposal for new buffer/pane relations
807     @chapter Proposal for new buffer/pane relations
808    
809     There is a proposal on the table to make the way @climacs{} manages
810     buffers and panes incompatible with that of Emacs, and in the process
811     thus cleaning up 30 years of baggage.
812    
813     The proposal is to no longer allow buffers without panes. Instead, a
814     buffer will always be associated with at least one pane, though that
815     pane could be adopted or disowned to make it visible or invisible.
816     The advantage of this organization is that a buffer will no longer
817     contain a point. Also, panes can contain other things that buffers
818     such as buffer lists, debugger applications, etc.
819    
820     For this to work, we need to define how the effect of certain
821     commands related to buffers and windows will be altered. The proposal
822     is:
823    
824     C-x 2 creates an additional pane with its own point and that shares
825     the buffer of the current pane. It also adopts the new pane by the
826     same mechanism used now (creating a vbox pane containing the two. C-x
827     3 is similar except that it uses a hbox instead.
828    
829     C-x 0 does not destroy the pane, but just disowns it (by replacing the
830     rack it is in by the pane itself).
831    
832     C-x 1 does the equivalent of C-x 0 on all other visible panes.
833    
834     C-x k kills the current pane. If that happens to be the last pane
835     containing a particular buffer, then the buffer is lost as well.
836    
837     C-x b replaces the current pane by some arbitrary pane displaying the
838     buffer that has been requested (or creates a new buffer and a new pane
839     if the buffer requested does not exist?).
840 rstrandh 1.1
841     @node Key Index
842     @unnumbered Key Index
843    
844     @printindex ky
845    
846     @node Concept Index
847     @unnumbered Concept Index
848    
849     @printindex cp
850    
851     @bye

  ViewVC Help
Powered by ViewVC 1.1.5