分类: LINUX
2010-09-19 16:23:30
1.5. About the Emacs Display
1.5. Emacs区域说明
When you enter Emacs, you see a large workspace near the top of the window where you do your editing. (See Figure 1-1.)
进入Emacs后,在窗口的上部你能看到一个很大的工作区域,你可以这里进行编辑。(见图1-1)
Figure 1-1. Understanding the Emacs display
图1-1,理解Emacs的显示

A cursor marks your position. The cursor is also called point, particularly among people who are more familiar with Emacs and in the online help system; therefore, it's useful to remember this term.
光标显示当前位置。光标也称“插入点”,尤其是对那些对Emacs较熟的人和在线帮助系统里;因此,有必要记住这个别称。
You don't have to do anything special before you start typing. As long as you type alphanumeric characters and punctuation, Emacs inserts them into your buffer. The cursor indicates where Emacs inserts the new characters; it moves as you type. Unlike many editors (particularly vi), Emacs does not have separate modes for inserting text and giving commands. Try typing something right now, and you'll begin to see how easy Emacs is to use. (If you get stuck for any reason, just press C-g.)
在打字之前不需要做任何特殊的事,当你开始输入字符,数字和标点的时候,Emacs将它们插入到缓冲区内。光标表示新字符插入的位置;当输入的时候它也跟着移动。不同于其他编辑器(尤其是 vi),Emacs没有针对输入和指令的单独模式。马上试着输入一些东西,你会发现Emacs是多么容易使用。(如果你被卡住了,按一下C-g)
1.5.1 The Toolbar
1.5.1 工具栏
The toolbar is a new feature in Emacs 21. Its basic icons and their functions are listed in Table 1-3. Note that the toolbar is context sensitive; in some modes, such as the Info mode for reading the Emacs manual, the toolbar changes to provide browsing help. We'll discuss those icons when we cover the relevant modes.
工具栏是Emacs 21新增的功能。表1.3列举了基本图标和功能。注意工具栏是上下文相关的,例如在信息模式下阅读Emacs手册,工具栏变成浏览帮助样式。我们会在介绍相关模式时讨论这些图标。
Table 1-3. Icons on the Emacs toolbar
If you don't like the toolbar, you can hide it using a menu option (Options Show/Hide Toolbar), and choosing Options Save Options. For more information, see Section 2.7 at the end of Chapter 2.
如果你不喜欢工具栏,可以通过菜单选项将其隐藏(选项 显示/隐藏工具栏),并点击保存选项。更多信息参考2.7节。
1.5.2 The Menus
1.5.2 菜单
The menu bar menu lists the options File, Edit, Options, Buffers, Tools, and Help; you can explore them to see what options are available.
菜单栏包括的选项有:文件,编辑,选项,缓冲区,工具和帮助。你可以打开他们看看哪些选项是可用的。
In addition to navigating the menus using the mouse, Emacs now offers pop-up menus. In the Emacs window, hold down Ctrl and click the right mouse button to pop up the Edit menu.[2]
为了用鼠标操作菜单,Emacs提供弹出菜单。在Emacs窗口,按住Ctrl键,单击鼠标右键就可以弹出编辑菜单了。【2】
[2] Emacs works best with a three-button mouse (more buttons are okay, too).
【2】Emacs 很适合三键鼠标(更多的键也没问题)。
You can access menus without a mouse using the keyboard. In this case, using keyboard commands is much more efficient than menus, but for completeness, we'll show you how to use the text-based menus. (If you prefer to use the mouse with Emacs but have access only to a text interface, see Chapter 13 to learn how to download and install a version of Emacs that runs graphically on Unix, Linux, Mac OS X, or Windows.)
你也可以用键盘来访问菜单。键盘指令比菜单更有效率,但是为了介绍的完整性,我们还是要向你介绍如何使用文本格式的菜单。如果你喜欢用鼠标操作Emacs但是只访问文本界面,参考第13章如何下载安装Unix,Linux,Mac OS或者WIndows图形界面下相应版本的Emacs)。
If your mouse does not work with the menus, press F10 or M-` (a back quote, the single open quotation mark, located above the Tab key in the upper-left corner of many keyboards) to access them.
如果你的鼠标不能操作菜单,按F10或者M-`(单引号,Tab键的上方,键盘的左上角儿)来访问菜单。
Press: F10

