@c This is part of the Emacs manual.@c Copyright (C) 1985,86,87,93,94,95,1997,2001 Free Software Foundation, Inc.@c See file emacs.texi for copying conditions.@node Screen, User Input, Acknowledgments, Top@chapter The Organization of the Screen@cindex screen@cindex parts of the screen@c On a text-only terminal, the Emacs display occupies the whole screen.On the X Window System, Emacs creates its own X windows to use. We usethe term @dfn{frame} to mean an entire text-only screen or an entire Xwindow used by Emacs. Emacs uses both kinds of frames in the same wayto display your editing. Emacs normally starts out with just one frame,but you can create additional frames if you wish. @xref{Frames}. When you start Emacs, the entire frame except for the top and bottomis devoted to the text you are editing. This area is called the@dfn{window}. At the top there is normally a @dfn{menu bar} where youcan access a series of menus; then there may be a @dfn{tool bar}, arow of icons that perform editing commands if you click on them.Below this, the window begins. The last line is a special @dfn{echoarea} or @dfn{minibuffer window}, where prompts appear and where youenter information when Emacs asks for it. See below for moreinformation about these special lines. You can subdivide the large text window horizontally or verticallyinto multiple text windows, each of which can be used for a differentfile (@pxref{Windows}). In this manual, the word ``window'' alwaysrefers to the subdivisions of a frame within Emacs. At any time, one window is the @dfn{selected window}; the mostprominent cursor indicates which window is selected. Most Emacscommands implicitly apply to the text in the selected window (thoughmouse commands generally operate on whatever window you click them in,whether selected or not). The other windows display text forreference only, unless/until you select them. If you use multipleframes under the X Window System, then giving the input focus to aparticular frame selects a window in that frame. Each window's last line is a @dfn{mode line}, which describes whatis going on in that window. It appears in inverse video, if theterminal supports that; its contents normally begin with@w{@samp{--:-- @ *scratch*}} when Emacs starts. The mode linedisplays status information such as what buffer is being displayedabove it in the window, what major and minor modes are in use, andwhether the buffer contains unsaved changes.@menu* Point:: The place in the text where editing commands operate.* Echo Area:: Short messages appear at the bottom of the screen.* Mode Line:: Interpreting the mode line.* Menu Bar:: How to use the menu bar.@end menu@node Point@section Point@cindex point@cindex cursor Within Emacs, the terminal's cursor shows the location at whichediting commands will take effect. This location is called @dfn{point}.Many Emacs commands move point through the text, so that you can edit atdifferent places in it. You can also place point by clicking mousebutton 1. While the cursor appears to point @emph{at} a character, you shouldthink of point as @emph{between} two characters; it points @emph{before}the character that appears under the cursor. For example, if your textlooks like @samp{frob} with the cursor over the @samp{b}, then point isbetween the @samp{o} and the @samp{b}. If you insert the character@samp{!} at that position, the result is @samp{fro!b}, with pointbetween the @samp{!} and the @samp{b}. Thus, the cursor remains overthe @samp{b}, as before. Sometimes people speak of ``the cursor'' when they mean ``point,'' orspeak of commands that move point as ``cursor motion'' commands. If you are editing several files in Emacs, each in its own buffer,each buffer has its own point location. A buffer that is notcurrently displayed remembers its point location in case you displayit again later. When Emacs displays multiple windows, each window hasits own point location. If the same buffer appears in more than onewindow, each window has its own position for point in that buffer, and(when possible) its own cursor. A text-only terminal has just one cursor, so Emacs puts itin the selected window. The other windows do not show a cursor, eventhough they do have a location of point. When Emacs updates thescreen on a text-only terminal, it has to put the cursor temporarilyat the place the output goes. This doesn't mean point is there,though. Once display updating finishes, Emacs puts the cursor wherepoint is. On graphical terminals, Emacs shows a cursor in each window; theselected window's cursor is solid or blinking, and the other cursorsare just hollow. Thus, the most striking cursor always shows youthe selected window, on all kinds of terminals. @xref{Cursor Display}, for customization options that control displayof the cursor or cursors. The term ``point'' comes from the character @samp{.}, which was thecommand in TECO (the language in which the original Emacs was written)for accessing the value now called ``point.''@node Echo Area@section The Echo Area@cindex echo area@c The line at the bottom of the frame (below the mode line) is the@dfn{echo area}. It is used to display small amounts of text forseveral purposes. @dfn{Echoing} means displaying the characters that you type. OutsideEmacs, the operating system normally echoes all your input. Emacshandles echoing differently. Single-character commands do not echo in Emacs, and multi-charactercommands echo only if you pause while typing them. As soon as you pausefor more than a second in the middle of a command, Emacs echoes all thecharacters of the command so far. This is to @dfn{prompt} you for therest of the command. Once echoing has started, the rest of the commandechoes immediately as you type it. This behavior is designed to giveconfident users fast response, while giving hesitant users maximumfeedback. You can change this behavior by setting a variable(@pxref{Display Custom}).@cindex error message in the echo area If a command cannot be executed, it may display an @dfn{error message}in the echo area. Error messages are accompanied by beeping or byflashing the screen. The error also discards any input you have typedahead. Some commands display informative messages in the echo area. Thesemessages look much like error messages, but they are not announcedwith a beep and do not throw away input. Sometimes the message tellsyou what the command has done, when this is not obvious from lookingat the text being edited. Sometimes the sole purpose of a command isto show you a message giving you specific information---for example,@kbd{C-x =} (hold down @key{CTRL} and type @kbd{x}, then let go of@key{CTRL} and type @kbd{=}) displays a message describing thecharacter position of point in the text and its current column in thewindow. Commands that take a long time often display messages endingin @samp{...} while they are working, and add @samp{done} at the endwhen they are finished.@cindex @samp{*Messages*} buffer@cindex saved echo area messages@cindex messages saved from echo area Echo-area informative messages are saved in an editor buffer named@samp{*Messages*}. (We have not explained buffers yet; see@ref{Buffers}, for more information about them.) If you miss a messagethat appears briefly on the screen, you can switch to the@samp{*Messages*} buffer to see it again. (Successive progress messagesare often collapsed into one in that buffer.)@vindex message-log-max The size of @samp{*Messages*} is limited to a certain number of lines.The variable @code{message-log-max} specifies how many lines. Once thebuffer has that many lines, each line added at the end deletes one linefrom the beginning. @xref{Variables}, for how to set variables such as@code{message-log-max}. The echo area is also used to display the @dfn{minibuffer}, a window thatis used for reading arguments to commands, such as the name of a file to beedited. When the minibuffer is in use, the echo area begins with a promptstring that usually ends with a colon; also, the cursor appears in that linebecause it is the selected window. You can always get out of theminibuffer by typing @kbd{C-g}. @xref{Minibuffer}.@node Mode Line@section The Mode Line@cindex mode line@cindex top level@c Each text window's last line is a @dfn{mode line}, which describeswhat is going on in that window. When there is only one text window,the mode line appears right above the echo area; it is thenext-to-last line in the frame. The mode line starts and ends withdashes. On a text-mode display, the mode line is in inverse video ifthe terminal supports that; on a graphics display, the mode line has a3D box appearance to help it stand out. The mode line of theselected window has a slightly different appearance than those ofother windows; see @ref{Optional Mode Line}, for more about this. Normally, the mode line looks like this:@example-@var{cs}:@var{ch} @var{buf} @var{line} @var{pos} (@var{major} @var{minor})------@end example@noindentThis gives information about the buffer being displayed in the window: thebuffer's name, what major and minor modes are in use, whether the buffer'stext has been changed, and how far down the buffer you are currentlylooking. @var{ch} contains two stars @samp{**} if the text in the buffer hasbeen edited (the buffer is ``modified''), or @samp{--} if the buffer hasnot been edited. For a read-only buffer, it is @samp{%*} if the bufferis modified, and @samp{%%} otherwise. @var{buf} is the name of the window's @dfn{buffer}. In most casesthis is the same as the name of a file you are editing. @xref{Buffers}. The buffer displayed in the selected window (the window that thecursor is in) is also Emacs's current buffer, the one that editingtakes place in. When we speak of what some command does to ``thebuffer,'' we are talking about the current buffer. @var{line} is @samp{L} followed by the current line number of point.This is present when Line Number mode is enabled (which it normally is).You can optionally display the current column number too, by turning onColumn Number mode (which is not enabled by default because it issomewhat slower). @xref{Optional Mode Line}. @var{pos} tells you whether there is additional text above the top ofthe window, or below the bottom. If your buffer is small and it is allvisible in the window, @var{pos} is @samp{All}. Otherwise, it is@samp{Top} if you are looking at the beginning of the buffer, @samp{Bot}if you are looking at the end of the buffer, or @samp{@var{nn}%}, where@var{nn} is the percentage of the buffer above the top of thewindow.@refill @var{major} is the name of the @dfn{major mode} in effect in thebuffer. At any time, each buffer is in one and only one of the possiblemajor modes. The major modes available include Fundamental mode (theleast specialized), Text mode, Lisp mode, C mode, Texinfo mode, and manyothers. @xref{Major Modes}, for details of how the modes differ and howto select one.@refill Some major modes display additional information after the major modename. For example, Rmail buffers display the current message number andthe total number of messages. Compilation buffers and Shell buffersdisplay the status of the subprocess. @var{minor} is a list of some of the @dfn{minor modes} that are turnedon at the moment in the window's chosen buffer. For example,@samp{Fill} means that Auto Fill mode is on. @samp{Abbrev} means thatWord Abbrev mode is on. @samp{Ovwrt} means that Overwrite mode is on.@xref{Minor Modes}, for more information. @samp{Narrow} means that thebuffer being displayed has editing restricted to only a portion of itstext. This is not really a minor mode, but is like one.@xref{Narrowing}. @samp{Def} means that a keyboard macro is beingdefined. @xref{Keyboard Macros}. In addition, if Emacs is currently inside a recursive editing level,square brackets (@samp{[@dots{}]}) appear around the parentheses thatsurround the modes. If Emacs is in one recursive editing level withinanother, double square brackets appear, and so on. Since recursiveediting levels affect Emacs globally, not just one buffer, the squarebrackets appear in every window's mode line or not in any of them.@xref{Recursive Edit}.@refill Non-windowing terminals can only show a single Emacs frame at a time(@pxref{Frames}). On such terminals, the mode line displays the name ofthe selected frame, after @var{ch}. The initial frame's name is@samp{F1}. @var{cs} states the coding system used for the file you are editing.A dash indicates the default state of affairs: no code conversion,except for end-of-line translation if the file contents call for that.@samp{=} means no conversion whatsoever. Nontrivial code conversionsare represented by various letters---for example, @samp{1} refers to ISOLatin-1. @xref{Coding Systems}, for more information. If you are usingan input method, a string of the form @samp{@var{i}>} is added to thebeginning of @var{cs}; @var{i} identifies the input method. (Some inputmethods show @samp{+} or @samp{@@} instead of @samp{>}.) @xref{InputMethods}. When you are using a character-only terminal (not a window system),@var{cs} uses three characters to describe, respectively, the codingsystem for keyboard input, the coding system for terminal output, andthe coding system used for the file you are editing. When multibyte characters are not enabled, @var{cs} does not appear atall. @xref{Enabling Multibyte}.@cindex end-of-line conversion, mode-line indication The colon after @var{cs} can change to another string in certaincircumstances. Emacs uses newline characters to separate lines in the buffer.Some files use different conventions for separating lines: eithercarriage-return linefeed (the MS-DOS convention) or just carriage-return(the Macintosh convention). If the buffer's file uses carriage-returnlinefeed, the colon changes to either a backslash (@samp{\}) or@samp{(DOS)}, depending on the operating system. If the file uses justcarriage-return, the colon indicator changes to either a forward slash(@samp{/}) or @samp{(Mac)}. On some systems, Emacs displays@samp{(Unix)} instead of the colon even for files that use newline toseparate lines.@vindex eol-mnemonic-unix@vindex eol-mnemonic-dos@vindex eol-mnemonic-mac@vindex eol-mnemonic-undecided You can customize the mode line display for each of the end-of-lineformats by setting each of the variables @code{eol-mnemonic-unix},@code{eol-mnemonic-dos}, @code{eol-mnemonic-mac}, and@code{eol-mnemonic-undecided} to any string you find appropriate.@xref{Variables}, for an explanation of how to set variables. @xref{Optional Mode Line}, for features that add other handyinformation to the mode line, such as the current column number ofpoint, the current time, and whether new mail for you has arrived.The mode line is mouse-sensitive; when you move the mouse acrossvarious parts of it, Emacs displays help text to say what a click inthat place will do. @xref{Mode Line Mouse}.@node Menu Bar@section The Menu Bar@cindex menu bar Each Emacs frame normally has a @dfn{menu bar} at the top which youcan use to perform certain common operations. There's no need to listthem here, as you can more easily see for yourself.@kindex M-`@kindex F10@findex tmm-menubar When you are using a window system, you can use the mouse to choose acommand from the menu bar. An arrow pointing right, after the menuitem, indicates that the item leads to a subsidiary menu; @samp{...} atthe end means that the command will read arguments from the keyboardbefore it actually does anything. To view the full command name and documentation for a menu item, type@kbd{C-h k}, and then select the menu bar with the mouse in the usualway (@pxref{Key Help}). On text-only terminals with no mouse, you can use the menu bar bytyping @kbd{M-`} or @key{F10} (these run the command@code{tmm-menubar}). This command enters a mode in which you can selecta menu item from the keyboard. A provisional choice appears in the echoarea. You can use the left and right arrow keys to move through themenu to different choices. When you have found the choice you want,type @key{RET} to select it. Each menu item also has an assigned letter or digit which designatesthat item; it is usually the initial of some word in the item's name.This letter or digit is separated from the item name by @samp{=>}. Youcan type the item's letter or digit to select the item. Some of the commands in the menu bar have ordinary key bindings aswell; if so, the menu lists one equivalent key binding in parenthesesafter the item itself.