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

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

Интервал:

Закладка:

Сделать

Emacs provides many ways to delete text. The simplest way to delete text is to press the Delkey, which deletes the character immediately to the left of the cursor. See Figure 2-4for possible locations of the Delkey on your keyboard. It is sometimes referred to as the Backspacekey. Delis easiest to define by what it does: it deletes the previous character. If you're typing and you decide to erase the last character you typed, what key do you reach for? That's the key Emacs refers to as Del.

Emacs provides a number of other deletion commands—perhaps too many for your taste, although you'll eventually find a reason to use most of them. For example, C-d(for delete-character) deletes the character under the cursor. The command for deleting the next word is M-d(for kill-word). Once again, note how the Metakey augments the command: C-doperates on a character, and M-doperates on a word.

Emacs has commands to delete the next or previous word, sentence, and paragraph. By their names, you can guess what they do when you're between words, sentences, or paragraphs. If you're in the middle of an entity, however, they do something a little surprising: they delete a portion of the current word, sentence, or paragraph, backward or forward depending on whether the command deletes previous or next. For example, here's how M-dacts differently depending on where the cursor is.

If the cursor is here: M-d makes this edit:
It was the w orst of times It was the w_ of times
It was the worst of times It was the_ of times
It was the wors tof times It was the wors_ of times

Similarly, if you are in the middle of a word and ask Emacs to delete the previous word ( M-Del, for backward-kill-word), it deletes from the cursor position back to the beginning of the current word.

If you want to delete an entire line or part of a line, use the command C-k(for kill-line). This command deletes everything from the cursor to the end of the line. Typing C-kon a blank line deletes the line itself. So, it usually takes two C-k's to delete a line: one to delete the text and one to delete the resulting blank line. If you want to delete everything from the beginning of the line up to the cursor, try the more complex incantation Meta - C-k(i.e., hold down Meta, followed by a hyphen, and then C-k).

You can also use C-kto join two lines. If you're at the end of a line, C-kdeletes the newline character, effectively making two lines into one long line.

2.2.1 The Kill Ring

By now you may have noticed that some deletion commands in Emacs are called kill commands, such as kill-region, kill-word, and the like. In Emacs, killing is not fatal, but in fact, quite the opposite. Text that has been killed is not gone forever but is hidden in an area called the kill ring . The kill ring, though it sounds somewhat like a violent gang, is an internal storage area where Emacs puts things you've copied or deleted. Do not confuse the kill ring with the system clipboard, which allows for copying and pasting between applications. We'll cover how Emacs relates to the system clipboard later in this chapter.

You can get back what you've deleted by typing C-y(for yank). [12]Conveniently, if you kill several lines in succession, Emacs collects them into a single item and places the whole unit into the kill ring; a single C-ycommand will bring everything back. In the following example, we'll use C-kfour times to delete the first two lines of A Tale of Two Cities . (Remember: the first C-kdeletes the text; the second C-kdeletes the remaining blank line.) Then we'll use a single C-yto bring everything back.

Initial state:

The cursor is in upperleft corner Type Ck Ck Ck Ck You have deleted - фото 26

The cursor is in upper-left corner.

Type: C-k C-k C-k C-k

You have deleted the first two lines with Ck Type Cy You got everything - фото 27

You have deleted the first two lines with C-k.

Type: C-y

You got everything back with a single command What exactly goes into the kill - фото 28

You got everything back with a single command.

What exactly goes into the kill ring? Everything you delete with C-kin addition to everything you delete with C-wand everything you copy with M-w(two commands that you'll learn shortly) go into the kill ring. Words, sentences, and paragraphs that you delete with M-d, M-Del, and their relatives also go into the kill ring. In addition, text that you delete with C-ufollowed by either Delor C-dgoes into the kill ring. About the only thing that Emacs doesn't save in the kill ring is single characters, deleted with Delor C-d. (If you need to, you can get this type of deletion back using the undocommand, bound to both C-_and C-x u.)

Emacs is clever about what it puts into the kill ring: when it is assembling a big block of text from a group of deletions, it always assembles the text correctly. For example, you can type a few M-d's, followed by some M-Del's, with a couple of C-k's thrown in. When you type C-y, Emacs yanks all the text that you've deleted in the proper order.

However, there's one thing you have to watch out for. Emacs stops assembling these blocks of text as soon as you give any command that isn't a kill command. For example, if you type C-k, then delete a single character with C-d, then type another C-k, you've broken the chain. Emacs doesn't consider deletion of a single character with C-da "kill" command; it's just a deletion and it isn't stored. In this case, you haven't made a single chain of kill commands; you've made two chains. Later, we'll see how to get the older killed text back.

Table 2-3summarizes the commands for deleting, killing, and yanking text, including options from the Editmenu.

Table 2-3. Deletion commands

Keystrokes Command name Action
C-d delete-char Delete character under cursor.
Del delete-backward-char Delete previous character.
M-d kill-word Delete next word.
M-Del backward-kill-word Delete previous word.
C-k kill-line Delete from cursor to end of line.
M-k kill-sentence Delete next sentence.
C-x Del backward-kill-sentence Delete previous sentence.
C-y yank Restore what you've deleted.
C-w EditCut kill-region Delete a marked region (see next section).
( none ) kill-paragraph Delete next paragraph.
( none ) backward-kill-paragraph Delete previous paragraph.

2.3 Marking Text to Delete, Move, or Copy

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

Интервал:

Закладка:

Сделать

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

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


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

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

x