Debra Cameron - Learning GNU Emacs, 3rd Edition

Здесь есть возможность читать онлайн «Debra Cameron - Learning GNU Emacs, 3rd Edition» весь текст электронной книги совершенно бесплатно (целиком полную версию без сокращений). В некоторых случаях можно слушать аудио, скачать через торрент в формате fb2 и присутствует краткое содержание. Год выпуска: 2004, ISBN: 2004, Издательство: O'Reilly Media, Жанр: Программы, Программирование, на английском языке. Описание произведения, (предисловие) а так же отзывы посетителей доступны на портале библиотеки ЛибКат.

Learning GNU Emacs, 3rd Edition: краткое содержание, описание и аннотация

Предлагаем к чтению аннотацию, описание, краткое содержание или предисловие (зависит от того, что написал сам автор книги «Learning GNU Emacs, 3rd Edition»). Если вы не нашли необходимую информацию о книге — напишите в комментариях, мы постараемся отыскать её.

GNU Emacs is the most popular and widespread of the Emacs family of editors. It is also the most powerful and flexible. Unlike all other text editors, GNU Emacs is a complete working environment—you can stay within Emacs all day without leaving.
, 3rd Edition tells readers how to get started with the GNU Emacs editor. It is a thorough guide that will also "grow" with you: as you become more proficient, this book will help you learn how to use Emacs more effectively. It takes you from basic Emacs usage (simple text editing) to moderately complicated customization and programming.The third edition of
describes Emacs 21.3 from the ground up, including new user interface features such as an icon-based toolbar and an interactive interface to Emacs customization. A new chapter details how to install and run Emacs on Mac OS X, Windows, and Linux, including tips for using Emacs effectively on those platforms.
, third edition, covers:
• How to edit files with Emacs
• Using the operating system shell through Emacs
• How to use multiple buffers, windows, and frames
• Customizing Emacs interactively and through startup files
• Writing macros to circumvent repetitious tasks
• Emacs as a programming environment for Java, C++, and Perl, among others
• Using Emacs as an integrated development environment (IDE)
• Integrating Emacs with CVS, Subversion and other change control systems for projects with multiple developers
• Writing HTML, XHTML, and XML with Emacs
• The basics of Emacs Lisp
The book is aimed at new Emacs users, whether or not they are programmers. Also useful for readers switching from other Emacs implementations to GNU Emacs.

Learning GNU Emacs, 3rd Edition — читать онлайн бесплатно полную книгу (весь текст) целиком

Ниже представлен текст книги, разбитый по страницам. Система сохранения места последней прочитанной страницы, позволяет с удобством читать онлайн бесплатно книгу «Learning GNU Emacs, 3rd Edition», без необходимости каждый раз заново искать на чём Вы остановились. Поставьте закладку, и сможете в любой момент перейти на страницу, на которой закончили чтение.

Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

We saw an example of Emacs's completion facility in Chapter 1 Chapter 1. Emacs Basics Some of you out there are probably dying to get your hands on the keyboard and start typing. We won't try to stop you; turn to the section called "Starting Emacs" and you can go ahead. But do read the beginning of this chapter later when you're ready for a break. Emacs is much easier to learn if you understand some of the basic concepts involved, which we discuss in the following introduction. . Completion is more than just a feature: it is a general principle in the design of Emacs. It can be articulated as follows:

If you have to type in the name of something, and that name is one of a finite number of possibilities, Emacs should figure out what you mean after the smallest possible number of keystrokes.

In other words, you can type in the shortest unambiguous prefix and tell Emacs to figure out the rest of the name. By "shortest unambiguous prefix," we mean "enough of the name, starting from the beginning, to distinguish it from the other possibilities." Several important things in Emacs have names that are chosen from a finite number of possibilities, including the following:

• Commands

• Files in a given directory

• Buffers

• Emacs variables

Most of the time, completion is available when you are prompted for a name of something in the minibuffer. While you are typing in the name, you can use three keys to tell Emacs to help complete it for you: Tab, Space, and question mark ( ?). Their functions are shown in Table 14-5.

Table 14-5. Completion keys

Keystroke Action
Tab Completes the name as far as possible.
Space Completes the name out to the next punctuation character.
? Lists the choices at this point in a *Completions*window.

You will probably find Tabto be the most useful.

As a running example, assume you have typed C-x C-fto visit a file, and the file you want to visit is a C program called program.c . Let's say you type proand press Tab; Emacs responds by completing the name to the full program.c . If you press Space, Emacs completes only as far as program . After Emacs completes the name, you can press Enterto visit the file.

