Commit | Line | Data |
---|---|---|
8cf51b2c | 1 | @c This is part of the Emacs manual. |
acaf905b | 2 | @c Copyright (C) 1985-1987, 1993-1995, 1997, 2001-2012 |
8838673e | 3 | @c Free Software Foundation, Inc. |
8cf51b2c GM |
4 | @c See file emacs.texi for copying conditions. |
5 | @node Screen, User Input, Acknowledgments, Top | |
6 | @chapter The Organization of the Screen | |
7 | @cindex screen | |
de0bde62 CY |
8 | @cindex frame |
9 | ||
10 | On a graphical display, such as on GNU/Linux using the X Window | |
0be641c0 CY |
11 | System, Emacs occupies a ``graphical window''. On a text terminal, |
12 | Emacs occupies the entire terminal screen. We will use the term | |
13 | @dfn{frame} to mean a graphical window or terminal screen occupied by | |
14 | Emacs. Emacs behaves very similarly on both kinds of frames. It | |
15 | normally starts out with just one frame, but you can create additional | |
16 | frames if you wish (@pxref{Frames}). | |
de0bde62 CY |
17 | |
18 | Each frame consists of several distinct regions. At the top of the | |
af07efeb CY |
19 | frame is a @dfn{menu bar}, which allows you to access commands via a |
20 | series of menus. On a graphical display, directly below the menu bar | |
21 | is a @dfn{tool bar}, a row of icons that perform editing commands if | |
de0bde62 CY |
22 | you click on them. At the very bottom of the frame is an @dfn{echo |
23 | area}, where informative messages are displayed and where you enter | |
24 | information when Emacs asks for it. | |
af07efeb CY |
25 | |
26 | The main area of the frame, below the tool bar (if one exists) and | |
de0bde62 CY |
27 | above the echo area, is called @dfn{the window}. Henceforth in this |
28 | manual, we will use the word ``window'' in this sense. Graphical | |
29 | display systems commonly use the word ``window'' with a different | |
30 | meaning; but, as stated above, we refer to those ``graphical windows'' | |
31 | as ``frames''. | |
32 | ||
33 | An Emacs window is where the @dfn{buffer}---the text you are | |
34 | editing---is displayed. On a graphical display, the window possesses | |
35 | a @dfn{scroll bar} on one side, which can be used to scroll through | |
36 | the buffer. The last line of the window is a @dfn{mode line}. This | |
af07efeb CY |
37 | displays various information about what is going on in the buffer, |
38 | such as whether there are unsaved changes, the editing modes that are | |
39 | in use, the current line number, and so forth. | |
40 | ||
41 | When you start Emacs, there is normally only one window in the | |
42 | frame. However, you can subdivide this window horizontally or | |
43 | vertically to create multiple windows, each of which can independently | |
de0bde62 CY |
44 | display a buffer (@pxref{Windows}). |
45 | ||
46 | At any time, one window is the @dfn{selected window}. On a | |
47 | graphical display, the selected window shows a more prominent cursor | |
48 | (usually solid and blinking); other windows show a less prominent | |
49 | cursor (usually a hollow box). On a text terminal, there is only one | |
50 | cursor, which is shown in the selected window. The buffer displayed | |
51 | in the selected window is called the @dfn{current buffer}, and it is | |
52 | where editing happens. Most Emacs commands implicitly apply to the | |
53 | current buffer; the text displayed in unselected windows is mostly | |
54 | visible for reference. If you use multiple frames on a graphical | |
55 | display, selecting a particular frame selects a window in that frame. | |
8cf51b2c GM |
56 | |
57 | @menu | |
8838673e GM |
58 | * Point:: The place in the text where editing commands operate. |
59 | * Echo Area:: Short messages appear at the bottom of the screen. | |
60 | * Mode Line:: Interpreting the mode line. | |
61 | * Menu Bar:: How to use the menu bar. | |
8cf51b2c GM |
62 | @end menu |
63 | ||
64 | @node Point | |
65 | @section Point | |
66 | @cindex point | |
67 | @cindex cursor | |
68 | ||
de0bde62 CY |
69 | The cursor in the selected window shows the location where most |
70 | editing commands take effect, which is called @dfn{point}@footnote{The | |
71 | term ``point'' comes from the character @samp{.}, which was the | |
72 | command in TECO (the language in which the original Emacs was written) | |
73 | for accessing the editing position.}. Many Emacs commands move point | |
74 | to different places in the buffer; for example, you can place point by | |
af07efeb CY |
75 | clicking mouse button 1 (normally the left button) at the desired |
76 | location. | |
8cf51b2c | 77 | |
de0bde62 CY |
78 | By default, the cursor in the selected window is drawn as a solid |
79 | block and appears to be @emph{on} a character, but you should think of | |
80 | point as @emph{between} two characters; it is situated @emph{before} | |
81 | the character under the cursor. For example, if your text looks like | |
82 | @samp{frob} with the cursor over the @samp{b}, then point is between | |
83 | the @samp{o} and the @samp{b}. If you insert the character @samp{!} | |
84 | at that position, the result is @samp{fro!b}, with point between the | |
85 | @samp{!} and the @samp{b}. Thus, the cursor remains over the | |
86 | @samp{b}, as before. | |
8cf51b2c GM |
87 | |
88 | If you are editing several files in Emacs, each in its own buffer, | |
de0bde62 CY |
89 | each buffer has its own value of point. A buffer that is not |
90 | currently displayed remembers its value of point if you later display | |
91 | it again. Furthermore, if a buffer is displayed in multiple windows, | |
92 | each of those windows has its own value of point. | |
93 | ||
94 | @xref{Cursor Display}, for options that control how Emacs displays | |
95 | the cursor. | |
8cf51b2c GM |
96 | |
97 | @node Echo Area | |
98 | @section The Echo Area | |
99 | @cindex echo area | |
100 | ||
af07efeb CY |
101 | The line at the very bottom of the frame is the @dfn{echo area}. It |
102 | is used to display small amounts of text for various purposes. | |
8cf51b2c | 103 | |
de0bde62 CY |
104 | @cindex echoing |
105 | The echo area is so-named because one of the things it is used for | |
106 | is @dfn{echoing}, which means displaying the characters of a | |
107 | multi-character command as you type. Single-character commands are | |
108 | not echoed. Multi-character commands (@pxref{Keys}) are echoed if you | |
109 | pause for more than a second in the middle of a command. Emacs then | |
110 | echoes all the characters of the command so far, to prompt you for the | |
111 | rest. Once echoing has started, the rest of the command echoes | |
112 | immediately as you type it. This behavior is designed to give | |
113 | confident users fast response, while giving hesitant users maximum | |
114 | feedback. | |
115 | ||
116 | @cindex error message | |
117 | @cindex echo area message | |
118 | The echo area is also used to display an @dfn{error message} when a | |
119 | command cannot do its job. Error messages may be accompanied by | |
120 | beeping or by flashing the screen. | |
121 | ||
122 | Some commands display informative messages in the echo area to tell | |
123 | you what the command has done, or to provide you with some specific | |
124 | information. These @dfn{informative} messages, unlike error messages, | |
125 | are not accompanied with a beep or flash. For example, @kbd{C-x =} | |
126 | (hold down @key{CTRL} and type @kbd{x}, then let go of @key{CTRL} and | |
127 | type @kbd{=}) displays a message describing the character at point, | |
128 | its position in the buffer, and its current column in the window. | |
129 | Commands that take a long time often display messages ending in | |
130 | @samp{...} while they are working (sometimes also indicating how much | |
131 | progress has been made, as a percentage), and add @samp{done} when | |
132 | they are finished. | |
8cf51b2c | 133 | |
1c64e6ed | 134 | @cindex @file{*Messages*} buffer |
8cf51b2c GM |
135 | @cindex saved echo area messages |
136 | @cindex messages saved from echo area | |
8cf51b2c | 137 | @vindex message-log-max |
de0bde62 | 138 | Informative echo area messages are saved in a special buffer named |
1c64e6ed | 139 | @file{*Messages*}. (We have not explained buffers yet; see |
af07efeb CY |
140 | @ref{Buffers}, for more information about them.) If you miss a |
141 | message that appeared briefly on the screen, you can switch to the | |
1c64e6ed | 142 | @file{*Messages*} buffer to see it again. The @file{*Messages*} |
af07efeb CY |
143 | buffer is limited to a certain number of lines, specified by the |
144 | variable @code{message-log-max}. (We have not explained variables | |
145 | either; see @ref{Variables}, for more information about them.) Beyond | |
146 | this limit, one line is deleted from the beginning whenever a new | |
147 | message line is added at the end. | |
148 | ||
de0bde62 CY |
149 | @xref{Display Custom}, for options that control how Emacs uses the |
150 | echo area. | |
151 | ||
af07efeb CY |
152 | @cindex minibuffer |
153 | The echo area is also used to display the @dfn{minibuffer}, a | |
154 | special window where you can input arguments to commands, such as the | |
155 | name of a file to be edited. When the minibuffer is in use, the text | |
de0bde62 CY |
156 | displayed in the echo area begins with a @dfn{prompt string}, and the |
157 | active cursor appears within the minibuffer, which is temporarily | |
158 | considered the selected window. You can always get out of the | |
159 | minibuffer by typing @kbd{C-g}. @xref{Minibuffer}. | |
8cf51b2c GM |
160 | |
161 | @node Mode Line | |
162 | @section The Mode Line | |
163 | @cindex mode line | |
164 | @cindex top level | |
8cf51b2c | 165 | |
af07efeb CY |
166 | At the bottom of each window is a @dfn{mode line}, which describes |
167 | what is going on in the current buffer. When there is only one | |
168 | window, the mode line appears right above the echo area; it is the | |
169 | next-to-last line in the frame. On a graphical display, the mode line | |
de0bde62 CY |
170 | is drawn with a 3D box appearance. Emacs also usually draws the mode |
171 | line of the selected window with a different color than that of | |
172 | unselected windows, in order to make it stand out. | |
8cf51b2c | 173 | |
af07efeb | 174 | The text displayed in the mode line has the following format: |
8cf51b2c GM |
175 | |
176 | @example | |
de0bde62 | 177 | @var{cs}:@var{ch}-@var{fr} @var{buf} @var{pos} @var{line} (@var{major} @var{minor}) |
8cf51b2c GM |
178 | @end example |
179 | ||
180 | @noindent | |
0be641c0 | 181 | On a text terminal, this text is followed by a series of dashes |
de0bde62 CY |
182 | extending to the right edge of the window. These dashes are omitted |
183 | on a graphical display. | |
184 | ||
af07efeb CY |
185 | The @var{cs} string and the colon character after it describe the |
186 | character set and newline convention used for the current buffer. | |
de0bde62 CY |
187 | Normally, Emacs automatically handles these settings for you, but it |
188 | is sometimes useful to have this information. | |
189 | ||
190 | @var{cs} describes the character set of the text in the buffer | |
191 | (@pxref{Coding Systems}). If it is a dash (@samp{-}), that indicates | |
bfd779dd | 192 | no special character set handling (with the possible exception of |
de0bde62 CY |
193 | end-of-line conventions, described in the next paragraph). @samp{=} |
194 | means no conversion whatsoever, and is usually used for files | |
195 | containing non-textual data. Other characters represent various | |
af07efeb | 196 | @dfn{coding systems}---for example, @samp{1} represents ISO Latin-1. |
de0bde62 | 197 | |
0be641c0 | 198 | On a text terminal, @var{cs} is preceded by two additional |
de0bde62 CY |
199 | characters that describe the coding systems for keyboard input and |
200 | terminal output. Furthermore, if you are using an input method, | |
201 | @var{cs} is preceded by a string that identifies the input method | |
202 | (@pxref{Input Methods}). | |
203 | ||
204 | @cindex end-of-line convention, mode-line indication | |
205 | The character after @var{cs} is usually a colon. If a different | |
206 | string is displayed, that indicates a nontrivial end-of-line | |
207 | convention for encoding a file. Usually, lines of text are separated | |
208 | by @dfn{newline characters} in a file, but two other conventions are | |
209 | sometimes used. The MS-DOS convention uses a ``carriage-return'' | |
af07efeb CY |
210 | character followed by a ``linefeed'' character; when editing such |
211 | files, the colon changes to either a backslash (@samp{\}) or | |
de0bde62 CY |
212 | @samp{(DOS)}, depending on the operating system. Another convention, |
213 | employed by older Macintosh systems, uses a ``carriage-return'' | |
214 | character instead of a newline; when editing such files, the colon | |
af07efeb CY |
215 | changes to either a forward slash (@samp{/}) or @samp{(Mac)}. On some |
216 | systems, Emacs displays @samp{(Unix)} instead of the colon for files | |
217 | that use newline as the line separator. | |
218 | ||
219 | The next element on the mode line is the string indicated by | |
220 | @var{ch}. This shows two dashes (@samp{--}) if the buffer displayed | |
221 | in the window has the same contents as the corresponding file on the | |
222 | disk; i.e., if the buffer is ``unmodified''. If the buffer is | |
223 | modified, it shows two stars (@samp{**}). For a read-only buffer, it | |
224 | shows @samp{%*} if the buffer is modified, and @samp{%%} otherwise. | |
225 | ||
226 | The character after @var{ch} is normally a dash (@samp{-}). | |
227 | However, if the default-directory for the current buffer is on a | |
228 | remote machine, @samp{@@} is displayed instead (@pxref{File Names}). | |
8cf51b2c GM |
229 | |
230 | @var{fr} gives the selected frame name (@pxref{Frames}). It appears | |
0be641c0 | 231 | only on text terminals. The initial frame's name is @samp{F1}. |
8cf51b2c | 232 | |
af07efeb CY |
233 | @var{buf} is the name of the buffer displayed in the window. |
234 | Usually, this is the same as the name of a file you are editing. | |
235 | @xref{Buffers}. | |
8cf51b2c | 236 | |
de0bde62 CY |
237 | @var{pos} tells you whether there is additional text above the top |
238 | of the window, or below the bottom. If your buffer is small and all | |
239 | of it is visible in the window, @var{pos} is @samp{All}. Otherwise, | |
240 | it is @samp{Top} if you are looking at the beginning of the buffer, | |
241 | @samp{Bot} if you are looking at the end of the buffer, or | |
242 | @samp{@var{nn}%}, where @var{nn} is the percentage of the buffer above | |
243 | the top of the window. With Size Indication mode, you can display the | |
244 | size of the buffer as well. @xref{Optional Mode Line}. | |
8cf51b2c | 245 | |
af07efeb CY |
246 | @var{line} is the character @samp{L} followed by the line number at |
247 | point. (You can display the current column number too, by turning on | |
248 | Column Number mode. @xref{Optional Mode Line}.) | |
8cf51b2c | 249 | |
af07efeb CY |
250 | @var{major} is the name of the @dfn{major mode} used in the buffer. |
251 | A major mode is a principal editing mode for the buffer, such as Text | |
de0bde62 CY |
252 | mode, Lisp mode, C mode, and so forth. @xref{Major Modes}. Some |
253 | major modes display additional information after the major mode name. | |
254 | For example, Compilation buffers and Shell buffers display the status | |
255 | of the subprocess. | |
8cf51b2c | 256 | |
de0bde62 CY |
257 | @var{minor} is a list of some of the enabled @dfn{minor modes}, |
258 | which are optional editing modes that provide additional features on | |
259 | top of the major mode. @xref{Minor Modes}. | |
8cf51b2c | 260 | |
af07efeb | 261 | Some features are listed together with the minor modes whenever they |
7ee6a1d3 | 262 | are turned on, even though they are not really minor modes. |
af07efeb CY |
263 | @samp{Narrow} means that the buffer being displayed has editing |
264 | restricted to only a portion of its text (@pxref{Narrowing}). | |
265 | @samp{Def} means that a keyboard macro is currently being defined | |
266 | (@pxref{Keyboard Macros}). | |
8cf51b2c GM |
267 | |
268 | In addition, if Emacs is inside a recursive editing level, square | |
269 | brackets (@samp{[@dots{}]}) appear around the parentheses that | |
270 | surround the modes. If Emacs is in one recursive editing level within | |
271 | another, double square brackets appear, and so on. Since recursive | |
de0bde62 CY |
272 | editing levels affect Emacs globally, such square brackets appear in |
273 | the mode line of every window. @xref{Recursive Edit}. | |
8cf51b2c | 274 | |
af07efeb CY |
275 | You can change the appearance of the mode line as well as the format |
276 | of its contents. @xref{Optional Mode Line}. In addition, the mode | |
277 | line is mouse-sensitive; clicking on different parts of the mode line | |
278 | performs various commands. @xref{Mode Line Mouse}. | |
8cf51b2c GM |
279 | |
280 | @node Menu Bar | |
281 | @section The Menu Bar | |
282 | @cindex menu bar | |
283 | ||
284 | Each Emacs frame normally has a @dfn{menu bar} at the top which you | |
285 | can use to perform common operations. There's no need to list them | |
286 | here, as you can more easily see them yourself. | |
287 | ||
288 | @kindex M-` | |
289 | @kindex F10 | |
290 | @findex tmm-menubar | |
291 | @findex menu-bar-open | |
292 | On a graphical display, you can use the mouse to choose a command | |
de0bde62 | 293 | from the menu bar. An arrow on the right edge of a menu item means it |
af07efeb | 294 | leads to a subsidiary menu, or @dfn{submenu}. A @samp{...} at the end |
de0bde62 CY |
295 | of a menu item means that the command will prompt you for further |
296 | input before it actually does anything. | |
8cf51b2c | 297 | |
af07efeb CY |
298 | Some of the commands in the menu bar have ordinary key bindings as |
299 | well; if so, a key binding is shown in parentheses after the item | |
300 | itself. To view the full command name and documentation for a menu | |
301 | item, type @kbd{C-h k}, and then select the menu bar with the mouse in | |
302 | the usual way (@pxref{Key Help}). | |
8cf51b2c | 303 | |
af07efeb CY |
304 | Instead of using the mouse, you can also invoke the first menu bar |
305 | item by pressing @key{F10} (to run the command @code{menu-bar-open}). | |
306 | You can then navigate the menus with the arrow keys. To activate a | |
307 | selected menu item, press @key{RET}; to cancel menu navigation, press | |
308 | @key{ESC}. | |
8cf51b2c | 309 | |
0be641c0 CY |
310 | On a text terminal, you can use the menu bar by typing @kbd{M-`} or |
311 | @key{F10} (these run the command @code{tmm-menubar}). This lets you | |
312 | select a menu item with the keyboard. A provisional choice appears in | |
313 | the echo area. You can use the up and down arrow keys to move through | |
314 | the menu to different items, and then you can type @key{RET} to select | |
315 | the item. Each menu item is also designated by a letter or digit | |
316 | (usually the initial of some word in the item's name). This letter or | |
317 | digit is separated from the item name by @samp{=>}. You can type the | |
318 | item's letter or digit to select the item. |