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

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

Интервал:

Закладка:

Сделать
Warning

Be careful! The README.W32 file notes that you may run into some small problems if you unpack your Emacs distribution into a path where one or more of the directory names contains spaces. For example, don't unpack Emacs in the Program Files directory. If you don't like adding things directly to your C: drive, create an Applications folder or something similar and unpack Emacs in that folder.

After that's unpacked, you're 99 percent of the way there. The latest versions of Emacs need nothing else, actually; you just double-click on runemacs.exe (in the bin directory of your Emacs folder) and off you go! If you like, you can create shortcuts in your Start menu or on the desktop. Just point them at runemacs.exe and you should be set.

13.3.2 Where to Put Your .emacs File

Probably the single biggest Windows consideration is the location of the .emacs file. This file goes in your "home" directory. We use quotes there because the Windows world doesn't have a strictly defined home directory the way some other operating systems like Unix and Mac OS X do. By default, Emacs assumes that the C:\ folder is your home directory. You can put your .emacs file there, but you can also modify your home directory using the Windows environment variable called HOME. To change this environment variable on Windows XP, select System from the Control Panel. A System Properties window displays. Choose the Advanced tab, then choose Environment Variables. HOME is probably not listed; click on New, then type HOME and the path to your desired home directory. Emacs will now look for the .emacs file in this directory.

Because of naming compatibility issues, older Windows versions of Emacs used the _emacs file rather than the .emacs file for customization and configuration. This file is still a valid option. However, if both _emacs and .emacs are found in the home directory, only .emacs is used.

13.3.3 Starting Emacs from the Command Line

The Emacs bin folder includes two related files, each sporting a Gnu icon: emacs.exe and runemacs.exe . Typically you'll use runemacs.exe ; this runs Emacs graphically without opening a console window. The other file, emacs.exe , can be used to run Emacs from the command line as described next.

To run Emacs from the command line, cdto the directory where you installed Emacs and type emacs -nw(or whatever command-line argument you wanted to use; -nwruns Emacs in the console window). You can also do this by choosing Start → Run, then selecting Browse to locate emacs.exe . Add any command-line arguments you wish, and then click OKto invoke Emacs using these arguments.

13.3.4 Making Emacs Act like Windows: CUA Mode

CUA stands for common user access, a standard originally developed by IBM. CUA mandates that certain keys should always perform certain functions. In Windows, for example, C-ccopies and C-vpastes from one application to another. As you know, Emacs uses these key bindings for its own purposes.

That's where Kim Storm's CUA mode comes in. This mode was so popular that it is now part of Emacs. [95]It allows standard Windows key bindings, like C-xfor cut and C-vfor paste, to work properly within Emacs. It's quite clever—these keys cut and paste only when an active selection exists. That leaves the normal functionality of multistroke commands like C-c C-fin fine shape.

To turn on CUA mode, select C-x/C-c/C-v cut-and-paste (CUA) from the Options menu. If you decide you want to use CUA mode for multiple sessions, select Save Options to have Custom (discussed in Chapter 10) automatically add it to your .emacs file.

As you can see from the option name, in this mode, C-xis used for cutting text, C-cis used for copying text, and C-vis used for pasting text. What is not so apparent is that C-zruns undo rather than minimizing the window (in CUA mode, you can minimize using C-x C-z).

What if you're used to confirming a region before you cut it using C-x C-x? You can type C-c C-x C-xin this case. This works in part because C-ccancels the active region. Remember that C-xwould normally cut.

Strictly speaking, C-x C-xdoesn't immediately cut text, if you type it fast enough. Cut is really bound to C-x . In other words, Emacs is watching to see if you type something else really quickly. If you have a region highlighted and type C-x C-sto save the buffer, Emacs does the right thing. But if you pause after C-x, you'll cut text. This is true of C-cas well. If you immediately type another sequence after C-c, Emacs uses C-cas a prefix. If you pause, it copies the highlighted text.

CUA mode has a few other interesting behaviors. It has highly advanced rectangle support. (Rectangle editing is described in Chapter 7.) It also has the common behavior of replacing highlighted text. If you select a region and start typing, the highlighted text is replaced. Taking this one step further, you can do a quick and dirty search and replace in this way. Let's say that the text you typed over is just the first of several identical instances where you want to replace text. Typing M-v(for cua-repeat-replace-region) replaces the next instance. Repeat this command to continue making replacements. If there is no string to replace, M-vdoes nothing.

For example, let's take our classic Dickens passage and replace the word times with rhymes :

Highlight the word times .

The word times is highlighted Type rhymes Emacs replaces times with - фото 197

The word times is highlighted.

Type: rhymes

Emacs replaces times with rhymes Type Mv Emacs replaces the next - фото 198

Emacs replaces times with rhymes .

Type: M-v

Emacs replaces the next instance of times with rhymes You may love CUA mode - фото 199

Emacs replaces the next instance of times with rhymes .

You may love CUA mode or you may hate it; the only way to see if your fingers are ready for this option is to try it out. If you've used Emacs for years, you may find CUA mode keeps doing unexpected things. Your finger habits are set to Emacs's ways. On the other hand, it's hard to move back and forth between applications and change your finger habits all the time. If you have not yet gotten used to the Emacs key bindings, you may well love CUA mode, as many people do.

Table 13-1lists CUA mode commands.

Table 13-1. CUA mode commands

Keystrokes Command name Action
C-c C-x C-x cua-exchange-point-and-mark Exchange location of cursor and mark.
C-c copy-region-as-kill Copy the region.
C-x or C-w or S-Delete kill-region Delete the region.
C-v or C-y or S-Insert cua-paste Paste most recently killed or copied text.
M-v cua-repeat-replace-region After highlighting and replacing a string, find the next string and replace it the same way.
PgUp cua-scroll-up Scroll up one page (or to the beginning of the buffer).
PgDown cua-scroll-down Scroll down one page (or to the end of the buffer).
M-y cua-paste-pop After C-v, pastes earlier deletion.
C-z or C-x u cua-undo Undoes the last change.
C-x C-z iconify-frame Minimize the current frame (what C-zdoes outside CUA mode).

13.3.5 Installing Ispell

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

Интервал:

Закладка:

Сделать

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

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


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

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

x