This commit was manufactured by cvs2svn to create branch 'utf-2000'.
[chise/xemacs-chise.git-] / info / xemacs.info-5
1 This is ../info/xemacs.info, produced by makeinfo version 4.0 from
2 xemacs/xemacs.texi.
3
4 INFO-DIR-SECTION XEmacs Editor
5 START-INFO-DIR-ENTRY
6 * XEmacs: (xemacs).             XEmacs Editor.
7 END-INFO-DIR-ENTRY
8
9    This file documents the XEmacs editor.
10
11    Copyright (C) 1985, 1986, 1988 Richard M. Stallman.  Copyright (C)
12 1991, 1992, 1993, 1994 Lucid, Inc.  Copyright (C) 1993, 1994 Sun
13 Microsystems, Inc.  Copyright (C) 1995 Amdahl Corporation.
14
15    Permission is granted to make and distribute verbatim copies of this
16 manual provided the copyright notice and this permission notice are
17 preserved on all copies.
18
19    Permission is granted to copy and distribute modified versions of
20 this manual under the conditions for verbatim copying, provided also
21 that the sections entitled "The GNU Manifesto", "Distribution" and "GNU
22 General Public License" are included exactly as in the original, and
23 provided that the entire resulting derived work is distributed under the
24 terms of a permission notice identical to this one.
25
26    Permission is granted to copy and distribute translations of this
27 manual into another language, under the above conditions for modified
28 versions, except that the sections entitled "The GNU Manifesto",
29 "Distribution" and "GNU General Public License" may be included in a
30 translation approved by the author instead of in the original English.
31
32 \1f
33 File: xemacs.info,  Node: Mark Ring,  Prev: Marking Objects,  Up: Mark
34
35 The Mark Ring
36 -------------
37
38    Aside from delimiting the region, the mark is also useful for marking
39 a spot that you may want to go back to.  To make this feature more
40 useful, Emacs remembers 16 previous locations of the mark in the "mark
41 ring".  Most commands that set the mark push the old mark onto this
42 ring.  To return to a marked location, use `C-u C-<SPC>' (or `C-u
43 C-@'); this is the command `set-mark-command' given a numeric argument.
44 The command moves point to where the mark was, and restores the mark
45 from the ring of former marks. Repeated use of this command moves point
46 to all the old marks on the ring, one by one.  The marks you have seen
47 go to the end of the ring, so no marks are lost.
48
49    Each buffer has its own mark ring.  All editing commands use the
50 current buffer's mark ring.  In particular, `C-u C-<SPC>' always stays
51 in the same buffer.
52
53    Many commands that can move long distances, such as `M-<'
54 (`beginning-of-buffer'), start by setting the mark and saving the old
55 mark on the mark ring.  This makes it easier for you to move back
56 later.  Searches set the mark, unless they do not actually move point.
57 When a command sets the mark, `Mark Set' is printed in the echo area.
58
59    The variable `mark-ring-max' is the maximum number of entries to
60 keep in the mark ring.  If that many entries exist and another entry is
61 added, the last entry in the list is discarded.  Repeating `C-u
62 C-<SPC>' circulates through the entries that are currently in the ring.
63
64    The variable `mark-ring' holds the mark ring itself, as a list of
65 marker objects in the order most recent first.  This variable is local
66 in every buffer.
67
68 \1f
69 File: xemacs.info,  Node: Mouse Selection,  Next: Additional Mouse Operations,  Prev: Mark,  Up: Top
70
71 Selecting Text with the Mouse
72 =============================
73
74    If you are using XEmacs under X, you can use the mouse pointer to
75 select text. (The normal mouse pointer is an I-beam, the same pointer
76 that `xterm' uses.)
77
78    The glyph variable `text-pointer-glyph' controls the shape of the
79 mouse pointer when over text.  You can also control the shape of the
80 mouse pointer when over nontext using `nontext-pointer-glyph', and the
81 shape of the mouse pointer when over the modeline using
82 `modeline-pointer-glyph'. (Remember, you should use `set-glyph-image',
83 not `setq', to set one of these variables.)
84
85    If you want to get fancy, you can set the foreground and background
86 colors of the mouse pointer by setting the `pointer' face.
87
88    There are two ways to select a region of text with the mouse:
89
90    To select a word in text, double-click with the left mouse button
91 while the mouse cursor is over the word.  The word is highlighted when
92 selected. On monochrome monitors, a stippled background indicates that a
93 region of text has been highlighted. On color monitors, a color
94 background indicates highlighted text. You can triple-click to select
95 whole lines.
96
97    To select an arbitrary region of text:
98
99   1. Move the mouse cursor over the character at the beginning of the
100      region of text you want to select.
101
102   2. Press and hold the left mouse button.
103
104   3. While holding the left mouse button down, drag the cursor to the
105      character at the end of the region of text you want to select.
106
107   4. Release the left mouse button.
108         The selected region of text is highlighted.
109
110    Once a region of text is selected, it becomes the primary X selection
111 (*note Using X Selections::) as well as the Emacs selected region. You
112 can paste it into other X applications and use the options from the
113 Edit pull-down menu on it.  Since it is also the Emacs region, you can
114 use Emacs region commands on it.
115
116 \1f
117 File: xemacs.info,  Node: Additional Mouse Operations,  Next: Killing,  Prev: Mouse Selection,  Up: Top
118
119 Additional Mouse Operations
120 ===========================
121
122    XEmacs also provides the following mouse functions.  Most of these
123 are not bound to mouse gestures by default, but they are provided for
124 your customization pleasure.  For example, if you wanted `shift-left'
125 (that is, holding down the <Shift> key and clicking the left mouse
126 button) to delete the character at which you are pointing, then you
127 could do this:
128
129      (global-set-key '(shift button1) 'mouse-del-char)
130
131 `mouse-del-char'
132      Delete the character pointed to by the mouse.
133
134 `mouse-delete-window'
135      Delete the Emacs window that the mouse is on.
136
137 `mouse-keep-one-window'
138      Select the Emacs window that the mouse is on, then delete all other
139      windows on this frame.
140
141 `mouse-kill-line'
142      Kill the line pointed to by the mouse.
143
144 `mouse-line-length'
145      Print the length of the line indicated by the pointer.
146
147 `mouse-scroll'
148      Scroll point to the mouse position.
149
150 `mouse-select'
151      Select the Emacs window the mouse is on.
152
153 `mouse-select-and-split'
154      Select the Emacs window mouse is on, then split it vertically in
155      half.
156
157 `mouse-set-mark'
158      Select the Emacs window the mouse is on and set the mark at the
159      mouse position.  Display the cursor at that position for a second.
160
161 `mouse-set-point'
162      Select the Emacs window that the mouse is on and move point to the
163      mouse position.
164
165 `mouse-track'
166      Make a selection with the mouse.   This is the default binding of
167      the left mouse button (<button1>).
168
169 `mouse-track-adjust'
170      Extend the existing selection.  This is the default binding of
171      <Shift-button1>.
172
173 `mouse-track-and-copy-to-cutbuffer'
174      Make a selection like `mouse-track', but also copy it to the cut
175      buffer.
176
177 `mouse-track-delete-and-insert'
178      Make a selection with the mouse and insert it at point.  This is
179      the default binding of <control-shift-button1>.
180
181 `mouse-track-insert'
182      Make a selection with the mouse and insert it at point.  This is
183      the default binding of <control-button1>.
184
185 `mouse-window-to-region'
186      Narrow a window to the region between the cursor and the mouse
187      pointer.
188
189    The `M-x mouse-track' command should be bound to a mouse button.  If
190 you click-and-drag, the selection is set to the region between the
191 point of the initial click and the point at which you release the
192 button.  These positions do not need to be ordered.
193
194    If you click-and-release without moving the mouse, the point is
195 moved, and the selection is disowned (there will be no selection
196 owner.)  The mark will be set to the previous position of point.
197
198    If you double-click, the selection will extend by symbols instead of
199 by characters.  If you triple-click, the selection will extend by lines.
200
201    If you drag the mouse off the top or bottom of the window, you can
202 select pieces of text that are larger than the visible part of the
203 buffer; the buffer will scroll as necessary.
204
205    The selected text becomes the current X selection, and is also
206 copied to the top of the kill ring.  Point will be left at the position
207 at which you released the button and the mark will be left at the
208 initial click position.  Bind a mouse click to
209 `mouse-track-and-copy-to-cutbuffer' to copy selections to the cut
210 buffer.  (See also the `mouse-track-adjust' command, on
211 `Shift-button1'.)
212
213    The `M-x mouse-track-adjust' command should be bound to a mouse
214 button.  The selection will be enlarged or shrunk so that the point of
215 the mouse click is one of its endpoints.  This is only meaningful after
216 the `mouse-track' command (<button1>) has been executed.
217
218    The `M-x mouse-track-delete-and-insert' command is exactly the same
219 as the `mouse-track' command on <button1>, except that point is not
220 moved; the selected text is immediately inserted after being selected;
221 and the text of the selection is deleted.
222
223    The `M-x mouse-track-insert' command is exactly the same as the
224 `mouse-track' command on <button1>, except that point is not moved; the
225 selected text is immediately inserted after being selected; and the
226 selection is immediately disowned afterwards.
227
228 \1f
229 File: xemacs.info,  Node: Killing,  Next: Yanking,  Prev: Additional Mouse Operations,  Up: Top
230
231 Deletion and Killing
232 ====================
233
234    Most commands that erase text from the buffer save it. You can get
235 the text back if you change your mind, or you can move or copy it to
236 other parts of the buffer.  Commands which erase text and save it in the
237 kill ring are known as "kill" commands.  Some other commands erase text
238 but do not save it; they are known as "delete" commands.  (This
239 distinction is made only for erasing text in the buffer.)
240
241    The commands' names and individual descriptions use the words `kill'
242 and `delete' to indicate what they do.  If you perform a kill or delete
243 command by mistake, use the `C-x u' (`undo') command to undo it (*note
244 Undo::). The delete commands include `C-d' (`delete-char') and <DEL>
245 (`delete-backward-char'), which delete only one character at a time,
246 and those commands that delete only spaces or newlines.  Commands that
247 can destroy significant amounts of nontrivial data usually kill.
248
249 Deletion
250 --------
251
252 `C-d'
253      Delete next character (`delete-char').
254
255 `<DEL>'
256      Delete previous character (`delete-backward-char').
257
258 `M-\'
259      Delete spaces and tabs around point (`delete-horizontal-space').
260
261 `M-<SPC>'
262      Delete spaces and tabs around point, leaving one space
263      (`just-one-space').
264
265 `C-x C-o'
266      Delete blank lines around the current line (`delete-blank-lines').
267
268 `M-^'
269      Join two lines by deleting the intervening newline, and any
270      indentation following it (`delete-indentation').
271
272    The most basic delete commands are `C-d' (`delete-char') and <DEL>
273 (`delete-backward-char').  `C-d' deletes the character after point, the
274 one the cursor is "on top of".  Point doesn't move.  <DEL> deletes the
275 character before the cursor, and moves point back.  You can delete
276 newlines like any other characters in the buffer; deleting a newline
277 joins two lines.  Actually, `C-d' and <DEL> aren't always delete
278 commands; if you give them an argument, they kill instead, since they
279 can erase more than one character this way.
280
281    The other delete commands delete only formatting characters: spaces,
282 tabs and newlines.  `M-\' (`delete-horizontal-space') deletes all
283 spaces and tab characters before and after point.  `M-<SPC>'
284 (`just-one-space') does the same but leaves a single space after point,
285 regardless of the number of spaces that existed previously (even zero).
286
287    `C-x C-o' (`delete-blank-lines') deletes all blank lines after the
288 current line. If the current line is blank, it deletes all blank lines
289 preceding the current line as well as leaving one blank line, the
290 current line.  `M-^' (`delete-indentation') joins the current line and
291 the previous line, or, if given an argument, joins the current line and
292 the next line by deleting a newline and all surrounding spaces, possibly
293 leaving a single space.  *Note M-^: Indentation.
294
295 Killing by Lines
296 ----------------
297
298 `C-k'
299      Kill rest of line or one or more lines (`kill-line').
300
301    The simplest kill command is `C-k'.  If given at the beginning of a
302 line, it kills all the text on the line, leaving the line blank.  If
303 given on a blank line, the blank line disappears.  As a consequence, a
304 line disappears completely if you go to the front of a non-blank line
305 and type `C-k' twice.
306
307    More generally, `C-k' kills from point up to the end of the line,
308 unless it is at the end of a line.  In that case, it kills the newline
309 following the line, thus merging the next line into the current one.
310 Emacs ignores invisible spaces and tabs at the end of the line when
311 deciding which case applies: if point appears to be at the end of the
312 line, you can be sure the newline will be killed.
313
314    If you give `C-k' a positive argument, it kills that many lines and
315 the newlines that follow them (however, text on the current line before
316 point is not killed).  With a negative argument, `C-k' kills back to a
317 number of line beginnings.  An argument of -2 means kill back to the
318 second line beginning.  If point is at the beginning of a line, that
319 line beginning doesn't count, so `C-u - 2 C-k' with point at the front
320 of a line kills the two previous lines.
321
322    `C-k' with an argument of zero kills all the text before point on the
323 current line.
324
325 Other Kill Commands
326 -------------------
327
328 `C-w'
329      Kill region (from point to the mark) (`kill-region').  *Note
330      Words::.
331
332 `M-d'
333      Kill word (`kill-word').
334
335 `M-<DEL>'
336      Kill word backwards (`backward-kill-word').
337
338 `C-x <DEL>'
339      Kill back to beginning of sentence (`backward-kill-sentence').
340      *Note Sentences::.
341
342 `M-k'
343      Kill to end of sentence (`kill-sentence').
344
345 `C-M-k'
346      Kill sexp (`kill-sexp').  *Note Lists::.
347
348 `M-z CHAR'
349      Kill up to next occurrence of CHAR (`zap-to-char').
350
351    `C-w' (`kill-region') is a very general kill command; it kills
352 everything between point and the mark. You can use this command to kill
353 any contiguous sequence of characters by first setting the mark at one
354 end of a sequence of characters, then going to the other end and typing
355 `C-w'.
356
357    A convenient way of killing is combined with searching: `M-z'
358 (`zap-to-char') reads a character and kills from point up to (but not
359 including) the next occurrence of that character in the buffer.  If
360 there is no next occurrence, killing goes to the end of the buffer.  A
361 numeric argument acts as a repeat count.  A negative argument means to
362 search backward and kill text before point.
363
364    Other syntactic units can be killed: words, with `M-<DEL>' and `M-d'
365 (*note Words::); sexps, with `C-M-k' (*note Lists::); and sentences,
366 with `C-x <DEL>' and `M-k' (*note Sentences::).
367
368 \1f
369 File: xemacs.info,  Node: Yanking,  Next: Using X Selections,  Prev: Killing,  Up: Top
370
371 Yanking
372 =======
373
374    "Yanking" means getting back text which was killed. Some systems
375 call this "pasting".  The usual way to move or copy text is to kill it
376 and then yank it one or more times.
377
378 `C-y'
379      Yank last killed text (`yank').
380
381 `M-y'
382      Replace re-inserted killed text with the previously killed text
383      (`yank-pop').
384
385 `M-w'
386      Save region as last killed text without actually killing it
387      (`copy-region-as-kill').
388
389 `C-M-w'
390      Append next kill to last batch of killed text (`append-next-kill').
391
392 * Menu:
393
394 * Kill Ring::       Where killed text is stored.  Basic yanking.
395 * Appending Kills:: Several kills in a row all yank together.
396 * Earlier Kills::   Yanking something killed some time ago.
397
398 \1f
399 File: xemacs.info,  Node: Kill Ring,  Next: Appending Kills,  Prev: Yanking,  Up: Yanking
400
401 The Kill Ring
402 -------------
403
404    All killed text is recorded in the "kill ring", a list of blocks of
405 text that have been killed.  There is only one kill ring, used in all
406 buffers, so you can kill text in one buffer and yank it in another
407 buffer.  This is the usual way to move text from one file to another.
408 (*Note Accumulating Text::, for some other ways.)
409
410    If you have two separate Emacs processes, you cannot use the kill
411 ring to move text. If you are using XEmacs under X, however, you can
412 use the X selection mechanism to move text from one to another.
413
414    If you are using XEmacs under X and have one Emacs process with
415 multiple frames, they do share the same kill ring.  You can kill or
416 copy text in one Emacs frame, then yank it in the other frame belonging
417 to the same process.
418
419    The command `C-y' (`yank') reinserts the text of the most recent
420 kill.  It leaves the cursor at the end of the text and sets the mark at
421 the beginning of the text.  *Note Mark::.
422
423    `C-u C-y' yanks the text, leaves the cursor in front of the text,
424 and sets the mark after it, if the argument is with just a `C-u'.  Any
425 other argument, including `C-u' and digits, has different results,
426 described below, under "Yanking Earlier Kills".
427
428    To copy a block of text, you can also use `M-w'
429 (`copy-region-as-kill'), which copies the region into the kill ring
430 without removing it from the buffer. `M-w' is similar to `C-w' followed
431 by `C-y' but does not mark the buffer as "modified" and does not
432 actually cut anything.
433
434 \1f
435 File: xemacs.info,  Node: Appending Kills,  Next: Earlier Kills,  Prev: Kill Ring,  Up: Yanking
436
437 Appending Kills
438 ---------------
439
440    Normally, each kill command pushes a new block onto the kill ring.
441 However, two or more kill commands in a row combine their text into a
442 single entry, so that a single `C-y' yanks it all back. This means you
443 don't have to kill all the text you want to yank in one command; you
444 can kill line after line, or word after word, until you have killed what
445 you want, then get it all back at once using `C-y'. (Thus we join
446 television in leading people to kill thoughtlessly.)
447
448    Commands that kill forward from point add onto the end of the
449 previous killed text.  Commands that kill backward from point add onto
450 the beginning.  This way, any sequence of mixed forward and backward
451 kill commands puts all the killed text into one entry without
452 rearrangement.  Numeric arguments do not break the sequence of
453 appending kills.  For example, suppose the buffer contains:
454
455      This is the first
456      line of sample text
457      and here is the third.
458
459 with point at the beginning of the second line.  If you type `C-k C-u 2
460 M-<DEL> C-k', the first `C-k' kills the text `line of sample text',
461 `C-u 2 M-<DEL>' kills `the first' with the newline that followed it,
462 and the second `C-k' kills the newline after the second line.  The
463 result is that the buffer contains `This is and here is the third.' and
464 a single kill entry contains `the first<RET>line of sample
465 text<RET>'--all the killed text, in its original order.
466
467    If a kill command is separated from the last kill command by other
468 commands (not just numeric arguments), it starts a new entry on the kill
469 ring.  To force a kill command to append, first type the command `C-M-w'
470 (`append-next-kill'). `C-M-w' tells the following command, if it is a
471 kill command, to append the text it kills to the last killed text,
472 instead of starting a new entry.  With `C-M-w', you can kill several
473 separated pieces of text and accumulate them to be yanked back in one
474 place.
475
476 \1f
477 File: xemacs.info,  Node: Earlier Kills,  Prev: Appending Kills,  Up: Yanking
478
479 Yanking Earlier Kills
480 ---------------------
481
482    To recover killed text that is no longer the most recent kill, you
483 need the `Meta-y' (`yank-pop') command.  You can use `M-y' only after a
484 `C-y' or another `M-y'.  It takes the text previously yanked and
485 replaces it with the text from an earlier kill.  To recover the text of
486 the next-to-the-last kill, first use `C-y' to recover the last kill,
487 then `M-y' to replace it with the previous kill.
488
489    You can think in terms of a "last yank" pointer which points at an
490 item in the kill ring.  Each time you kill, the "last yank" pointer
491 moves to the new item at the front of the ring.  `C-y' yanks the item
492 which the "last yank" pointer points to.  `M-y' moves the "last yank"
493 pointer to a different item, and the text in the buffer changes to
494 match.  Enough `M-y' commands can move the pointer to any item in the
495 ring, so you can get any item into the buffer.  Eventually the pointer
496 reaches the end of the ring; the next `M-y' moves it to the first item
497 again.
498
499    Yanking moves the "last yank" pointer around the ring, but does not
500 change the order of the entries in the ring, which always runs from the
501 most recent kill at the front to the oldest one still remembered.
502
503    Use `M-y' with a numeric argument to advance the "last yank" pointer
504 by the specified number of items.  A negative argument moves the
505 pointer toward the front of the ring; from the front of the ring, it
506 moves to the last entry and starts moving forward from there.
507
508    Once the text you are looking for is brought into the buffer, you can
509 stop doing `M-y' commands and the text will stay there. Since the text
510 is just a copy of the kill ring item, editing it in the buffer does not
511 change what's in the ring.  As long you don't kill additional text, the
512 "last yank" pointer remains at the same place in the kill ring:
513 repeating `C-y' will yank another copy of the same old kill.
514
515    If you know how many `M-y' commands it would take to find the text
516 you want, you can yank that text in one step using `C-y' with a numeric
517 argument.  `C-y' with an argument greater than one restores the text
518 the specified number of entries back in the kill ring.  Thus, `C-u 2
519 C-y' gets the next to the last block of killed text.  It is equivalent
520 to `C-y M-y'.  `C-y' with a numeric argument starts counting from the
521 "last yank" pointer, and sets the "last yank" pointer to the entry that
522 it yanks.
523
524    The variable `kill-ring-max' controls the length of the kill ring;
525 no more than that many blocks of killed text are saved.
526
527 \1f
528 File: xemacs.info,  Node: Using X Selections,  Next: Accumulating Text,  Prev: Yanking,  Up: Top
529
530 Using X Selections
531 ==================
532
533    In the X window system, mouse selections provide a simple mechanism
534 for text transfer between different applications.  In a typical X
535 application, you can select text by pressing the left mouse button and
536 dragging the cursor over the text you want to copy.  The text becomes
537 the primary X selection and is highlighted.  The highlighted region is
538 also the Emacs selected region.
539
540    * Since the region is the primary X selection, you can go to a
541      different X application and click the middle mouse button: the
542      text that you selected in the previous application is pasted into
543      the current application.
544
545    * Since the region is the Emacs selected region, you can use all
546      region commands (`C-w, M-w' etc.) as well as the options of the
547      Edit menu to manipulate the selected text.
548
549 * Menu:
550
551 * X Clipboard Selection::       Pasting to the X clipboard.
552 * X Selection Commands::        Other operations on the selection.
553 * X Cut Buffers::               X cut buffers are available for compatibility.
554 * Active Regions::              Using zmacs-style highlighting of the
555                                  selected region.
556
557 \1f
558 File: xemacs.info,  Node: X Clipboard Selection,  Next: X Selection Commands,  Prev: Using X Selections,  Up: Using X Selections
559
560 The Clipboard Selection
561 -----------------------
562
563    There are other kinds of X selections besides the Primary selection;
564 one common one is the Clipboard selection.  Some applications prefer to
565 transfer data using this selection in preference to the Primary.  One
566 can transfer text from the Primary selection to the  Clipboard
567 selection with the Copy command under the Edit menu in the menubar.
568
569    Usually, the clipboard selection is not visible.  However, if you
570 run the `xclipboard' application, the text most recently copied to the
571 clipboard (with the Copy command) is displayed in a window.  Any time
572 new text is thus copied, the `xclipboard' application makes a copy of
573 it and displays it in its window.  The value of the clipboard can
574 survive the lifetime of the running Emacs process.  The `xclipboard'
575 man page provides more details.
576
577    Warning: If you use the `xclipboard' application, remember that it
578 maintains a list of all things that have been pasted to the clipboard
579 (that is, copied with the Copy command).  If you don't manually delete
580 elements from this list by clicking on the Delete button in the
581 `xclipboard' window, the clipboard will eventually consume a lot of
582 memory.
583
584    In summary, some X applications (such as `xterm') allow one to paste
585 text in them from XEmacs in the following way:
586
587    * Drag out a region of text in Emacs with the left mouse button,
588      making that text be the Primary selection.
589
590    * Click the middle button in the other application, pasting the
591      Primary selection.
592
593    With some other applications (notably, the OpenWindows and Motif
594 tools) you must use this method instead:
595
596    * Drag out a region of text in Emacs with the left mouse button,
597      making that text be the Primary selection.
598
599    * Copy the selected text to the Clipboard selection by selecting the
600      Copy menu item from the Edit menu, or by hitting the Copy key on
601      your keyboard.
602
603    * Paste the text in the other application by selecting Paste from its
604      menu, or by hitting the Paste key on your keyboard.
605
606 \1f
607 File: xemacs.info,  Node: X Selection Commands,  Next: X Cut Buffers,  Prev: X Clipboard Selection,  Up: Using X Selections
608
609 Miscellaneous X Selection Commands
610 ----------------------------------
611
612 `M-x x-copy-primary-selection'
613      Copy the primary selection to both the kill ring and the Clipboard.
614
615 `M-x x-insert-selection'
616      Insert the current selection into the buffer at point.
617
618 `M-x x-delete-primary-selection'
619      Deletes the text in the primary selection without copying it to
620      the kill ring or the Clipboard.
621
622 `M-x x-kill-primary-selection'
623      Deletes the text in the primary selection and copies it to both
624      the kill ring and the Clipboard.
625
626 `M-x x-mouse-kill'
627      Kill the text between point and the mouse and copy it to the
628      clipboard and to the cut buffer.
629
630 `M-x x-own-secondary-selection'
631      Make a secondary X selection of the given argument.
632
633 `M-x x-own-selection'
634      Make a primary X selection of the given argument.
635
636 `M-x x-set-point-and-insert-selection'
637      Set point where clicked and insert the primary selection or the
638      cut buffer.
639
640 \1f
641 File: xemacs.info,  Node: X Cut Buffers,  Next: Active Regions,  Prev: X Selection Commands,  Up: Using X Selections
642
643 X Cut Buffers
644 -------------
645
646    X cut buffers are a different, older way of transferring text between
647 applications.  XEmacs supports cut buffers for compatibility with older
648 programs, even though selections are now the preferred way of
649 transferring text.
650
651    X has a concept of applications "owning" selections.  When you select
652 text by clicking and dragging inside an application, the application
653 tells the X server that it owns the selection.  When another
654 application asks the X server for the value of the selection, the X
655 server requests the information from the owner. When you use
656 selections, the selection data is not actually transferred unless
657 someone wants it; the act of making a selection doesn't transfer data.
658 Cut buffers are different: when you "own" a cut buffer, the data is
659 actually transferred to the X server immediately, and survives the
660 lifetime of the application.
661
662    Any time a region of text becomes the primary selection in Emacs,
663 Emacs also copies that text to the cut buffer.  This makes it possible
664 to copy text from an XEmacs buffer and paste it into an older,
665 non-selection-based application (such as Emacs 18).
666
667    Note: Older versions of Emacs could not access the X selections, only
668 the X cut buffers.
669
670 \1f
671 File: xemacs.info,  Node: Active Regions,  Prev: X Cut Buffers,  Up: Using X Selections
672
673 Active Regions
674 --------------
675
676    By default, both the text you select in an Emacs buffer using the
677 click-and-drag mechanism and text you select by setting point and the
678 mark is highlighted. You can use Emacs region commands as well as the
679 Cut and Copy commands on the highlighted region you selected with the
680 mouse.
681
682    If you prefer, you can make a distinction between text selected with
683 the mouse and text selected with point and the mark by setting the
684 variable `zmacs-regions' to `nil'.  In that case:
685
686    * The text selected with the mouse becomes both the X selection and
687      the Emacs selected region. You can use menu-bar commands as well
688      as Emacs region commands on it.
689
690    * The text selected with point and the mark is not highlighted. You
691      can only use Emacs region commands on it, not the menu-bar items.
692
693    Active regions originally come from Zmacs, the Lisp Machine editor.
694 The idea behind them is that commands can only operate on a region when
695 the region is in an "active" state.  Put simply, you can only operate on
696 a region that is highlighted.
697
698    The variable `zmacs-regions' checks whether LISPM-style active
699 regions should be used.  This means that commands that operate on the
700 region (the area between point and the mark) only work while the region
701 is in the active state, which is indicated by highlighting.  Most
702 commands causes the region to not be in the active state; for example,
703 `C-w' only works immediately after activating the region.
704
705    More specifically:
706    * Commands that operate on the region only work if the region is
707      active.
708
709    * Only a very small set of commands causes the region to become
710      active-- those commands whose semantics are to mark an area, such
711      as `mark-defun'.
712
713    * The region is deactivated after each command that is executed,
714      except that motion commands do not change whether the region is
715      active or not.
716
717    `set-mark-command' (`C-SPC') pushes a mark and activates the region.
718 Moving the cursor with normal motion commands (`C-n', `C-p', etc.)
719 will cause the region between point and the recently-pushed mark to be
720 highlighted.  It will remain highlighted until some non-motion command
721 is executed.
722
723    `exchange-point-and-mark' (`C-x C-x') activates the region.  So if
724 you mark a region and execute a command that operates on it, you can
725 reactivate the same region with `C-x C-x' (or perhaps `C-x C-x C-x
726 C-x') to operate on it again.
727
728    Generally, commands that push marks as a means of navigation, such as
729 `beginning-of-buffer' (`M-<') and `end-of-buffer' (`M->'), do not
730 activate the region.  However, commands that push marks as a means of
731 marking an area of text, such as `mark-defun' (`M-C-h'), `mark-word'
732 (`M-@'), and `mark-whole-buffer' (`C-x h'), do activate the region.
733
734    When `zmacs-regions' is `t', there is no distinction between the
735 primary X selection and the active region selected by point and the
736 mark.  To see this, set the mark (<C-SPC>) and move the cursor with any
737 cursor-motion command: the region between point and mark is
738 highlighted, and you can watch it grow and shrink as you move the
739 cursor.
740
741    Any other commands besides cursor-motion commands (such as inserting
742 or deleting text) will cause the region to no longer be active; it will
743 no longer be highlighted, and will no longer be the primary selection.
744 Region can be explicitly deactivated with `C-g'.
745
746    Commands that require a region (such as `C-w') signal an error if
747 the region is not active.  Certain commands cause the region to be in
748 its active state.  The most common ones are `push-mark' (<C-SPC>) and
749 `exchange-point-and-mark' (`C-x C-x').
750
751    When `zmacs-regions' is `t', programs can be non-intrusive on the
752 state of the region by setting the variable `zmacs-region-stays' to a
753 non-`nil' value.  If you are writing a new Emacs command that is
754 conceptually a "motion" command and should not interfere with the
755 current highlightedness of the region, then you may set this variable.
756 It is reset to `nil' after each user command is executed.
757
758    When `zmacs-regions' is `t', programs can make the region between
759 point and mark go into the active (highlighted) state by using the
760 function `zmacs-activate-region'. Only a small number of commands
761 should ever do this.
762
763    When `zmacs-regions' is `t', programs can deactivate the region
764 between point and the mark by using `zmacs-deactivate-region'.  Note:
765 you should not have to call this function; the command loop calls it
766 when appropriate.
767
768 \1f
769 File: xemacs.info,  Node: Accumulating Text,  Next: Rectangles,  Prev: Using X Selections,  Up: Top
770
771 Accumulating Text
772 =================
773
774    Usually you copy or move text by killing it and yanking it, but
775 there are other ways that are useful for copying one block of text in
776 many places, or for copying many scattered blocks of text into one
777 place.
778
779    If you like, you can accumulate blocks of text from scattered
780 locations either into a buffer or into a file.  The relevant commands
781 are described here.  You can also use Emacs registers for storing and
782 accumulating text.  *Note Registers::.
783
784 `M-x append-to-buffer'
785      Append region to contents of specified buffer (`append-to-buffer').
786
787 `M-x prepend-to-buffer'
788      Prepend region to contents of specified buffer.
789
790 `M-x copy-to-buffer'
791      Copy region into specified buffer, deleting that buffer's old
792      contents.
793
794 `M-x insert-buffer'
795      Insert contents of specified buffer into current buffer at point.
796
797 `M-x append-to-file'
798      Append region to the end of the contents of specified file.
799
800    To accumulate text into a buffer, use the command `M-x
801 append-to-buffer', which inserts a copy of the region into the buffer
802 BUFFERNAME, at the location of point in that buffer.  If there is no
803 buffer with the given name, one is created.
804
805    If you append text to a buffer that has been used for editing, the
806 copied text goes to the place where point is.  Point in that buffer is
807 left at the end of the copied text, so successive uses of
808 `append-to-buffer' accumulate the text in the specified buffer in the
809 same order as they were copied.  Strictly speaking, this command does
810 not always append to the text already in the buffer; but if this command
811 is the only command used to alter a buffer, it does always append to the
812 existing text because point is always at the end.
813
814    `M-x prepend-to-buffer' is similar to `append-to-buffer', but point
815 in the other buffer is left before the copied text, so successive
816 prependings add text in reverse order.  `M-x copy-to-buffer' is
817 similar, except that any existing text in the other buffer is deleted,
818 so the buffer is left containing just the text newly copied into it.
819
820    You can retrieve the accumulated text from that buffer with `M-x
821 insert-buffer', which takes BUFFERNAME as an argument.  It inserts a
822 copy of the text in buffer BUFFERNAME into the selected buffer.  You
823 could alternatively select the other buffer for editing, perhaps moving
824 text from it by killing or with `append-to-buffer'.  *Note Buffers::,
825 for background information on buffers.
826
827    Instead of accumulating text within Emacs in a buffer, you can append
828 text directly into a file with `M-x append-to-file', which takes
829 FILE-NAME as an argument.  It adds the text of the region to the end of
830 the specified file.  The file is changed immediately on disk.  This
831 command is normally used with files that are not being visited in
832 Emacs.  Using it on a file that Emacs is visiting can produce confusing
833 results, because the file's text inside Emacs does not change while the
834 file itself changes.
835
836 \1f
837 File: xemacs.info,  Node: Rectangles,  Next: Registers,  Prev: Accumulating Text,  Up: Top
838
839 Rectangles
840 ==========
841
842    The rectangle commands affect rectangular areas of text: all
843 characters between a certain pair of columns, in a certain range of
844 lines.  Commands are provided to kill rectangles, yank killed
845 rectangles, clear them out, or delete them.  Rectangle commands are
846 useful with text in multicolumnar formats, like code with comments at
847 the right, or for changing text into or out of such formats.
848
849    To specify the rectangle a command should work on, put the mark at
850 one corner and point at the opposite corner.  The specified rectangle is
851 called the "region-rectangle" because it is controlled about the same
852 way the region is controlled.  Remember that a given combination of
853 point and mark values can be interpreted either as specifying a region
854 or as specifying a rectangle; it is up to the command that uses them to
855 choose the interpretation.
856
857 `M-x delete-rectangle'
858      Delete the text of the region-rectangle, moving any following text
859      on each line leftward to the left edge of the region-rectangle.
860
861 `M-x kill-rectangle'
862      Similar, but also save the contents of the region-rectangle as the
863      "last killed rectangle".
864
865 `M-x yank-rectangle'
866      Yank the last killed rectangle with its upper left corner at point.
867
868 `M-x open-rectangle'
869      Insert blank space to fill the space of the region-rectangle.  The
870      previous contents of the region-rectangle are pushed rightward.
871
872 `M-x clear-rectangle'
873      Clear the region-rectangle by replacing its contents with spaces.
874
875    The rectangle operations fall into two classes: commands deleting and
876 moving rectangles, and commands for blank rectangles.
877
878    There are two ways to get rid of the text in a rectangle: you can
879 discard the text (delete it) or save it as the "last killed" rectangle.
880 The commands for these two ways are `M-x delete-rectangle' and `M-x
881 kill-rectangle'.  In either case, the portion of each line that falls
882 inside the rectangle's boundaries is deleted, causing following text
883 (if any) on the line to move left.
884
885    Note that "killing" a rectangle is not killing in the usual sense;
886 the rectangle is not stored in the kill ring, but in a special place
887 that only records the most recently killed rectangle (that is, does not
888 append to a killed rectangle).  Different yank commands have to be used
889 and only one rectangle is stored, because yanking a rectangle is quite
890 different from yanking linear text and yank-popping commands are
891 difficult to make sense of.
892
893    Inserting a rectangle is the opposite of deleting one.  You specify
894 where to put the upper left corner by putting point there.  The
895 rectangle's first line is inserted at point, the rectangle's second line
896 is inserted at a point one line vertically down, and so on.  The number
897 of lines affected is determined by the height of the saved rectangle.
898
899    To insert the last killed rectangle, type `M-x yank-rectangle'.
900 This can be used to convert single-column lists into double-column
901 lists; kill the second half of the list as a rectangle and then yank it
902 beside the first line of the list.
903
904    There are two commands for working with blank rectangles: `M-x
905 clear-rectangle' erases existing text, and `M-x open-rectangle' inserts
906 a blank rectangle.  Clearing a rectangle is equivalent to deleting it
907 and then inserting a blank rectangle of the same size.
908
909    Rectangles can also be copied into and out of registers.  *Note
910 Rectangle Registers: RegRect.
911
912 \1f
913 File: xemacs.info,  Node: Registers,  Next: Display,  Prev: Rectangles,  Up: Top
914
915 Registers
916 *********
917
918    XEmacs "registers" are places in which you can save text or
919 positions for later use.  Once you save text or a rectangle in a
920 register, you can copy it into the buffer once or many times; a position
921 saved in a register is used by moving point to that position.
922 Rectangles can also be copied into and out of registers (*note
923 Rectangles::).
924
925    Each register has a name which is a single character.  A register can
926 store a piece of text, a rectangle, a position, a window configuration,
927 or a file name, but only one thing at any given time.  Whatever you
928 store in a register remains there until you store something else in that
929 register.  To see what a register R contains, use `M-x view-register'.
930
931 `M-x view-register <RET> R'
932      Display a description of what register R contains.
933
934    `M-x view-register' reads a register name as an argument and then
935 displays the contents of the specified register.
936
937 * Menu:
938
939 * Position: RegPos.           Saving positions in registers.
940 * Text: RegText.              Saving text in registers.
941 * Rectangle: RegRect.         Saving rectangles in registers.
942 * Configurations: RegConfig.  Saving window configurations in registers.
943 * Files: RegFiles.            File names in registers.
944 * Numbers: RegNumbers.        Numbers in registers.
945 * Bookmarks::                 Bookmarks are like registers, but persistent.
946
947 \1f
948 File: xemacs.info,  Node: RegPos,  Next: RegText,  Prev: Registers,  Up: Registers
949
950 Saving Positions in Registers
951 =============================
952
953    Saving a position records a place in a buffer so that you can move
954 back there later.  Moving to a saved position switches to that buffer
955 and moves point to that place in it.
956
957 `C-x r <SPC> R'
958      Save position of point in register R (`point-to-register').
959
960 `C-x r j R'
961      Jump to the position saved in register R (`jump-to-register').
962
963    To save the current position of point in a register, choose a name R
964 and type `C-x r <SPC> R'.  The register R retains the position thus
965 saved until you store something else in that register.
966
967    The command `C-x r j R' moves point to the position recorded in
968 register R.  The register is not affected; it continues to record the
969 same location.  You can jump to the same position using the same
970 register as often as you want.
971
972    If you use `C-x r j' to go to a saved position, but the buffer it
973 was saved from has been killed, `C-x r j' tries to create the buffer
974 again by visiting the same file.  Of course, this works only for buffers
975 that were visiting files.
976
977 \1f
978 File: xemacs.info,  Node: RegText,  Next: RegRect,  Prev: RegPos,  Up: Registers
979
980 Saving Text in Registers
981 ========================
982
983    When you want to insert a copy of the same piece of text many times,
984 it can be impractical to use the kill ring, since each subsequent kill
985 moves the piece of text further down on the ring.  It becomes hard to
986 keep track of the argument needed to retrieve the same text with `C-y'.
987 An alternative is to store the text in a register with `C-x r s'
988 (`copy-to-register') and then retrieve it with `C-x r i'
989 (`insert-register').
990
991 `C-x r s R'
992      Copy region into register R (`copy-to-register').
993
994 `C-x r g R'
995 `C-x r i R'
996      Insert text contents of register R (`insert-register').
997
998    `C-x r s R' stores a copy of the text of the region into the
999 register named R.  Given a numeric argument, `C-x r s R' deletes the
1000 text from the buffer as well.
1001
1002    `C-x r i R' inserts the text from register R in the buffer.  By
1003 default it leaves point before the text and places the mark after it.
1004 With a numeric argument (`C-u'), it puts point after the text and the
1005 mark before it.
1006
1007 \1f
1008 File: xemacs.info,  Node: RegRect,  Next: RegConfig,  Prev: RegText,  Up: Registers
1009
1010 Saving Rectangles in Registers
1011 ==============================
1012
1013    A register can contain a rectangle instead of lines of text.  The
1014 rectangle is represented as a list of strings.  *Note Rectangles::, for
1015 basic information on rectangles and how to specify rectangles in a
1016 buffer.
1017
1018 `C-x r r R'
1019      Copy the region-rectangle into register R
1020      (`copy-rectangle-to-register').  With a numeric argument, delete it
1021      as well.
1022
1023 `C-x r g R'
1024 `C-x r i R'
1025      Insert the rectangle stored in register R (if it contains a
1026      rectangle) (`insert-register').
1027
1028    The `C-x r i R' command inserts linear text if the register
1029 contains that, or inserts a rectangle if the register contains one.
1030
1031    See also the command `sort-columns', which you can think of as
1032 sorting a rectangle.  *Note Sorting::.
1033
1034 \1f
1035 File: xemacs.info,  Node: RegConfig,  Next: RegNumbers,  Prev: RegRect,  Up: Registers
1036
1037 Saving Window Configurations in Registers
1038 =========================================
1039
1040    You can save the window configuration of the selected frame in a
1041 register, or even the configuration of all windows in all frames, and
1042 restore the configuration later.
1043
1044 `C-x r w R'
1045      Save the state of the selected frame's windows in register R
1046      (`window-configuration-to-register').
1047
1048 `M-x frame-configuration-to-register <RET> R'
1049      Save the state of all frames, including all their windows, in
1050      register R (`frame-configuration-to-register').
1051
1052    Use `C-x r j R' to restore a window or frame configuration.  This is
1053 the same command used to restore a cursor position.  When you restore a
1054 frame configuration, any existing frames not included in the
1055 configuration become invisible.  If you wish to delete these frames
1056 instead, use `C-u C-x r j R'.
1057
1058 \1f
1059 File: xemacs.info,  Node: RegNumbers,  Next: RegFiles,  Prev: RegConfig,  Up: Registers
1060
1061 Keeping Numbers in Registers
1062 ============================
1063
1064    There are commands to store a number in a register, to insert the
1065 number in the buffer in decimal, and to increment it.  These commands
1066 can be useful in keyboard macros (*note Keyboard Macros::).
1067
1068 `C-u NUMBER C-x r n REG'
1069      Store NUMBER into register REG (`number-to-register').
1070
1071 `C-u NUMBER C-x r + REG'
1072      Increment the number in register REG by NUMBER
1073      (`increment-register').
1074
1075 `C-x r g REG'
1076      Insert the number from register REG into the buffer.
1077
1078    `C-x r g' is the same command used to insert any other sort of
1079 register contents into the buffer.
1080
1081 \1f
1082 File: xemacs.info,  Node: RegFiles,  Next: Bookmarks,  Prev: RegNumbers,  Up: Registers
1083
1084 Keeping File Names in Registers
1085 ===============================
1086
1087    If you visit certain file names frequently, you can visit them more
1088 conveniently if you put their names in registers.  Here's the Lisp code
1089 used to put a file name in a register:
1090
1091      (set-register ?R '(file . NAME))
1092
1093 For example,
1094
1095      (set-register ?z '(file . "/usr/src/xemacs/src/ChangeLog"))
1096
1097 puts the file name shown in register `z'.
1098
1099    To visit the file whose name is in register R, type `C-x r j R'.
1100 (This is the same command used to jump to a position or restore a frame
1101 configuration.)
1102
1103 \1f
1104 File: xemacs.info,  Node: Bookmarks,  Prev: RegFiles,  Up: Registers
1105
1106 Bookmarks
1107 =========
1108
1109    "Bookmarks" are somewhat like registers in that they record
1110 positions you can jump to.  Unlike registers, they have long names, and
1111 they persist automatically from one Emacs session to the next.  The
1112 prototypical use of bookmarks is to record "where you were reading" in
1113 various files.
1114
1115    Note: bookmark.el is distributed in edit-utils package.  You need to
1116 install that to use bookmark facility (*note Packages::).
1117
1118 `C-x r m <RET>'
1119      Set the bookmark for the visited file, at point.
1120
1121 `C-x r m BOOKMARK <RET>'
1122      Set the bookmark named BOOKMARK at point (`bookmark-set').
1123
1124 `C-x r b BOOKMARK <RET>'
1125      Jump to the bookmark named BOOKMARK (`bookmark-jump').
1126
1127 `C-x r l'
1128      List all bookmarks (`list-bookmarks').
1129
1130 `M-x bookmark-save'
1131      Save all the current bookmark values in the default bookmark file.
1132
1133    The prototypical use for bookmarks is to record one current position
1134 in each of several files.  So the command `C-x r m', which sets a
1135 bookmark, uses the visited file name as the default for the bookmark
1136 name.  If you name each bookmark after the file it points to, then you
1137 can conveniently revisit any of those files with `C-x r b', and move to
1138 the position of the bookmark at the same time.
1139
1140    To display a list of all your bookmarks in a separate buffer, type
1141 `C-x r l' (`list-bookmarks').  If you switch to that buffer, you can
1142 use it to edit your bookmark definitions or annotate the bookmarks.
1143 Type `C-h m' in that buffer for more information about its special
1144 editing commands.
1145
1146    When you kill XEmacs, XEmacs offers to save your bookmark values in
1147 your default bookmark file, `~/.emacs.bmk', if you have changed any
1148 bookmark values.  You can also save the bookmarks at any time with the
1149 `M-x bookmark-save' command.  The bookmark commands load your default
1150 bookmark file automatically.  This saving and loading is how bookmarks
1151 persist from one XEmacs session to the next.
1152
1153    If you set the variable `bookmark-save-flag' to 1, then each command
1154 that sets a bookmark will also save your bookmarks; this way, you don't
1155 lose any bookmark values even if XEmacs crashes.  (The value, if a
1156 number, says how many bookmark modifications should go by between
1157 saving.)
1158
1159    Bookmark position values are saved with surrounding context, so that
1160 `bookmark-jump' can find the proper position even if the file is
1161 modified slightly.  The variable `bookmark-search-size' says how many
1162 characters of context to record, on each side of the bookmark's
1163 position.
1164
1165    Here are some additional commands for working with bookmarks:
1166
1167 `M-x bookmark-load <RET> FILENAME <RET>'
1168      Load a file named FILENAME that contains a list of bookmark
1169      values.  You can use this command, as well as `bookmark-write', to
1170      work with other files of bookmark values in addition to your
1171      default bookmark file.
1172
1173 `M-x bookmark-write <RET> FILENAME <RET>'
1174      Save all the current bookmark values in the file FILENAME.
1175
1176 `M-x bookmark-delete <RET> BOOKMARK <RET>'
1177      Delete the bookmark named BOOKMARK.
1178
1179 `M-x bookmark-insert-location <RET> BOOKMARK <RET>'
1180      Insert in the buffer the name of the file that bookmark BOOKMARK
1181      points to.
1182
1183 `M-x bookmark-insert <RET> BOOKMARK <RET>'
1184      Insert in the buffer the _contents_ of the file that bookmark
1185      BOOKMARK points to.
1186
1187 \1f
1188 File: xemacs.info,  Node: Display,  Next: Search,  Prev: Registers,  Up: Top
1189
1190 Controlling the Display
1191 ***********************
1192
1193    Since only part of a large buffer fits in the window, XEmacs tries
1194 to show the part that is likely to be interesting.  The display control
1195 commands allow you to specify which part of the text you want to see.
1196
1197 `C-l'
1198      Clear frame and redisplay, scrolling the selected window to center
1199      point vertically within it (`recenter').
1200
1201 `C-v'
1202 `pgdn'
1203 `next'
1204      Scroll forward (a windowful or a specified number of lines)
1205      (`scroll-up').  On most X keyboards, you can get this
1206      functionality using the key labelled `Page Down', which generates
1207      either `next' or `pgdn'.
1208
1209 `M-v'
1210 `pgup'
1211 `prior'
1212      Scroll backward (`scroll-down').  On most X keyboards, you can get
1213      this functionality using the key labelled `Page Up', which
1214      generates either `prior' or `pgup'.
1215
1216 `ARG C-l'
1217      Scroll so point is on line ARG (`recenter').
1218
1219 `C-x <'
1220 `C-pgdn'
1221 `C-next'
1222      Scroll text in current window to the left (`scroll-left').
1223
1224 `C-x >'
1225 `C-pgup'
1226 `C-prior'
1227      Scroll to the right (`scroll-right').
1228
1229 `C-x $'
1230      Make deeply indented lines invisible (`set-selective-display').
1231
1232 * Menu:
1233
1234 * Scrolling::              Moving text up and down in a window.
1235 * Horizontal Scrolling::   Moving text left and right in a window.
1236 * Selective Display::      Hiding lines with lots of indentation.
1237 * Display Vars::           Information on variables for customizing display.
1238