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

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

Интервал:

Закладка:

Сделать

Dired is one of the most interesting features of Emacs. With Dired, you can look at a listing of all the files in a directory, delete them, rename them, copy them, and perform almost all basic file operations. More important, Dired can make you more productive. For example, you can work with groups of files, deleting, moving, compressing, or even query-replacing strings in them.

There are several ways to start directory editing. If you're not in Emacs, invoke Emacs with a directory name as an argument, for example:

% emacs literature

Emacs starts up editing the directory literature : you'll see a single window that contains a listing of the literature directory. You can also start the directory editor by using C-x C-f(or any other command for visiting a file) and naming a directory, rather than a file. For example, typing C-x C-f literaturegets you ready to edit the literature directory. Typing C-x d(for dired) or selecting the folder icon on the toolbar also starts Dired; you then specify a directory name. Finally, dragging a folder onto the Emacs window also starts Dired. [26]

No matter how you start the editor, the result is the same.

Type: C-x C-f literature Enter

A basic directory editor display As you can see Direds display is similar to - фото 80

A basic directory editor display.

As you can see, Dired's display is similar to what you see if you type ls -lat a Unix shell prompt. The permissions associated with the file, the owner, the group name, the size of the file, and the date last modified all precede the filename. All files and directories are listed, including those whose names start with a dot. The cursor starts out on a filename, rather than in the first column.

Also, if your display supports colors (unfortunately this book doesn't), you'll see that directories are blue, backup and auto-save files are tan, and symbolic links are purple. Colors are a function of font-lock mode. If you don't see colors in your directory listing, type M-x font-lock-mode Enteror add the following line to your .emacs file:

(global-font-lock-mode t)

By default, the list is sorted by filename, but you can sort it by date instead. Look at the mode line. It says ( Dired by name ). To change the order of the display, type s(for dired-sort-toggle-or-edit). This command puts the newest files at the top of the list, solving the "Where's that file I worked on yesterday?" problem quite easily. The mode line says ( Dired by date ). Typing sagain toggles the sort, putting it back in alphabetical order.

If you remember the commands used to edit the buffer list (from Chapter 4), you will find that they are almost identical to the directory editor commands. You can do many additional things, but the basic commands are the same.

Warning

Remember, in the directory editor you are working directly with files, not with buffers. When you delete a file using Dired, it's gone permanently.

There are several ways to move around in Dired. The commands Space, C-n, and nall move you to the next file in the list. Del, C-p, and pall move you to the previous file. Arrow keys and PgUpand PgDownwork as well. You can also use any of the search commands (incremental search, word search, and so on) to find a particular file.

5.2.1 Viewing and Editing Files

When you look at a directory listing, you may want to get a quick look at the files. Dired's vcommand does just this: put the cursor on the file you want to view and press v(for dired-view-file). Emacs displays the file in view mode. [27]This is a read-only mode, so you can't modify the file. Press C-cor qto return to the directory listing. While you're viewing the file, you can use sto start an incremental search, or press Enterto scroll the display down one line. Typing = tells you what line the cursor is on. There are a number of shortcuts for other Emacs commands (like marking text), but frankly, the regular commands work correctly. There's no reason to remember a special set of commands when the ones you already know work.

If you want to edit a file from the Dired buffer, move to the line the file is on and press Enter(a variety of other keystrokes work as well, such as ffor find or efor edit). Emacs finds the file and you can edit it. This is a completely normal editing buffer: you can make any changes you want, save them, visit other files, and so on. Typing C-x bfollowed by the name of the directory you were working in moves you back to the Dired buffer. Or you can use the buffer menu ( C-x C-b) to find and display the Dired buffer.

Viewing and editing files is nice, but you already know how to do that—right? You're waiting for the interesting stuff: how to delete files.

5.2.2 Deleting, Copying, and Renaming Files

As we've said, file deletion is almost identical to buffer deletion with the buffer list. If you learned how to delete buffers, you know the basics of deleting files with Dired. First, you flag a file for deletion by moving to the file's name and typing d. Doing this places a Don the left margin and moves the cursor to the next file in the list. You can flag as many files as you want. You can change your mind at this point and type uto undelete the file. At some later time, you type xto delete the files (more on this in a minute). The following screen shows what the Dired buffer looks like when you flag a few files for deletion.

Type: d d d

Three files flagged for deletion Windows As we mentioned you can type uat - фото 81

Three files flagged for deletion (Windows).

As we mentioned, you can type uat any time to remove the deletion flags from the files. Typing umoves you to the next file in the list, and, if it is marked, unmarks it. You can also use Delto unmark. This command undeletes the previous file in the list and then moves up one line.

Because Emacs generates backup files and, at times, auto-save files, you may want to delete them from time to time. Emacs offers shortcut commands to flag such files. Typing # flags all the auto-save files (files whose names start and end with # ) for deletion. Emacs flags them with D. Typing ~flags all the backup files (whose names end with ~) for deletion. You can remove the flags from backup files you want to keep, for example, the backup copies of files you've recently worked on.

When you really want files to be deleted from disk, press x. Emacs displays the names of all the files flagged for deletion and asks you if you want to delete them.

Type: x

Emacs asks you to confirm the deletion by typing yesWindows Type yesto - фото 82

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

Интервал:

Закладка:

Сделать

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

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


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

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

x