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 asks you to confirm the deletion by typing yes(Windows).

Type yesto delete them all or type noto return to the Dired buffer without deleting any of them.

This is the usual way of deleting files, but if you want a file deleted right away, type an uppercase D. Emacs asks if you want to delete the file (yes or no). Type yesto delete the file immediately or noto change your mind. In Dired, this is one of a number of cases in which the lowercase letter (like dto flag for deletion) and the uppercase letter (like Dto delete immediately) have a different meaning.

To copy a file in Dired, type Cnext to it (it must be a capital C). Emacs asks for the name of the file you want to copy to. Type the name and press Enter. Emacs says, Copied: 1 file. To copy several files in the list, preface the C with a number. For example, typing 3Cwould copy this file and the next two files. (See "Working with Groups of Files" later in this chapter for fancier ways to select a group of files to operate on.)

To rename a file with Dired (similar to the Unix mvcommand), type Rnext to the filename. Emacs asks what the new name should be. Type it and press Enter. Emacs says, Moved: 1 file.

If you move files between platforms, you can wind up with some filenames in uppercase and some in lowercase. Files moving from older versions of Windows may be in all caps, for example. Simply mark the files in question by typing m, then press %lfor lowercase or %ufor uppercase. Voilà—painless case consistency.

5.2.3 Compressing and Uncompressing Files

Compressing files saves disk space, and Dired provides an easy way to do it. Put the cursor on the line of the file you want to compress and press Z(for dired-do-compress). Emacs asks the following:

Compress or uncompress filename ? (y or n)

Emacs compresses the file if it's not compressed and uncompresses it if it is. [28]Press yto compress or uncompress the current file. Compression happens immediately, so you can watch both the extension and file size change as Emacs compresses the file.

What about editing compressed files? Although it's not on by default, Emacs has an automatic compression/decompression mode called auto-compress mode. To enter it for this session, type M-x auto-compress-mode Enter, which turns automatic compression on. To enable auto-compression automatically, add this line to your .emacs file:

(auto-compression-mode 1)

5.2.4 Comparing Files

In Chapter 4, we discussed comparing files in two windows. Emacs provides a way to do this using the diffcommand in Dired. Set the mark on the file you want diffto compare, put the cursor on the other file, then type =. Emacs compares the two files and opens a window with a *diff*buffer containing the output from the command.

Emacs has a separate option for comparing a file to its backup file. Put the cursor on the file you want to compare with its backup and type M-=. Emacs displays a *diff*buffer showing the differences between the two files.

If you are serious about version control, you may want to check out Chapter 12, which discusses version control as well as the GNU tool ediff.

5.2.5 Running Shell Commands on Files

While Dired's implementation of diffis useful (and there are implementations of chmod, grep, and findas well), in a more general sense, you can perform any command on a file by pressing an exclamation point ( !). For example, let's alphabetize the phone list file using the sortcommand.

Move to the phone file and press !

Emacs asks what command you want to run Mac OS X Type sort Emacs - фото 83

Emacs asks what command you want to run (Mac OS X).

Type: sort

Emacs displays the output from the command in a separate window Mac OS X - фото 84

Emacs displays the output from the command in a separate window (Mac OS X).

Usually, asterisks (*) and question marks are used as wildcards in commands. In Dired, they have a special meaning. An asterisk means "use the file I'm on or the files I've marked"; that way you don't have to type filenames explicitly. When multiple files are marked, a question mark means to run this command separately on each file.

In a slightly more complex example, you might have a command with more than one file as an argument. For example, you might want to make a new file out of the sorted phone list.

Move the cursor to the phone file, then type: !

Emacs asks what command you want to run Mac OS X Now tell Emacs you want to - фото 85

Emacs asks what command you want to run (Mac OS X).

Now tell Emacs you want to sort your phone file and put the output in a new file called phonesorted . The cursor is on the phone file, so you don't need to type its name in the command. Substitute an asterisk (*) for the name of the file:

Type: sort * > phonesorted

The operating system sorts the phone file and puts the output into the new file - фото 86

The operating system sorts the phone file and puts the output into the new file phonesorted (Mac OS X).

We created the file, but it doesn't appear on the display, which is not automatically updated in this case. To see the phonesorted file, type g.

Type: g

Emacs updates the Dired display showing the file phonesorted Mac OS X Dired - фото 87

Emacs updates the Dired display, showing the file phonesorted (Mac OS X).

Dired is frankly inconsistent about whether you type gbefore the display is updated. Some commands, as we'll see shortly, update the display immediately. Others, such as running shell commands on files, do not (Emacs really doesn't know what shell commands it's running or their effect on the display). A good rule of thumb is to type gif you don't see what you expect to see.

5.2.6 Working with Groups of Files

So far we've talked about working with one file at a time; any commands you give apply to the file the cursor is on. Working with multiple files is a better illustration of the real power of Dired. You can organize your directories in a flash once you learn a few shortcuts. First let's talk about some ways to select files, and then we'll talk about what we can do with the selected files.

5.2.6.1 Selecting files

So far we've primarily talked about flagging files for deletion. When you want to do something else with a group of files, you first mark them with an asterisk. Pressing mmarks the file the cursor is on; an asterisk appears where you normally see a D. Typing 3mmarks this file and the next two files. Once you mark files with an asterisk, Emacs assumes that any command you issue is meant for these files. So if you have three files marked with an asterisk and press Zto compress, Emacs assumes you want to compress those three files. After the compression, the files remain marked with asterisks. So how do you get rid of the asterisks when you're done with these files?

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

Интервал:

Закладка:

Сделать

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

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


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

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

x