按:F10
Using text-based menus (Emacs 21.2 on Mac OS X Terminal application).
使用文本格式下的菜单(Mac OS X下的Emacs)
You can select text-based menu options in three ways:
你可以按以下三种方式选择文本格式下的菜单选项:
You can press Enter to select the default option that appears in the minibuffer. If you want a different one, press the up or down arrow key until the option you want appears and press Enter.
你可以按回车键选择迷你缓冲区中出现的默认选项。如果想选择其他选项,可以按上下键直到出现你想要的选项然后按回车。
You can type the letter preceding the option in the *Completions* buffer. For example, type f to choose File.
你可以录入*Completions*缓冲区中选项的首字母。例如,按f来选择文件。
You can press PgUp to move to the *Completions* buffer, then use the arrow keys to move to the option you want. Press Enter. (On Mac OS X, press Shift-PgUp instead.)
你可以按PgUp键移动到*Completions*缓冲区,然后用箭头移动到相应的选项,再按回车键。(在Mac OS X,用Shift-PgUp替代。)
After you select a menu option, choices for that menu appear. Repeat the process until you find the option you're looking for.
当你选择了菜单选项,相应的功能就会出现,重复操作直到找到你想要的选项。
1.5.3 The Mode Line
1.5.3 模式行
Just above the bottom of the window (on the second-to-last line), Emacs prints a lot of information about what it's doing. This line is called the mode line. At the beginning of the mode line, you may see some information about the coding system that Emacs is using for the file; usually you'll see just --:, indicating that there is no unusual encoding scheme in place. Near the left edge of the mode line, you may see two asterisks (**). These asterisks indicate that you've modified whatever you're editing. If you haven't made any changes, the asterisks won't be there. Next, Emacs prints the name of the buffer you are editing (*scratch*). Following this, Emacs shows where you are in the buffer—your position relative to the rest of the file and what line you are on (L5 for line 5 in Figure 1-1). If you're at the beginning of the file, Emacs prints the word Top; if you're at the end, it prints Bot; if you're in the middle, it shows you a percentage (for example, 50% means you're looking at the midpoint); and if the entire file is visible, Emacs prints the word All. In parentheses following this is the editing mode or modes you are in, in this case Lisp Interaction is the major mode (no minor modes are active). The scrollbar on the side of the window also indicates your position in the file.[3]
在窗口底部的上方一点儿(倒数第二行),Emacs描述很多其当前工作的信息。这行称为模式行。在模式行开始位置,你能看到当前文件的编码方案;通常你仅能看到“--”,这表明没有特殊的编码方案。在模式行的左边缘,你能看到两个星号(**)。这两个星号表明当前编辑的文件已经被修改。如果没做任何修改,星号就不会出现。后面,Emacs显示出当前编辑的缓冲区的名称(*scratch*).接着,Emacs显示你当前所在的缓冲区位置--你所处的相对位置,以及当前行(在图1-1中:L5表示第5行)。如果处于文章的起始处,Emacs显示Top;如果在末尾,则显示Bot;如果在文章的中部,则显示百分比(例如:50%表示你位于文章的正中间);如果全文都显示出来了,则显示ALL。后面的括号里显示的编辑模式或你所处的模式。本例中Lisp互动模式是主模式(没有启用副模式)。滚动条也显示出你当前在文件中所处的位置。【3】
[3] The scrollbar's location depends on the platform and windowing system you're using. Linux puts scrollbars on the left while Mac OS X and Windows put them on the right by default. Note also that the order of the information in the mode line is different if you run Emacs in a terminal window.
【3】滚动条的位置依赖于你当前的平台或窗体系统。Linux在左侧显示滚动条,Mac OS X 和 Windows 默认在右侧显示。注意,在终端窗口中运行Emacs时,模式行信息显示的顺序也不相同。
You will often work with several buffers simultaneously. In this case, each buffer has its own mode line, and when you switch buffers, the mode line reflects the state of the current buffer. Don't worry about this for now; just remember that every buffer has a mode line to describe it.
你经常会同时在多个缓冲区中工作。这样,每个缓冲区有其自己的模式行,当切换缓冲区后,模式行会显示当前缓冲区的状态。现在不用对此有所担心,只要记住每个缓冲区都有一个描述它的信息的模式行。
1.5.4 The Minibuffer
1.5.4 迷你缓冲区
Below the mode line is the minibuffer. This is the area where Emacs echoes the commands you enter and where you specify filenames for Emacs to find, values for search and replace, and so on. It is also where Emacs displays error messages. If you find yourself stuck in the minibuffer, press C-g to get out again.
在模式行下面是迷你缓冲区。它显示你输入的指令,你要找的文件名,要查找替换的值等等。也用于显示错误信息。如果你发现你卡在了迷你缓冲区,按“C-g”离开。