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», без необходимости каждый раз заново искать на чём Вы остановились. Поставьте закладку, и сможете в любой момент перейти на страницу, на которой закончили чтение.

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

Интервал:

Закладка:

Сделать

What if the text you want to delete is just a phrase? Or half a paragraph? Or several paragraphs? In Emacs, you select text by defining an area called a region . You can mark regions with the mouse or by using the keyboard. What happens with the mouse is a bit complicated, so we describe it later in this chapter, following our discussion of the system clipboard.

To define a region using the keyboard, you use a secondary pointer called a mark . Some versions of Emacs display the mark on the screen; unfortunately, in GNU Emacs, the mark is invisible.

You set the mark at one end of the region by pressing C-Spaceor C-@, then move the cursor to the other end of the region. (The cursor is sometimes also referred to as point . There is one minor but important difference between the cursor and the point, however. The cursor is on top of a character; in Emacs, the point is actually in between the character the cursor is on and the previous character. As we said, this difference is minor, but it helps you to visualize where the cursor should be when you mark a region.) Figure 2-5illustrates point, mark, and region.

Figure 2-5. Point, mark, and region

Let's mark a sample region. In this example, we remove the phrase "it was the worst of times." First, we find the beginning of the phrase. Then we set the mark, move forward to the end of the phrase, and cut.

Move to the beginning of "it" and press C-Space.

Set the mark Mark setappears in the minibuffer Move to the i in it was the - фото 29

Set the mark; Mark setappears in the minibuffer.

Move to the "i" in "it was the age of wisdom." Because the point is really just before the "i," this placement will be just right.

Move to the "i" in "it was the age of wisdom"

The point is at the end of the region to be marked Now the region is marked - фото 30

The point is at the end of the region to be marked.

Now the region is marked. If the region is not highlighted, you'll want to make sure it is marked correctly before giving the delete command. Press C-x C-x(for exchange-point-and-mark); this command swaps the locations of the mark and the point. If the cursor moves to where you thought the mark was, the region is marked correctly. Especially because you can't see the mark, it's a good habit to check its location using C-x C-xbefore deleting a region. People who have used Emacs for years still forget to set the mark and then make a deletion without knowing what they've just deleted. (The undo command, bound to C-_and C-x u, comes in handy in such a case.)

To cut the region, press C-w(for kill-region). (The scissors icon on the toolbar also works.)

Press: C-w

Cwcuts the region If youre not sure of what you deleted just press Cto - фото 31

C-wcuts the region.

If you're not sure of what you deleted, just press C-_to undo it. The text is still marked, and you can delete it again with C-wif you want to. To move text, mark it, press C-wto cut the region, then move the cursor to the place you want to insert the text, and press C-y. If you yank the text back into the wrong location, just type C-_to undo it, then move to the place you really wanted to put the text, and press C-yagain.

When you're defining a region, you normally set the mark at one end and then move the cursor to the other end of the region. A few shortcuts are helpful in some of the most common situations. To mark a paragraph, press M-h. This sets the mark at the end of the paragraph and places the cursor at the beginning automatically. Similarly, C-x h(for mark-whole-buffer) marks the entire buffer; the cursor goes to the beginning, and the mark is placed at the end. Finally, C-x C-pmarks the current page, with pages being defined by the C-lcharacter if you are in text mode. Of course, marking a paragraph, page, or buffer is usually only the prelude to some other operation, like killing ( C-w).

2.3.1 Copying Text

To copy text, mark a region, then press M-w(for kill-ring-save; the toolbar icon with two pieces of paper also runs this command). Move the cursor to the place where you want to insert the copied text and press C-y. Copying text is exactly the same as killing it, except that Emacs doesn't delete anything. The text you have copied is placed in the kill ring, so you can use C-yto access it as often as you like.

One advantage to M-wis that it works on read-only files and buffers. For example, if you wanted to create a file of Emacs hints, you could use M-wto copy some text from online help into one of your buffers.

Here are the steps for some common deletion tasks.

To mark a region:

1. Move the cursor to the beginning of the area you want to delete.

2. Press C-Space. Emacs displays the message Mark set.

3. Move the cursor to the end of the region you want to delete.

To delete a region:

1. Mark the region to be deleted.

2. Press C-wto delete the region.

To move text:

1. Delete the text you want to move using the procedures for marking and deleting a region.

2. Move the cursor where you want to insert the text.

3. Press C-y. Emacs inserts the text you deleted.

To copy text:

1. Mark the region you want to copy.

2. Press M-wto copy the text.

3. Move the cursor where you want to insert the copied text and press C-y. Emacs inserts the text you copied.

2.3.2 Recovering Earlier Deletions

Earlier we mentioned the kill ring, a temporary storage area in which Emacs saves the stuff you delete. So far, we've assumed that you're interested in resurrecting what you've most recently killed. However, the kill ring does a lot more. It actually stores your last 30 deletions. We've seen that C-yrestores the text you deleted most recently. Typing M-ydeletes the text you just yanked and gets the next most recent text from the kill ring.

Here's how it works. In Table 2-4, assume that you've just killed the words "most recent." C-yretrieves these words from the kill ring. When you press M-y, Emacs gets rid of "most recent" and gets the next entry from the kill ring ("second-last").

Table 2-4. The kill ring in action

Keystrokes Action
C-y This was the most recent_ deletion.
M-y This was the second-last_ deletion.
M-y This was the third-last_ deletion.
M-y This was the fourth-last_ deletion.

You can keep on typing M-y, retrieving successively more ancient deletions, until you reach the end of the kill ring (at which point it cycles back to the most recently killed text; that's why it's called a ring ).

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

Интервал:

Закладка:

Сделать

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

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


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

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

x