How much of the name do you need to type in before you can use completion? That depends on the other possible choices in the given situation. If program.c were the only file in your directory, you could just type pand press Tab. [98]If there were other files in your directory and none of them has a name beginning with p, you could do the same thing. But if you had a file called problem.c , you would have to type progbefore you pressed Tab; in this case, progis the shortest unambiguous prefix. If you just type in proand press Tab, Emacs responds with a *Completions*window containing a list of the completion choices, in this case program.c and problem.c , and returns your cursor to the minibuffer so that you can finish typing the filename. The same thing happens if you typed a question mark instead of Tab. At this point, you can type gand press Tabagain; Emacs completes the name to program.c .

As another example, let's say you have documentation for your C program in the file program.txt , and you want to visit it. You press C-x C-fand type progat the prompt, followed by Tab. Emacs completes out to program .. At this point, you can type tand press Tabagain; Emacs completes the entire program.txt . In other words, you can use completion repeatedly when specifying a name.

Finally, let's say you also have a file in your directory called simply program , which is the result of compiling your C file, but you still want to visit the documentation file. You type progand press Tab; Emacs completes out to program . (including the period). At this point, Taband Spacedo different things. If you press Tabagain, Emacs responds with the message [Complete, but not unique]in the minibuffer, but if you press Space, Emacs assumes you aren't interested in the file program and attempts to complete further. Because you have the files program.c and program.txt , Emacs only completes out to program ., and you have to type tand press Tabagain.

Completion works the same way with buffer names, for example, when you type C-x bto switch to another buffer in the current window. It also works with command names when you type M-x—but with one added feature. Notice that when you specify a file or buffer name, it is possible that the file or buffer you want doesn't yet exist (for example, when you want to create a new file). In this case, of course, you must type in the entire file or buffer name and press Enter. But when you type M-xfor a command, there is no possibility of the command not existing. Therefore, Emacs automatically attempts to do completion on command names when you press Enter.

For example, if you want to put a buffer for a text file in auto-fill mode (see Chapter 2), you can type M-x auto-fand press Enterinstead of typing the entire M-x auto-fill-mode. If you type in a nonunique (ambiguous) prefix of a command name—for example, if you type M-x aut—and press Enter, then Enteracts just like Tab; in this case, it completes out to auto. If you press Enteragain, Emacs responds with a *Completions*window listing the choices. To get auto-fill-mode, you have to type fand press Enteragain.

Completion on command names with Enteris very convenient. After you have used Emacs for a while, you will become familiar with the shortest unambiguous prefixes for commands you use often, and you can save a considerable amount of typing by using these prefixes instead of the full names. [99]

Emacs can also do completion on the names of Emacs variables. In Chapter 2, and elsewhere, we saw how you can use M-x set-variableto change the values of Emacs variables. The Enterfeature just described works on variables as well as commands; therefore, you can use completion, including Enter, when doing M-x set-variable. Actually, commands and variables are both special kinds of Emacs Lisp symbols , and Emacs can do completion with Enteron all kinds of Lisp symbols. Completion on Lisp symbols comes in handy when you are using some of the help commands described earlier in this chapter.

14.5.1 Customizing Completion

If you have read Chapter 10and are comfortable with setting Emacs variables, you should know that a few variables can customize the way Emacs does completion. The variable completion-auto-helpdetermines whether a *Completions*window automatically appears when you try to use Spaceor Tabon an ambiguous prefix. Its default is t, meaning that such windows automatically appear. If you set it to nil, instead of a *Completions*window appearing, Emacs just displays the message [Next char not unique]for a couple of seconds in the minibuffer.

Читать дальше
Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

Похожие книги на «Learning GNU Emacs, 3rd Edition»

Представляем Вашему вниманию похожие книги на «Learning GNU Emacs, 3rd Edition» списком для выбора. Мы отобрали схожую по названию и смыслу литературу в надежде предоставить читателям больше вариантов отыскать новые, интересные, ещё непрочитанные произведения.


Отзывы о книге «Learning GNU Emacs, 3rd Edition»

Обсуждение, отзывы о книге «Learning GNU Emacs, 3rd Edition» и просто собственные мнения читателей. Оставьте ваши комментарии, напишите, что Вы думаете о произведении, его смысле или главных героях. Укажите что конкретно понравилось, а что нет, и почему Вы так считаете.

x