9d4fa44f43ebc8134576beaa88a072cdf9e3d3f6
[chise/xemacs-chise.git] / info / xemacs.info-9
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: Other Window,  Next: Pop Up Window,  Prev: Split Window,  Up: Windows
34
35 Using Other Windows
36 ===================
37
38 `C-x o'
39      Select another window (`other-window').  That is the letter `o',
40      not zero.
41
42 `M-C-v'
43      Scroll the next window (`scroll-other-window').
44
45 `M-x compare-windows'
46      Find the next place where the text in the selected window does not
47      match the text in the next window.
48
49 `M-x other-window-any-frame N'
50      Select the Nth different window on any frame.
51
52    To select a different window, use `C-x o' (`other-window').  That is
53 an `o', for `other', not a zero.  When there are more than two windows,
54 the command moves through all the windows in a cyclic order, generally
55 top to bottom and left to right.  From the rightmost and bottommost
56 window, it goes back to the one at the upper left corner.  A numeric
57 argument, N, moves several steps in the cyclic order of windows. A
58 negative numeric argument moves around the cycle in the opposite order.
59 If the optional second argument ALL-FRAMES is non-`nil', the function
60 cycles through all frames.  When the minibuffer is active, the
61 minibuffer is the last window in the cycle; you can switch from the
62 minibuffer window to one of the other windows, and later switch back
63 and finish supplying the minibuffer argument that is requested.  *Note
64 Minibuffer Edit::.
65
66    The command `M-x other-window-any-frame' also selects the window N
67 steps away in the cyclic order.  However, unlike `other-window', this
68 command selects a window on the next or previous frame instead of
69 wrapping around to the top or bottom of the current frame, when there
70 are no more windows.
71
72    The usual scrolling commands (*note Display::) apply to the selected
73 window only.  `M-C-v' (`scroll-other-window') scrolls the window that
74 `C-x o' would select.  Like `C-v', it takes positive and negative
75 arguments.
76
77    The command `M-x compare-windows' compares the text in the current
78 window with the text in the next window.  Comparison starts at point in
79 each window.  Point moves forward in each window, a character at a time,
80 until the next set of characters in the two windows are different.
81 Then the command is finished.
82
83    A prefix argument IGNORE-WHITESPACE means ignore changes in
84 whitespace.  The variable `compare-windows-whitespace' controls how
85 whitespace is skipped.
86
87    If `compare-ignore-case' is non-`nil', changes in case are also
88 ignored.
89
90 \1f
91 File: xemacs.info,  Node: Pop Up Window,  Next: Change Window,  Prev: Other Window,  Up: Windows
92
93 Displaying in Another Window
94 ============================
95
96    `C-x 4' is a prefix key for commands that select another window
97 (splitting the window if there is only one) and select a buffer in that
98 window.  Different `C-x 4' commands have different ways of finding the
99 buffer to select.
100
101 `C-x 4 b BUFNAME <RET>'
102      Select buffer BUFNAME in another window.  This runs
103      `switch-to-buffer-other-window'.
104
105 `C-x 4 f FILENAME <RET>'
106      Visit file FILENAME and select its buffer in another window.  This
107      runs `find-file-other-window'.  *Note Visiting::.
108
109 `C-x 4 d DIRECTORY <RET>'
110      Select a Dired buffer for directory DIRECTORY in another window.
111      This runs `dired-other-window'.  *Note Dired::.
112
113 `C-x 4 m'
114      Start composing a mail message in another window.  This runs
115      `mail-other-window', and its same-window version is `C-x m' (*note
116      Sending Mail::).
117
118 `C-x 4 .'
119      Find a tag in the current tag table in another window.  This runs
120      `find-tag-other-window', the multiple-window variant of `M-.'
121      (*note Tags::).
122
123    If the variable `display-buffer-function' is non-`nil', its value is
124 the function to call to handle `display-buffer'. It receives two
125 arguments, the buffer and a flag that if non-`nil' means that the
126 currently selected window is not acceptable. Commands such as
127 `switch-to-buffer-other-window' and `find-file-other-window' work using
128 this function.
129
130 \1f
131 File: xemacs.info,  Node: Change Window,  Prev: Pop Up Window,  Up: Windows
132
133 Deleting and Rearranging Windows
134 ================================
135
136 `C-x 0'
137      Get rid of the selected window (`delete-window').  That is a zero.
138      If there is more than one Emacs frame, deleting the sole remaining
139      window on that frame deletes the frame as well. If the current
140      frame is the only frame, it is not deleted.
141
142 `C-x 1'
143      Get rid of all windows except the selected one
144      (`delete-other-windows').
145
146 `C-x ^'
147      Make the selected window taller, at the expense of the other(s)
148      (`enlarge-window').
149
150 `C-x }'
151      Make the selected window wider (`enlarge-window-horizontally').
152
153    To delete a window, type `C-x 0' (`delete-window').  (That is a
154 zero.)  The space occupied by the deleted window is distributed among
155 the other active windows (but not the minibuffer window, even if that
156 is active at the time).  Once a window is deleted, its attributes are
157 forgotten; there is no automatic way to make another window of the same
158 shape or showing the same buffer.  The buffer continues to exist, and
159 you can select it in any window with `C-x b'.
160
161    `C-x 1' (`delete-other-windows') is more powerful than `C-x 0'; it
162 deletes all the windows except the selected one (and the minibuffer).
163 The selected window expands to use the whole frame except for the echo
164 area.
165
166    To readjust the division of space among existing windows, use `C-x
167 ^' (`enlarge-window').  It makes the currently selected window longer
168 by one line or as many lines as a numeric argument specifies.  With a
169 negative argument, it makes the selected window smaller.  `C-x }'
170 (`enlarge-window-horizontally') makes the selected window wider by the
171 specified number of columns.  The extra screen space given to a window
172 comes from one of its neighbors, if that is possible; otherwise, all
173 the competing windows are shrunk in the same proportion.  If this makes
174 some windows too small, those windows are deleted and their space is
175 divided up.   Minimum window size is specified by the variables
176 `window-min-height' and `window-min-width'.
177
178    You can also resize windows within a frame by clicking the left mouse
179 button on a modeline, and dragging.
180
181    Clicking the right button on a mode line pops up a menu of common
182 window manager operations.  This menu contains the following options:
183
184 Delete Window
185      Remove the window above this modeline from the frame.
186
187 Delete Other Windows
188      Delete all windows on the frame except for the one above this
189      modeline.
190
191 Split Window
192      Split the window above the mode line in half, creating another
193      window.
194
195 Split Window Horizontally
196      Split the window above the mode line in half horizontally, so that
197      there will be two windows side-by-side.
198
199 Balance Windows
200      Readjust the sizes of all windows on the frame until all windows
201      have roughly the same number of lines.
202
203 \1f
204 File: xemacs.info,  Node: Mule,  Next: Major Modes,  Prev: Windows,  Up: Top
205
206 World Scripts Support
207 *********************
208
209    If you compile XEmacs with mule option, it supports a wide variety of
210 world scripts, including Latin script, as well as Arabic script,
211 Simplified Chinese script (for mainland of China), Traditional Chinese
212 script (for Taiwan and Hong-Kong), Greek script, Hebrew script, IPA
213 symbols, Japanese scripts (Hiragana, Katakana and Kanji), Korean scripts
214 (Hangul and Hanja) and Cyrillic script (for Byelorussian, Bulgarian,
215 Russian, Serbian and Ukrainian).  These features have been merged from
216 the modified version of Emacs known as MULE (for "MULti-lingual
217 Enhancement to GNU Emacs").
218
219 * Menu:
220
221 * Mule Intro::              Basic concepts of Mule.
222 * Language Environments::   Setting things up for the language you use.
223 * Input Methods::           Entering text characters not on your keyboard.
224 * Select Input Method::     Specifying your choice of input methods.
225 * Coding Systems::          Character set conversion when you read and
226                               write files, and so on.
227 * Recognize Coding::        How XEmacs figures out which conversion to use.
228 * Specify Coding::          Various ways to choose which conversion to use.
229
230 \1f
231 File: xemacs.info,  Node: Mule Intro,  Next: Language Environments,  Prev: Mule,  Up: Mule
232
233 Introduction to world scripts
234 =============================
235
236    The users of these scripts have established many more-or-less
237 standard coding systems for storing files.  XEmacs translates between
238 the internal character encoding and various other coding systems when
239 reading and writing files, when exchanging data with subprocesses, and
240 (in some cases) in the `C-q' command (see below).
241
242    The command `C-h h' (`view-hello-file') displays the file
243 `etc/HELLO', which shows how to say "hello" in many languages.  This
244 illustrates various scripts.
245
246    Keyboards, even in the countries where these character sets are used,
247 generally don't have keys for all the characters in them.  So XEmacs
248 supports various "input methods", typically one for each script or
249 language, to make it convenient to type them.
250
251    The prefix key `C-x <RET>' is used for commands that pertain to
252 world scripts, coding systems, and input methods.
253
254 \1f
255 File: xemacs.info,  Node: Language Environments,  Next: Input Methods,  Prev: Mule Intro,  Up: Mule
256
257 Language Environments
258 =====================
259
260    All supported character sets are supported in XEmacs buffers if it is
261 compile with mule; there is no need to select a particular language in
262 order to display its characters in an XEmacs buffer.  However, it is
263 important to select a "language environment" in order to set various
264 defaults.  The language environment really represents a choice of
265 preferred script (more or less) rather that a choice of language.
266
267    The language environment controls which coding systems to recognize
268 when reading text (*note Recognize Coding::).  This applies to files,
269 incoming mail, netnews, and any other text you read into XEmacs.  It may
270 also specify the default coding system to use when you create a file.
271 Each language environment also specifies a default input method.
272
273    The command to select a language environment is `M-x
274 set-language-environment'.  It makes no difference which buffer is
275 current when you use this command, because the effects apply globally to
276 the XEmacs session.  The supported language environments include:
277
278      Chinese-BIG5, Chinese-CNS, Chinese-GB, Cyrillic-ISO, English,
279      Ethiopic, Greek, Japanese, Korean, Latin-1, Latin-2, Latin-3,
280      Latin-4, Latin-5.
281
282    Some operating systems let you specify the language you are using by
283 setting locale environment variables.  XEmacs handles one common special
284 case of this: if your locale name for character types contains the
285 string `8859-N', XEmacs automatically selects the corresponding
286 language environment.
287
288    To display information about the effects of a certain language
289 environment LANG-ENV, use the command `C-h L LANG-ENV <RET>'
290 (`describe-language-environment').  This tells you which languages this
291 language environment is useful for, and lists the character sets,
292 coding systems, and input methods that go with it.  It also shows some
293 sample text to illustrate scripts used in this language environment.
294 By default, this command describes the chosen language environment.
295
296 \1f
297 File: xemacs.info,  Node: Input Methods,  Next: Select Input Method,  Prev: Language Environments,  Up: Mule
298
299 Input Methods
300 =============
301
302    An "input method" is a kind of character conversion designed
303 specifically for interactive input.  In XEmacs, typically each language
304 has its own input method; sometimes several languages which use the same
305 characters can share one input method.  A few languages support several
306 input methods.
307
308    The simplest kind of input method works by mapping ASCII letters into
309 another alphabet.  This is how the Greek and Russian input methods work.
310
311    A more powerful technique is composition: converting sequences of
312 characters into one letter.  Many European input methods use composition
313 to produce a single non-ASCII letter from a sequence that consists of a
314 letter followed by accent characters.  For example, some methods convert
315 the sequence `'a' into a single accented letter.
316
317    The input methods for syllabic scripts typically use mapping followed
318 by composition.  The input methods for Thai and Korean work this way.
319 First, letters are mapped into symbols for particular sounds or tone
320 marks; then, sequences of these which make up a whole syllable are
321 mapped into one syllable sign.
322
323    Chinese and Japanese require more complex methods.  In Chinese input
324 methods, first you enter the phonetic spelling of a Chinese word (in
325 input method `chinese-py', among others), or a sequence of portions of
326 the character (input methods `chinese-4corner' and `chinese-sw', and
327 others).  Since one phonetic spelling typically corresponds to many
328 different Chinese characters, you must select one of the alternatives
329 using special XEmacs commands.  Keys such as `C-f', `C-b', `C-n',
330 `C-p', and digits have special definitions in this situation, used for
331 selecting among the alternatives.  <TAB> displays a buffer showing all
332 the possibilities.
333
334    In Japanese input methods, first you input a whole word using
335 phonetic spelling; then, after the word is in the buffer, XEmacs
336 converts it into one or more characters using a large dictionary.  One
337 phonetic spelling corresponds to many differently written Japanese
338 words, so you must select one of them; use `C-n' and `C-p' to cycle
339 through the alternatives.
340
341    Sometimes it is useful to cut off input method processing so that the
342 characters you have just entered will not combine with subsequent
343 characters.  For example, in input method `latin-1-postfix', the
344 sequence `e '' combines to form an `e' with an accent.  What if you
345 want to enter them as separate characters?
346
347    One way is to type the accent twice; that is a special feature for
348 entering the separate letter and accent.  For example, `e ' '' gives
349 you the two characters `e''.  Another way is to type another letter
350 after the `e'--something that won't combine with that--and immediately
351 delete it.  For example, you could type `e e <DEL> '' to get separate
352 `e' and `''.
353
354    Another method, more general but not quite as easy to type, is to use
355 `C-\ C-\' between two characters to stop them from combining.  This is
356 the command `C-\' (`toggle-input-method') used twice.  *Note Select
357 Input Method::.
358
359    `C-\ C-\' is especially useful inside an incremental search, because
360 stops waiting for more characters to combine, and starts searching for
361 what you have already entered.
362
363    The variables `input-method-highlight-flag' and
364 `input-method-verbose-flag' control how input methods explain what is
365 happening.  If `input-method-highlight-flag' is non-`nil', the partial
366 sequence is highlighted in the buffer.  If `input-method-verbose-flag'
367 is non-`nil', the list of possible characters to type next is displayed
368 in the echo area (but not when you are in the minibuffer).
369
370 \1f
371 File: xemacs.info,  Node: Select Input Method,  Next: Coding Systems,  Prev: Input Methods,  Up: Mule
372
373 Selecting an Input Method
374 =========================
375
376 `C-\'
377      Enable or disable use of the selected input method.
378
379 `C-x <RET> C-\ METHOD <RET>'
380      Select a new input method for the current buffer.
381
382 `C-h I METHOD <RET>'
383 `C-h C-\ METHOD <RET>'
384      Describe the input method METHOD (`describe-input-method').  By
385      default, it describes the current input method (if any).
386
387 `M-x list-input-methods'
388      Display a list of all the supported input methods.
389
390    To choose an input method for the current buffer, use `C-x <RET>
391 C-\' (`select-input-method').  This command reads the input method name
392 with the minibuffer; the name normally starts with the language
393 environment that it is meant to be used with.  The variable
394 `current-input-method' records which input method is selected.
395
396    Input methods use various sequences of ASCII characters to stand for
397 non-ASCII characters.  Sometimes it is useful to turn off the input
398 method temporarily.  To do this, type `C-\' (`toggle-input-method').
399 To reenable the input method, type `C-\' again.
400
401    If you type `C-\' and you have not yet selected an input method, it
402 prompts for you to specify one.  This has the same effect as using `C-x
403 <RET> C-\' to specify an input method.
404
405    Selecting a language environment specifies a default input method for
406 use in various buffers.  When you have a default input method, you can
407 select it in the current buffer by typing `C-\'.  The variable
408 `default-input-method' specifies the default input method (`nil' means
409 there is none).
410
411    Some input methods for alphabetic scripts work by (in effect)
412 remapping the keyboard to emulate various keyboard layouts commonly used
413 for those scripts.  How to do this remapping properly depends on your
414 actual keyboard layout.  To specify which layout your keyboard has, use
415 the command `M-x quail-set-keyboard-layout'.
416
417    To display a list of all the supported input methods, type `M-x
418 list-input-methods'.  The list gives information about each input
419 method, including the string that stands for it in the mode line.
420
421 \1f
422 File: xemacs.info,  Node: Coding Systems,  Next: Recognize Coding,  Prev: Select Input Method,  Up: Mule
423
424 Coding Systems
425 ==============
426
427    Users of various languages have established many more-or-less
428 standard coding systems for representing them.  XEmacs does not use
429 these coding systems internally; instead, it converts from various
430 coding systems to its own system when reading data, and converts the
431 internal coding system to other coding systems when writing data.
432 Conversion is possible in reading or writing files, in sending or
433 receiving from the terminal, and in exchanging data with subprocesses.
434
435    XEmacs assigns a name to each coding system.  Most coding systems are
436 used for one language, and the name of the coding system starts with the
437 language name.  Some coding systems are used for several languages;
438 their names usually start with `iso'.  There are also special coding
439 systems `binary' and `no-conversion' which do not convert printing
440 characters at all.
441
442    In addition to converting various representations of non-ASCII
443 characters, a coding system can perform end-of-line conversion.  XEmacs
444 handles three different conventions for how to separate lines in a file:
445 newline, carriage-return linefeed, and just carriage-return.
446
447 `C-h C CODING <RET>'
448      Describe coding system CODING.
449
450 `C-h C <RET>'
451      Describe the coding systems currently in use.
452
453 `M-x list-coding-systems'
454      Display a list of all the supported coding systems.
455
456    The command `C-h C' (`describe-coding-system') displays information
457 about particular coding systems.  You can specify a coding system name
458 as argument; alternatively, with an empty argument, it describes the
459 coding systems currently selected for various purposes, both in the
460 current buffer and as the defaults, and the priority list for
461 recognizing coding systems (*note Recognize Coding::).
462
463    To display a list of all the supported coding systems, type `M-x
464 list-coding-systems'.  The list gives information about each coding
465 system, including the letter that stands for it in the mode line (*note
466 Mode Line::).
467
468    Each of the coding systems that appear in this list--except for
469 `binary', which means no conversion of any kind--specifies how and
470 whether to convert printing characters, but leaves the choice of
471 end-of-line conversion to be decided based on the contents of each file.
472 For example, if the file appears to use carriage-return linefeed between
473 lines, that end-of-line conversion will be used.
474
475    Each of the listed coding systems has three variants which specify
476 exactly what to do for end-of-line conversion:
477
478 `...-unix'
479      Don't do any end-of-line conversion; assume the file uses newline
480      to separate lines.  (This is the convention normally used on Unix
481      and GNU systems.)
482
483 `...-dos'
484      Assume the file uses carriage-return linefeed to separate lines,
485      and do the appropriate conversion.  (This is the convention
486      normally used on Microsoft systems.)
487
488 `...-mac'
489      Assume the file uses carriage-return to separate lines, and do the
490      appropriate conversion.  (This is the convention normally used on
491      the Macintosh system.)
492
493    These variant coding systems are omitted from the
494 `list-coding-systems' display for brevity, since they are entirely
495 predictable.  For example, the coding system `iso-8859-1' has variants
496 `iso-8859-1-unix', `iso-8859-1-dos' and `iso-8859-1-mac'.
497
498    In contrast, the coding system `binary' specifies no character code
499 conversion at all--none for non-Latin-1 byte values and none for end of
500 line.  This is useful for reading or writing binary files, tar files,
501 and other files that must be examined verbatim.
502
503    The easiest way to edit a file with no conversion of any kind is with
504 the `M-x find-file-literally' command.  This uses `binary', and also
505 suppresses other XEmacs features that might convert the file contents
506 before you see them.  *Note Visiting::.
507
508    The coding system `no-conversion' means that the file contains
509 non-Latin-1 characters stored with the internal XEmacs encoding.  It
510 handles end-of-line conversion based on the data encountered, and has
511 the usual three variants to specify the kind of end-of-line conversion.
512
513 \1f
514 File: xemacs.info,  Node: Recognize Coding,  Next: Specify Coding,  Prev: Coding Systems,  Up: Mule
515
516 Recognizing Coding Systems
517 ==========================
518
519    Most of the time, XEmacs can recognize which coding system to use for
520 any given file-once you have specified your preferences.
521
522    Some coding systems can be recognized or distinguished by which byte
523 sequences appear in the data.  However, there are coding systems that
524 cannot be distinguished, not even potentially.  For example, there is no
525 way to distinguish between Latin-1 and Latin-2; they use the same byte
526 values with different meanings.
527
528    XEmacs handles this situation by means of a priority list of coding
529 systems.  Whenever XEmacs reads a file, if you do not specify the coding
530 system to use, XEmacs checks the data against each coding system,
531 starting with the first in priority and working down the list, until it
532 finds a coding system that fits the data.  Then it converts the file
533 contents assuming that they are represented in this coding system.
534
535    The priority list of coding systems depends on the selected language
536 environment (*note Language Environments::).  For example, if you use
537 French, you probably want XEmacs to prefer Latin-1 to Latin-2; if you
538 use Czech, you probably want Latin-2 to be preferred.  This is one of
539 the reasons to specify a language environment.
540
541    However, you can alter the priority list in detail with the command
542 `M-x prefer-coding-system'.  This command reads the name of a coding
543 system from the minibuffer, and adds it to the front of the priority
544 list, so that it is preferred to all others.  If you use this command
545 several times, each use adds one element to the front of the priority
546 list.
547
548    Sometimes a file name indicates which coding system to use for the
549 file.  The variable `file-coding-system-alist' specifies this
550 correspondence.  There is a special function
551 `modify-coding-system-alist' for adding elements to this list.  For
552 example, to read and write all `.txt' using the coding system
553 `china-iso-8bit', you can execute this Lisp expression:
554
555      (modify-coding-system-alist 'file "\\.txt\\'" 'china-iso-8bit)
556
557 The first argument should be `file', the second argument should be a
558 regular expression that determines which files this applies to, and the
559 third argument says which coding system to use for these files.
560
561    You can specify the coding system for a particular file using the
562 `-*-...-*-' construct at the beginning of a file, or a local variables
563 list at the end (*note File Variables::).  You do this by defining a
564 value for the "variable" named `coding'.  XEmacs does not really have a
565 variable `coding'; instead of setting a variable, it uses the specified
566 coding system for the file.  For example, `-*-mode: C; coding:
567 iso-8859-1;-*-' specifies use of the iso-8859-1 coding system, as well
568 as C mode.
569
570    Once XEmacs has chosen a coding system for a buffer, it stores that
571 coding system in `buffer-file-coding-system' and uses that coding
572 system, by default, for operations that write from this buffer into a
573 file.  This includes the commands `save-buffer' and `write-region'.  If
574 you want to write files from this buffer using a different coding
575 system, you can specify a different coding system for the buffer using
576 `set-buffer-file-coding-system' (*note Specify Coding::).
577
578 \1f
579 File: xemacs.info,  Node: Specify Coding,  Prev: Recognize Coding,  Up: Mule
580
581 Specifying a Coding System
582 ==========================
583
584    In cases where XEmacs does not automatically choose the right coding
585 system, you can use these commands to specify one:
586
587 `C-x <RET> f CODING <RET>'
588      Use coding system CODING for the visited file in the current
589      buffer.
590
591 `C-x <RET> c CODING <RET>'
592      Specify coding system CODING for the immediately following command.
593
594 `C-x <RET> k CODING <RET>'
595      Use coding system CODING for keyboard input.
596
597 `C-x <RET> t CODING <RET>'
598      Use coding system CODING for terminal output.
599
600 `C-x <RET> p CODING <RET>'
601      Use coding system CODING for subprocess input and output in the
602      current buffer.
603
604    The command `C-x RET f' (`set-buffer-file-coding-system') specifies
605 the file coding system for the current buffer--in other words, which
606 coding system to use when saving or rereading the visited file.  You
607 specify which coding system using the minibuffer.  Since this command
608 applies to a file you have already visited, it affects only the way the
609 file is saved.
610
611    Another way to specify the coding system for a file is when you visit
612 the file.  First use the command `C-x <RET> c'
613 (`universal-coding-system-argument'); this command uses the minibuffer
614 to read a coding system name.  After you exit the minibuffer, the
615 specified coding system is used for _the immediately following command_.
616
617    So if the immediately following command is `C-x C-f', for example,
618 it reads the file using that coding system (and records the coding
619 system for when the file is saved).  Or if the immediately following
620 command is `C-x C-w', it writes the file using that coding system.
621 Other file commands affected by a specified coding system include `C-x
622 C-i' and `C-x C-v', as well as the other-window variants of `C-x C-f'.
623
624    In addition, if you run some file input commands with the precedent
625 `C-u', you can specify coding system to read from minibuffer.  So if
626 the immediately following command is `C-x C-f', for example, it reads
627 the file using that coding system (and records the coding system for
628 when the file is saved).  Other file commands affected by a specified
629 coding system include `C-x C-i' and `C-x C-v', as well as the
630 other-window variants of `C-x C-f'.
631
632    The variable `default-buffer-file-coding-system' specifies the
633 choice of coding system to use when you create a new file.  It applies
634 when you find a new file, and when you create a buffer and then save it
635 in a file.  Selecting a language environment typically sets this
636 variable to a good choice of default coding system for that language
637 environment.
638
639    The command `C-x <RET> t' (`set-terminal-coding-system') specifies
640 the coding system for terminal output.  If you specify a character code
641 for terminal output, all characters output to the terminal are
642 translated into that coding system.
643
644    This feature is useful for certain character-only terminals built to
645 support specific languages or character sets--for example, European
646 terminals that support one of the ISO Latin character sets.
647
648    By default, output to the terminal is not translated at all.
649
650    The command `C-x <RET> k' (`set-keyboard-coding-system') specifies
651 the coding system for keyboard input.  Character-code translation of
652 keyboard input is useful for terminals with keys that send non-ASCII
653 graphic characters--for example, some terminals designed for ISO
654 Latin-1 or subsets of it.
655
656    By default, keyboard input is not translated at all.
657
658    There is a similarity between using a coding system translation for
659 keyboard input, and using an input method: both define sequences of
660 keyboard input that translate into single characters.  However, input
661 methods are designed to be convenient for interactive use by humans, and
662 the sequences that are translated are typically sequences of ASCII
663 printing characters.  Coding systems typically translate sequences of
664 non-graphic characters.
665
666    The command `C-x <RET> p' (`set-buffer-process-coding-system')
667 specifies the coding system for input and output to a subprocess.  This
668 command applies to the current buffer; normally, each subprocess has its
669 own buffer, and thus you can use this command to specify translation to
670 and from a particular subprocess by giving the command in the
671 corresponding buffer.
672
673    By default, process input and output are not translated at all.
674
675    The variable `file-name-coding-system' specifies a coding system to
676 use for encoding file names.  If you set the variable to a coding
677 system name (as a Lisp symbol or a string), XEmacs encodes file names
678 using that coding system for all file operations.  This makes it
679 possible to use non-Latin-1 characters in file names--or, at least,
680 those non-Latin-1 characters which the specified coding system can
681 encode.  By default, this variable is `nil', which implies that you
682 cannot use non-Latin-1 characters in file names.
683
684 \1f
685 File: xemacs.info,  Node: Major Modes,  Next: Indentation,  Prev: Mule,  Up: Top
686
687 Major Modes
688 ***********
689
690    Emacs has many different "major modes", each of which customizes
691 Emacs for editing text of a particular sort.  The major modes are
692 mutually exclusive;  at any time, each buffer has one major mode.  The
693 mode line normally contains the name of the current major mode in
694 parentheses.  *Note Mode Line::.
695
696    The least specialized major mode is called "Fundamental mode".  This
697 mode has no mode-specific redefinitions or variable settings.  Each
698 Emacs command behaves in its most general manner, and each option is in
699 its default state.  For editing any specific type of text, such as Lisp
700 code or English text, you should switch to the appropriate major mode,
701 such as Lisp mode or Text mode.
702
703    Selecting a major mode changes the meanings of a few keys to become
704 more specifically adapted to the language being edited.  <TAB>, <DEL>,
705 and <LFD> are changed frequently.  In addition, commands which handle
706 comments use the mode to determine how to delimit comments.  Many major
707 modes redefine the syntactical properties of characters appearing in
708 the buffer.  *Note Syntax::.
709
710    The major modes fall into three major groups.  Lisp mode (which has
711 several variants), C mode, and Muddle mode are for specific programming
712 languages.  Text mode, Nroff mode, TeX mode, and Outline mode are for
713 editing English text.  The remaining major modes are not intended for
714 use on users' files; they are used in buffers created by Emacs for
715 specific purposes and include Dired mode for buffers made by Dired
716 (*note Dired::), Mail mode for buffers made by `C-x m' (*note Sending
717 Mail::), and Shell mode for buffers used for communicating with an
718 inferior shell process (*note Interactive Shell::).
719
720    Most programming language major modes specify that only blank lines
721 separate paragraphs.  This is so that the paragraph commands remain
722 useful.  *Note Paragraphs::.  They also cause Auto Fill mode to use the
723 definition of <TAB> to indent the new lines it creates.  This is
724 because most lines in a program are usually indented.  *Note
725 Indentation::.
726
727 * Menu:
728
729 * Choosing Modes::     How major modes are specified or chosen.
730
731 \1f
732 File: xemacs.info,  Node: Choosing Modes,  Prev: Major Modes,  Up: Major Modes
733
734 Choosing Major Modes
735 ====================
736
737    You can select a major mode explicitly for the current buffer, but
738 most of the time Emacs determines which mode to use based on the file
739 name or some text in the file.
740
741    Use a `M-x' command to explicitly select a new major mode.  Add
742 `-mode' to the name of a major mode to get the name of a command to
743 select that mode.  For example, to enter Lisp mode, execute `M-x
744 lisp-mode'.
745
746    When you visit a file, Emacs usually chooses the right major mode
747 based on the file's name.  For example, files whose names end in `.c'
748 are edited in C mode.  The variable `auto-mode-alist' controls the
749 correspondence between file names and major mode.  Its value is a list
750 in which each element has the form:
751
752      (REGEXP . MODE-FUNCTION)
753
754 For example, one element normally found in the list has the form
755 `("\\.c$" . c-mode)'. It is responsible for selecting C mode for files
756 whose names end in `.c'.  (Note that `\\' is needed in Lisp syntax to
757 include a `\' in the string, which is needed to suppress the special
758 meaning of `.' in regexps.)  The only practical way to change this
759 variable is with Lisp code.
760
761    You can specify which major mode should be used for editing a certain
762 file by a special sort of text in the first non-blank line of the file.
763 The mode name should appear in this line both preceded and followed by
764 `-*-'.  Other text may appear on the line as well.  For example,
765
766      ;-*-Lisp-*-
767
768 tells Emacs to use Lisp mode.  Note how the semicolon is used to make
769 Lisp treat this line as a comment.  Such an explicit specification
770 overrides any default mode based on the file name.
771
772    Another format of mode specification is:
773
774      -*-Mode: MODENAME;-*-
775
776 which allows other things besides the major mode name to be specified.
777 However, Emacs does not look for anything except the mode name.
778
779    The major mode can also be specified in a local variables list.
780 *Note File Variables::.
781
782    When you visit a file that does not specify a major mode to use, or
783 when you create a new buffer with `C-x b', Emacs uses the major mode
784 specified by the variable `default-major-mode'.  Normally this value is
785 the symbol `fundamental-mode', which specifies Fundamental mode.  If
786 `default-major-mode' is `nil', the major mode is taken from the
787 previously selected buffer.
788
789 \1f
790 File: xemacs.info,  Node: Indentation,  Next: Text,  Prev: Major Modes,  Up: Top
791
792 Indentation
793 ***********
794
795 `<TAB>'
796      Indent current line "appropriately" in a mode-dependent fashion.
797
798 `<LFD>'
799      Perform <RET> followed by <TAB> (`newline-and-indent').
800
801 `M-^'
802      Merge two lines (`delete-indentation').  This would cancel out the
803      effect of <LFD>.
804
805 `C-M-o'
806      Split line at point; text on the line after point becomes a new
807      line indented to the same column that it now starts in
808      (`split-line').
809
810 `M-m'
811      Move (forward or back) to the first non-blank character on the
812      current line (`back-to-indentation').
813
814 `C-M-\'
815      Indent several lines to same column (`indent-region').
816
817 `C-x <TAB>'
818      Shift block of lines rigidly right or left (`indent-rigidly').
819
820 `M-i'
821      Indent from point to the next prespecified tab stop column
822      (`tab-to-tab-stop').
823
824 `M-x indent-relative'
825      Indent from point to under an indentation point in the previous
826      line.
827
828    Most programming languages have some indentation convention.  For
829 Lisp code, lines are indented according to their nesting in
830 parentheses.  The same general idea is used for C code, though details
831 differ.
832
833    Use the <TAB> command to indent a line whatever the language.  Each
834 major mode defines this command to perform indentation appropriate for
835 the particular language.  In Lisp mode, <TAB> aligns a line according
836 to its depth in parentheses.  No matter where in the line you are when
837 you type <TAB>, it aligns the line as a whole.  In C mode, <TAB>
838 implements a subtle and sophisticated indentation style that knows
839 about many aspects of C syntax.
840
841    In Text mode, <TAB> runs the command `tab-to-tab-stop', which
842 indents to the next tab stop column.  You can set the tab stops with
843 `M-x edit-tab-stops'.
844
845 * Menu:
846
847 * Indentation Commands:: Various commands and techniques for indentation.
848 * Tab Stops::            You can set arbitrary "tab stops" and then
849                          indent to the next tab stop when you want to.
850 * Just Spaces::          You can request indentation using just spaces.
851
852 \1f
853 File: xemacs.info,  Node: Indentation Commands,  Next: Tab Stops,  Prev: Indentation,  Up: Indentation
854
855 Indentation Commands and Techniques
856 ===================================
857
858    If you just want to insert a tab character in the buffer, you can
859 type `C-q <TAB>'.
860
861    To move over the indentation on a line, type `Meta-m'
862 (`back-to-indentation').  This command, given anywhere on a line,
863 positions point at the first non-blank character on the line.
864
865    To insert an indented line before the current line, type `C-a C-o
866 <TAB>'.  To make an indented line after the current line, use `C-e
867 <LFD>'.
868
869    `C-M-o' (`split-line') moves the text from point to the end of the
870 line vertically down, so that the current line becomes two lines.
871 `C-M-o' first moves point forward over any spaces and tabs.  Then it
872 inserts after point a newline and enough indentation to reach the same
873 column point is on.  Point remains before the inserted newline; in this
874 regard, `C-M-o' resembles `C-o'.
875
876    To join two lines cleanly, use the `Meta-^' (`delete-indentation')
877 command to delete the indentation at the front of the current line, and
878 the line boundary as well.  Empty spaces are replaced by a single
879 space, or by no space if at the beginning of a line, before a close
880 parenthesis, or after an open parenthesis.  To delete just the
881 indentation of a line, go to the beginning of the line and use `Meta-\'
882 (`delete-horizontal-space'), which deletes all spaces and tabs around
883 the cursor.
884
885    There are also commands for changing the indentation of several
886 lines at once.  `Control-Meta-\' (`indent-region') gives each line which
887 begins in the region the "usual" indentation by invoking <TAB> at the
888 beginning of the line.  A numeric argument specifies the column to
889 indent to.  Each line is shifted left or right so that its first
890 non-blank character appears in that column.  `C-x <TAB>'
891 (`indent-rigidly') moves all the lines in the region right by its
892 argument (left, for negative arguments).  The whole group of lines moves
893 rigidly sideways, which is how the command gets its name.
894
895    `M-x indent-relative' indents at point based on the previous line
896 (actually, the last non-empty line.)  It inserts whitespace at point,
897 moving point, until it is underneath an indentation point in the
898 previous line.  An indentation point is the end of a sequence of
899 whitespace or the end of the line.  If point is farther right than any
900 indentation point in the previous line, the whitespace before point is
901 deleted and the first indentation point then applicable is used.  If no
902 indentation point is applicable even then, `tab-to-tab-stop' is run
903 (see next section).
904
905    `indent-relative' is the definition of <TAB> in Indented Text mode.
906 *Note Text::.
907
908 \1f
909 File: xemacs.info,  Node: Tab Stops,  Next: Just Spaces,  Prev: Indentation Commands,  Up: Indentation
910
911 Tab Stops
912 =========
913
914    For typing in tables, you can use Text mode's definition of <TAB>,
915 `tab-to-tab-stop'.  This command inserts indentation before point,
916 enough to reach the next tab stop column.  Even if you are not in Text
917 mode, this function is associated with `M-i' anyway.
918
919    You can arbitrarily set the tab stops used by `M-i'.  They are
920 stored as a list of column-numbers in increasing order in the variable
921 `tab-stop-list'.
922
923    The convenient way to set the tab stops is using `M-x
924 edit-tab-stops', which creates and selects a buffer containing a
925 description of the tab stop settings.  You can edit this buffer to
926 specify different tab stops, and then type `C-c C-c' to make those new
927 tab stops take effect.  In the tab stop buffer, `C-c C-c' runs the
928 function `edit-tab-stops-note-changes' rather than the default
929 `save-buffer'.  `edit-tab-stops' records which buffer was current when
930 you invoked it, and stores the tab stops in that buffer.  Normally all
931 buffers share the same tab stops and changing them in one buffer
932 affects all.  If you make `tab-stop-list' local in one buffer
933 `edit-tab-stops' in that buffer edits only the local settings.
934
935    Below is the text representing ordinary tab stops every eight
936 columns:
937
938              :       :       :       :       :       :
939      0         1         2         3         4
940      0123456789012345678901234567890123456789012345678
941      To install changes, type C-c C-c
942
943    The first line contains a colon at each tab stop.  The remaining
944 lines help you see where the colons are and tell you what to do.
945
946    Note that the tab stops that control `tab-to-tab-stop' have nothing
947 to do with displaying tab characters in the buffer.  *Note Display
948 Vars::, for more information on that.
949
950 \1f
951 File: xemacs.info,  Node: Just Spaces,  Prev: Tab Stops,  Up: Indentation
952
953 Tabs vs. Spaces
954 ===============
955
956    Emacs normally uses both tabs and spaces to indent lines.  If you
957 prefer, all indentation can be made from spaces only.  To request this,
958 set `indent-tabs-mode' to `nil'.  This is a per-buffer variable;
959 altering the variable affects only the current buffer, but there is a
960 default value which you can change as well.  *Note Locals::.
961
962    There are also commands to convert tabs to spaces or vice versa,
963 always preserving the columns of all non-blank text.  `M-x tabify'
964 scans the region for sequences of spaces, and converts sequences of at
965 least three spaces to tabs if that is possible without changing
966 indentation.  `M-x untabify' changes all tabs in the region to
967 corresponding numbers of spaces.
968
969 \1f
970 File: xemacs.info,  Node: Text,  Next: Programs,  Prev: Indentation,  Up: Top
971
972 Commands for Human Languages
973 ****************************
974
975    The term "text" has two widespread meanings in our area of the
976 computer field.  One is data that is a sequence of characters.  In this
977 sense of the word any file that you edit with Emacs is text.  The other
978 meaning is more restrictive: a sequence of characters in a human
979 language for humans to read (possibly after processing by a text
980 formatter), as opposed to a program or commands for a program.
981
982    Human languages have syntactic and stylistic conventions that editor
983 commands should support or use to advantage: conventions involving
984 words, sentences, paragraphs, and capital letters.  This chapter
985 describes Emacs commands for all these things.  There are also commands
986 for "filling", or rearranging paragraphs into lines of approximately
987 equal length.  The commands for moving over and killing words,
988 sentences, and paragraphs, while intended primarily for editing text,
989 are also often useful for editing programs.
990
991    Emacs has several major modes for editing human language text.  If a
992 file contains plain text, use Text mode, which customizes Emacs in
993 small ways for the syntactic conventions of text.  For text which
994 contains embedded commands for text formatters, Emacs has other major
995 modes, each for a particular text formatter.  Thus, for input to TeX,
996 you can use TeX mode; for input to nroff, Nroff mode.
997
998 * Menu:
999
1000 * Text Mode::   The major modes for editing text files.
1001 * Nroff Mode::  The major mode for editing input to the formatter nroff.
1002 * TeX Mode::    The major modes for editing input to the formatter TeX.
1003 * Outline Mode:: The major mode for editing outlines.
1004 * Words::       Moving over and killing words.
1005 * Sentences::   Moving over and killing sentences.
1006 * Paragraphs::  Moving over paragraphs.
1007 * Pages::       Moving over pages.
1008 * Filling::     Filling or justifying text
1009 * Case::        Changing the case of text
1010
1011 \1f
1012 File: xemacs.info,  Node: Text Mode,  Next: Words,  Prev: Text,  Up: Text
1013
1014 Text Mode
1015 =========
1016
1017    You should use Text mode--rather than Fundamental or Lisp mode--to
1018 edit files of text in a human language.  Invoke `M-x text-mode' to
1019 enter Text mode.  In Text mode, <TAB> runs the function
1020 `tab-to-tab-stop', which allows you to use arbitrary tab stops set with
1021 `M-x edit-tab-stops' (*note Tab Stops::).  Features concerned with
1022 comments in programs are turned off unless they are explicitly invoked.
1023 The syntax table is changed so that periods are not considered part of a
1024 word, while apostrophes, backspaces and underlines are.
1025
1026    A similar variant mode is Indented Text mode, intended for editing
1027 text in which most lines are indented.  This mode defines <TAB> to run
1028 `indent-relative' (*note Indentation::), and makes Auto Fill indent the
1029 lines it creates.  As a result, a line made by Auto Filling, or by
1030 <LFD>, is normally indented just like the previous line.  Use `M-x
1031 indented-text-mode' to select this mode.
1032
1033    Entering Text mode or Indented Text mode calls the value of the
1034 variable `text-mode-hook' with no arguments, if that value exists and
1035 is not `nil'.  This value is also called when modes related to Text
1036 mode are entered; this includes Nroff mode, TeX mode, Outline mode, and
1037 Mail mode.  Your hook can look at the value of `major-mode' to see
1038 which of these modes is actually being entered.
1039
1040    Two modes similar to Text mode are of use for editing text that is to
1041 be passed through a text formatter before achieving its final readable
1042 form.
1043
1044 * Menu:
1045
1046 * Nroff Mode::  The major mode for editing input to the formatter nroff.
1047 * TeX Mode::    The major modes for editing input to the formatter TeX.
1048
1049
1050   Another similar mode is used for editing outlines.  It allows you
1051 to view the text at various levels of detail.  You can view either
1052 the outline headings alone or both headings and text; you can also
1053 hide some of the headings at lower levels from view to make the high
1054 level structure more visible.
1055
1056
1057 * Outline Mode:: The major mode for editing outlines.
1058
1059 \1f
1060 File: xemacs.info,  Node: Nroff Mode,  Next: TeX Mode,  Prev: Text Mode,  Up: Text Mode
1061
1062 Nroff Mode
1063 ----------
1064
1065    Nroff mode is a mode like Text mode but modified to handle nroff
1066 commands present in the text.  Invoke `M-x nroff-mode' to enter this
1067 mode.  Nroff mode differs from Text mode in only a few ways.  All nroff
1068 command lines are considered paragraph separators, so that filling never
1069 garbles the nroff commands.  Pages are separated by `.bp' commands.
1070 Comments start with backslash-doublequote.  There are also three special
1071 commands that are not available in Text mode:
1072
1073 `M-n'
1074      Move to the beginning of the next line that isn't an nroff command
1075      (`forward-text-line').  An argument is a repeat count.
1076
1077 `M-p'
1078      Like `M-n' but move up (`backward-text-line').
1079
1080 `M-?'
1081      Prints in the echo area the number of text lines (lines that are
1082      not nroff commands) in the region (`count-text-lines').
1083
1084    The other feature of Nroff mode is Electric Nroff newline mode.
1085 This is a minor mode that you can turn on or off with `M-x
1086 electric-nroff-mode' (*note Minor Modes::).  When the mode is on and
1087 you use <RET> to end a line containing an nroff command that opens a
1088 kind of grouping, Emacs automatically inserts the matching nroff
1089 command to close that grouping on the following line.  For example, if
1090 you are at the beginning of a line and type `.(b <RET>', the matching
1091 command `.)b' will be inserted on a new line following point.
1092
1093    Entering Nroff mode calls the value of the variable `text-mode-hook'
1094 with no arguments, if that value exists and is not `nil'; then it does
1095 the same with the variable `nroff-mode-hook'.
1096
1097 \1f
1098 File: xemacs.info,  Node: TeX Mode,  Next: Outline Mode,  Prev: Nroff Mode,  Up: Text Mode
1099
1100 TeX Mode
1101 --------
1102
1103    TeX is a powerful text formatter written by Donald Knuth; like GNU
1104 Emacs, it is free.  LaTeX is a simplified input format for TeX,
1105 implemented by TeX macros.  It is part of TeX.
1106
1107    Emacs has a special TeX mode for editing TeX input files.  It
1108 provides facilities for checking the balance of delimiters and for
1109 invoking TeX on all or part of the file.
1110
1111    TeX mode has two variants, Plain TeX mode and LaTeX mode, which are
1112 two distinct major modes that differ only slightly.  These modes are
1113 designed for editing the two different input formats.  The command `M-x
1114 tex-mode' looks at the contents of a buffer to determine whether it
1115 appears to be LaTeX input or not; it then selects the appropriate mode.
1116 If it can't tell which is right (e.g., the buffer is empty), the
1117 variable `tex-default-mode' controls which mode is used.
1118
1119    The commands `M-x plain-tex-mode' and `M-x latex-mode' explicitly
1120 select one of the variants of TeX mode.  Use these commands when `M-x
1121 tex-mode' does not guess right.
1122
1123 * Menu:
1124
1125 * Editing: TeX Editing.   Special commands for editing in TeX mode.
1126 * Printing: TeX Print.    Commands for printing part of a file with TeX.
1127
1128    TeX for Unix systems can be obtained from the University of
1129 Washington for a distribution fee.
1130
1131    To order a full distribution, send $140.00 for a 1/2 inch 9-track
1132 tape, $165.00 for two 4-track 1/4 inch cartridge tapes (foreign sites
1133 $150.00, for 1/2 inch, $175.00 for 1/4 inch, to cover the extra
1134 postage) payable to the University of Washington to:
1135
1136      The Director
1137      Northwest Computer Support Group,  DW-10
1138      University of Washington
1139      Seattle, Washington 98195
1140
1141 Purchase orders are acceptable, but there is an extra charge of $10.00
1142 to pay for processing charges. (The total cost comes to $150 for
1143 domestic sites, $175 for foreign sites).
1144
1145    The normal distribution is a tar tape, blocked 20, 1600 bpi, on an
1146 industry standard 2400 foot half-inch reel.  The physical format for
1147 the 1/4 inch streamer cartridges uses QIC-11, 8000 bpi, 4-track
1148 serpentine recording for the SUN.  Also, SystemV tapes can be written
1149 in cpio format, blocked 5120 bytes, ASCII headers.
1150