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

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

Интервал:

Закладка:

Сделать

The variable case-fold-searchdetermines whether searches are case-sensitive. It applies to all searches: incremental searches, word searches, searches within search-and-replace operations, and so on. By default, case-fold-searchis set to t, which means "ignore case unless the user types in mixed or uppercase." This sensible default is usually just what you want. But if you need case-sensitive searches, the Case-Insensitive Search option on the Options menu provides an easy way to experiment with this variable.

Likewise, if you don't want Emacs to adjust the case of your replacement strings, you can set the variable case-replace. Again, its value is t(for "true") by default, which means "adjust the case of a replacement string to match the original text"—that is, capitalize the replacement if the original word was capitalized and so on. Setting this variable to nilmeans "never adjust the case of the replacement string; always put it in exactly as I typed it." To change the value of case-replace, type M-x set-variable Enter case-replace Enter nil Enter(there's no menu option for this variable).

Both the menu option and the set-variablecommand change the behavior of Emacs only temporarily. If you start a new editing session, you'll be back to the default behavior. This is probably what you want, because searching separately for capitalized and lowercase words is inconvenient.

You can set the value for the Case-Insensitive Search option permanently by selecting Save Options from the Options menu or by adding this line to your .emacs file:

(setq-default case-fold-search nil) ; require exact matches

To set case-replacepermanently, add the following line to your .emacs file. You'll need to restart Emacs to have the change take effect.

(setq-default case-replace nil) ; never change case when replacing

You could change these variables through Emacs's interactive customization facility, Custom, instead (see Chapter 10).

3.2.6 Regular Expressions for Search and Replacement Operations

Sometimes none of the simpler searches described in this chapter are adequate. Regular expressions allow you to build searches with strings that contain various wildcards.

Table 3-4shows some of the characters you can use in creating a regular expression.

Table 3-4. Characters for creating regular expressions

Character(s) Match
^ Matches the beginning of a line.
$ Matches the end of a line.
. Matches any single character (like ? in filenames).
.* Matches any group of zero or more characters (. matches any character and * matches zero or more of the previous character).
\< Matches the beginning of a word.
\> Matches the end of a word.
[ ] Matches any character specified within the brackets; for example, [a-z] matches any alphabetic character.
\s, \S Matches any whitespace character: space, a newline, a tab, a carriage return, a formfeed, or a backspace; \S matches any character except whitespace.
\d, \D Matches any single digit, 0-9; \D matches any character but a digit.
\w, \W Matches any "word" character (upper- and lowercase letters, digits, and the underscore character); \W matches any character but these.

If you do a regular expression search for ^word$, you would find instances of word on a line by itself. The ^says that the wmust be the first character on the line, the $says that the dmust be the last character.

If you wanted to find all words starting with beg and ending with the letter s , you could use beg[a-z]*sas your regular expression. This would find the words begins , begets , and begonias , in addition to really odd words like shibegrees and altbegaslia . If you don't want these mutants—that is, if you really want words that begin with beg and end with s , use \. The \<is a special sequence that matches the beginning of a word; \>matches the end of a word. If you wanted to find the words beg , big , and bag ; but not begonias , and certainly not any strange words with beg on the inside, you would use \as the regular expression.

To search for a ^, $, ., *, [, ], or any number of other special characters, you obviously can't use the character itself. Put a backslash ( \) first—i.e., to search for a period, search for \. For example, to search for the electronic mail address`:

howie@mcds.com

the regular expression would be:

howie@mcds\.com

This is a barebones introduction to regular expressions; see Chapter 11for more details and Mastering Regular Expressions by Jeffrey Friedl (O'Reilly) for a book-length treatment of this topic.

You can use regular expressions in incremental searches and in query-replace. Table 3-5lists the commands you use for regular expression searches. Although they are initiated with slightly different commands, the searches are the same as those described earlier in this chapter.

Table 3-5. Regular expression search commands

Keystrokes Command name Action
C-M-s Enter EditSearchRegexp Forward re-search-forward Search for a regular expression forward.
C-M-r Enter EditSearchRegexp Backwards re-search-backward Search for a regular expression backward.
C-M-s EditSearchIncremental SearchForward Regexp isearch-forward-regexp Search incrementally forward for a regular expression.
C-M-r EditSearchIncremental SearchBackward Regexp isearch-backward-regexp Search incrementally backward for a regular expression.
C-M-% EditReplaceReplace Regexp query-replace-regexp Query-replace a regular expression.
( none ) replace-regexp Globally replace a regular expression unconditionally (use with caution).

3.3 Checking Spelling Using Ispell

Emacs includes two spell-checking interfaces: to the Unix spell checker, spell, and to Ispell, which many people, including us, prefer. We say "interfaces" because Emacs does not include the executables for either of these spell-checkers. Because Ispell is superior and runs on a variety of platforms, we'll cover only Ispell here. If you attempt to run Ispell and it is not available, you'll have to install it. Chapter 13provides details on installing Ispell on Windows and on Mac OS X.

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

Интервал:

Закладка:

Сделать

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

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


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

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

x