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

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

Интервал:

Закладка:

Сделать

A special command lets you execute a macro on each line in a region. How frequently do you encounter an email with text that you want to yank, but that is quoted several indentation levels? Of course, we can think of several ways to delete the indentation quickly, but a line-oriented macro is a quick approach too. You define the macro and execute it on a region by typing C-x C-k r(for apply-macro-to-region-lines). Remember that earlier we said that macros should set themselves up to repeat? This command is different because it expects to work on one line at a time. You don't want to set it up to repeat by moving to the next line; it does that automatically.

Table 6-5shows a quick line-oriented macro that deletes indentation marks from text quoted in an email or newsgroup message.

Table 6-5. Macro for deleting indentation marks

Keystrokes Action
F3 Start the macro definition.
C-a Move to the beginning of the line.
M-f Move forward one word.
M-b Move to the beginning of this word.
C-Space Set the mark.
C-a Move to the beginning of the line.
C-w Delete the extraneous indentation characters.
F4 End the macro definition.

Initial state:

Text indented at various levels Mac OS X Mark the text as a region move to - фото 108

Text indented at various levels (Mac OS X).

Mark the text as a region, move to the beginning of the region, then type: C-x C-k r

Indentation is deleted Mac OS X 610 Beyond Macros Macros are an important - фото 109

Indentation is deleted (Mac OS X).

6.10 Beyond Macros

Macros are an important tool for streamlining repetitive editing. They let you write your own commands for performing complex tasks without needing to know anything more than you already know: the basic Emacs commands for moving around and manipulating text. Even if you're an Emacs novice, you should be able to use macros with little difficulty.

However, Emacs is almost infinitely flexible, and macros cannot do everything. In many situations, there's no substitute for writing a Lisp function that does exactly what you want. If you know Lisp or would like to learn some, you can write your own Lisp functions to do more complex tasks than keyboard macros can handle. Chapter 11covers the basics of writing Lisp functions.

Table 6-6summarizes macro commands.

Table 6-6. Macro commands

Keystrokes Command name Action
C-x ( kmacro-start-macro Start macro definition.
F3 kmacro-start-macro-or-insert-counter Start macro definition. If pressed while defining a macro, insert a counter.
C-x ) kmacro-end-macro End macro definition.
F4 kmacro-end-or-call-macro End macro definition (if definition is in progress) or invoke last keyboard macro.
C-x e kmacro-end-and-call-macro Execute last keyboard macro defined. Can type eto repeat macro.
C-x C-k n name-last-kbd-macro Name the last macro you created (before saving it).
( none ) insert-kbd-macro Insert the macro you named into a file.
( none ) macroname Execute a named keyboard macro.
C-x q kbd-macro-query Insert a query in a macro definition.
C-u C-x q (none) Insert a recursive edit in a macro definition.
C-M-c exit-recursive-edit Exit a recursive edit.
C-x C-k b kmacro-bind-to-key Bind a macro to a key ( C-x C-k 0- 9and A- Zare reserved for macro bindings). Lasts for current session only.
C-x C-k Space kmacro-step-edit-macro Edit a macro while stepping through it (in our opinion, the interface is overly complex).
C-x C-k l kmacro-edit-lossage Turn the last 100 keystrokes into a keyboard macro. If any mouse clicks are among the last 100 keystrokes, does not work.
C-x C-k e edit-kbd-macro Edit a keyboard macro by typing C-x e for the last keyboard macro defined, M-x for a named macro, C-h l for lossage, or keystrokes for a macro bound to a key.
C-x C-k Enter kmacro-edit-macro Edit the last keyboard macro.
C-x C-k C-e kmacro-edit-macro-repeat Edit the last keyboard macro again.
C-x C-k C-t kmacro-swap-ring Transpose last keyboard macro with previous keyboard macro.
C-x C-k C-d kmacro-delete-ring-head Delete last keyboard macro from the macro ring.
C-x C-k C-p kmacro-cycle-ring-previous Move to the previous macro in the macro ring.
C-x C-k C-n kmacro-cycle-ring-next Move to the next macro in the macro ring.
C-x C-k r apply-macro-to-region-lines Apply this macro to each line in a region.

Chapter 7. Simple Text Formatting and Specialized Editing

Emacs is fundamentally a text editor, rather than a word processor: it is a tool that creates files containing exactly what you see on the screen rather than a tool that makes text files look beautiful when printed. However, Emacs does give you the capability to do the following:

• Indent text using tabs and other indentation tricks.

• Center words, lines, and paragraphs of text.

• Hide and show portions of a document using outline mode, which gives you a feel for a document's overall structure. Outline mode can make it easier to go from rough outline, to detailed outline, to rough draft, to the final product.

• Edit by column rather than by line (especially helpful when you create or change tables or work with column-oriented datasets), referred to in Emacs as rectangle editing .

• Create simple pictures using keyboard characters or the mouse.

Much of this chapter, though, focuses on some fairly simple stuff: tabs and indenting text. We describe Emacs's behavior in primarily two major modes: fundamental mode and text mode. If you are a developer, you'll probably want to write code in a mode appropriate to the language you're using; see Chapter 9for details. If you use a markup language like HTML, see Chapter 8for additional relevant information.

7.1 Using Tabs

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

Интервал:

Закладка:

Сделать

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

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


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

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

x