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

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

Интервал:

Закладка:

Сделать

If you're used to typing C-zto undo, you can easily change Emacs's behavior to match your habits. See "Making Emacs Work the Way You Want" at the end of this chapter for information on CUA mode.

What if you'd like to redo a command after you type undo? There is no formal redo command, but you can use undoin the following way. Just move the cursor in any direction, and type C-_or C-x uagain. Emacs redoes the last command you undid. You can repeat it to redo previous undos.

Although undois an important command, it can be slow if you want to undo a large number of changes. Table 2-11summarizes three methods for undoing changes and circumstances in which you might want to use them.

Table 2-11. Methods for undoing changes

If you: Use this command:
Don't like the recent changes you've made and want to undo them one by one C-_ or C-x u( undo)
Want to undo all changes made since you last saved the file M-x revert-buffer Enter
Want to go back to an earlier version of the file (the file as it was when you started this editing session) C-x C-f filename ~ Enter C-x C-w filename Enter

We've already talked about undoing changes with undo; next we describe how to revert a buffer from a file and how to go back to an earlier version.

2.6.3 Reverting a Buffer from a File

If the undocommand isn't useful, there's another way to restore a file to an earlier state. If you want to get the file back to the state that is stored on disk, type M-x revert-buffer Enter. Emacs asks the following question:

Revert buffer from file filename ? (yes or no)

The filename is the name of your original file. Type yesif you want to restore the file, or noif you've changed your mind. Emacs copies the file stored on disk into the buffer, conveniently forgetting everything that happened since the last time you saved the file. Although this command is called revert-buffer, note that it can revert only buffers associated with files.

2.6.4 Going Back to a Previous Version: Backup Files

The first time you save a file during an editing session, Emacs creates a backup file. If something disastrous happens, and the other techniques for undoing changes won't help you, you can always return to the backup file. The name of the backup file is the same as the name of the file you're editing, with a tilde ( ~) added. For example, if you are editing the file text , the backup file is text~ .

Emacs doesn't provide any special commands for restoring a buffer from the backup copy. The easiest way to do this is to edit the backup copy and then save it as the real file. For example, if you were working with a file called text , you could: exit Emacs by typing C-x C-c, then start Emacs again by typing emacs text~ . After the backup file is displayed, save it as the real file by typing C-x C-w text Enter. As a safeguard, Emacs asks you before it writes over the original file:

File text exists; overwrite? (y or n)

Type yto overwrite the original file with the backup file.

GNU Emacs also has a numbered backup facility. If you turn on numbered backups, Emacs creates a backup file (with the suffix ~n~ ) every time you save your file. n increments with each successive save. If you are nervous about deleting older versions, it might be worth using: you can keep all of your old versions forever, if you want to. However, numbered backups can also waste disk space; a happy medium may be to tell Emacs to keep the last n versions, where n is the number of versions you want to keep. The variables that control numbered backups are described in Appendix A. If you are interested in full-blown version control, check out VC mode, discussed in Chapter 12. Table 2-12summarizes the commands for stopping commands and undoing changes.

Table 2-12. Stopping and undoing commands

Keystrokes Command name Action
C-g keyboard-quit Abort current command.
C-x u advertised-undo [17] Undo last edit (can be done repeatedly).
C-_ EditUndo undo Undo last edit (can be done repeatedly).
( none ) revert-buffer Restore buffer to the state it was in when the file was last saved (or auto-saved).

2.6.5 Recovering Lost Changes

We've just discussed how to eliminate changes you don't want to keep; getting back changes you've lost is a different kind of problem. You might lose changes if the power goes out momentarily or if the computer you're working on suddenly freezes or is turned off accidentally. You might also lose changes if you exit Emacs abnormally. Luckily, Emacs, being the watchful editor that it is, saves your file for you every so often in auto-save files . If you watch carefully, you'll see the message Auto savingin the minibuffer from time to time. Using auto-save files, you can get back most, if not all, of your changes. The name of an auto-save file is the same as the name of the file you are editing, with a sharp ( #) added to the beginning and the end. For example, if you are editing the file text , its auto-save file is #text# .

To recover text from an auto-save file, type M-x recover-file Enter. Emacs opens a window that lists both the file and its associated auto-save file so that you can compare the time at which they were created, their size, and so forth. Emacs asks you the following question:

Recover auto-save file #text# ? (yes or no)

Type yesto confirm that you want to copy the contents of the auto-save file into the current file or noif you change your mind. (If you are unsure, you might want to use C-x C-fto read the auto-save file #text# into a buffer first and look it over carefully before using the recover-filecommand. If you really want to compare the differences between the two versions, see "Comparing Files Between Windows" in Chapter 4.)

When does Emacs create auto-save files? Emacs creates an auto-save file every few hundred keystrokes or if Emacs is terminated abnormally. [18]You can change the frequency with which Emacs creates auto-save files by changing the variable auto-save-interval. By default, Emacs creates an auto-save file every 300 keystrokes. For more information on changing variable values, see Chapter 10.

There's one more important fact to know about Emacs and auto-save files. If you delete a large portion of a file, Emacs stops auto-saving the file and displays a message telling you so. To make Emacs start auto-saving again, save the file with C-x C-sor type M-1 M-x auto-save Enter(that's the number 1).

Now you've learned enough commands for most of the editing you'll do with Emacs. At this point, you may want to learn how to make Emacs turn on certain features like auto-fill mode automatically, so you don't have to turn them on every time you enter Emacs. The next section provides a brief introduction to customization; this topic is covered in much greater detail in Chapter 10.

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

Интервал:

Закладка:

Сделать

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

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


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

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

x