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

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

Интервал:

Закладка:

Сделать

Several Emacs variables can have different values for each buffer ( local values, in Emacs parlance) as well as a default value. Such variables assume their default values in buffers where the local values are not specified. A common example is starting a new text document. The local value for the left-marginvariable has not been set, so Emacs uses the default value for left-margin. You can change the local value in this buffer if you like. But start a new document in a new buffer and you'll find that left-marginis back to the default value—because the second buffer's local value has not been set.

As you might expect, you can set both the default and local values of such variables. When you set the value of a variable such as left-marginor case-fold-searchwith setq, you are actually setting the local value. The way to set default values is to use setq-defaultinstead of setq, as in:

(setq-default left-margin 4)

Unfortunately, there is no general way to tell whether a variable has just one global value or has default and local values (except, of course, by looking at the Lisp code for the mode). Therefore the best strategy is to use a plain setq, unless you find from experience that a particular variable doesn't seem to take on the value you setqit to—in which case you should use setq-default. For example, if you put the line:

(setq case-fold-search nil)

in your .emacs file, you will find that Emacs still ignores case differences in search commands as if this variable were still t; instead, you should use setq-default.

10.6 Finding Emacs Lisp Packages

Emacs contains lots of Lisp code; in fact, as we will see in Chapter 11, the majority of Emacs' built-in functionality is written in Lisp. Emacs also comes with several extra Lisp packages (also known as libraries ) that you can bring in (or load ) to add more features. Lisp packages are being added to Emacs all the time, and sometimes your system administrator will add packages obtained from sources other than the Free Software Foundation.

Appendix B lists the most useful built-in Lisp packages, along with explanations of how to use them. You can also get information about which packages are available on your system by typing C-h p(for finder-by-keyword). Briefly, the built-in packages do the following kinds of things:

• Support programming in C, Lisp, Perl, Java, and several other languages (see Chapter 9).

• Support text processing with TEX, LATEX, XML, and HTML (see Chapter 8).

• Emulate other editors ( vi, EDT, and Gosling Emacs).

• Interface to operating system utilities, such as the shell (see Chapter 5 Chapter 5. Emacs as a Work Environment Many of the everyday things you do from a command prompt can be done from within Emacs. You can execute commands, work with directories, and print files—all without leaving Emacs. Changing tasks is as simple as jumping between buffers. What's important about this? Of course, it's nice to be able to move between tasks easily. What's even more important is that you have the same editing environment no matter what you're doing: you can use all of the Emacs editing commands to work on a file, give shell commands, then start up Dired, the directory editor, to do some file maintenance. It is simple to move text from one window to another. You can execute a command and then use Emacs commands to cut and paste the results into a file. If you're trying to compile a program and keep getting error messages, you can save the interactive session as a file and confer with someone about the problem. Despite the many advantages of modern window systems, Emacs often provides the best way to integrate the many kinds of work you do daily. Much of the information in this chapter involves integration between Emacs and the operating system. Emacs is most commonly a Unix editor, so forgive us for a bias in that direction. But we are happy to report that for users of GNU Emacs on other platforms, integration with the operating system is still available; you can use shell mode to run commands and can edit directories with Dired. There's no reason to leave Emacs no matter what your platform is. ).

• Provide editing support functions, such as spell checking (see Chapter 3 Chapter 3. Search and Replace The commands we discussed in the first two chapters are enough to get you started, but they're certainly not enough to do any serious editing. If you're using Emacs for anything longer than a few paragraphs, you'll want the support this chapter describes. In this chapter, we cover the various ways that Emacs lets you search for and replace text. Emacs provides the traditional search and replace facilities you would expect in any editor; it also provides several important variants, including incremental searches, regular expression searches, and query-replace. We also cover spell-checking here, because it is a type of replacement (errors are sought and replaced with corrections). Finally, we cover word abbreviation mode; this feature is a type of automatic replacement that can be a real timesaver. ) and outline editing (see Chapter 7) as well as text sorting, command history editing, Emacs variable setting (see Appendix A), and much more.

• Play various games and provide other forms of amusement.

See Appendix Bfor more details.

10.7 Starting Modes via Auto-Mode Customization

The tables in Appendix Blist several major modes that are automatically invoked when you visit a file whose name ends in the appropriate suffix. Look for "suffix" in the right-hand columns of the tables to see many of the associations between filename suffixes and major modes that Emacs sets up by default. These associations are contained in the special Emacs variable auto-mode-alist. auto-mode-alistis a list of pairs ( regexp . mode ), where regexp is a regular expression (see Chapter 3 Chapter 3. Search and Replace The commands we discussed in the first two chapters are enough to get you started, but they're certainly not enough to do any serious editing. If you're using Emacs for anything longer than a few paragraphs, you'll want the support this chapter describes. In this chapter, we cover the various ways that Emacs lets you search for and replace text. Emacs provides the traditional search and replace facilities you would expect in any editor; it also provides several important variants, including incremental searches, regular expression searches, and query-replace. We also cover spell-checking here, because it is a type of replacement (errors are sought and replaced with corrections). Finally, we cover word abbreviation mode; this feature is a type of automatic replacement that can be a real timesaver. and Chapter 11) and mode is the name of a function that invokes a major mode. When Emacs visits a file, it searches this list (from the beginning) for a regular expression that matches the file's suffix. If it finds one, it runs the associated mode function. Notice that any part of a file's name—not just its suffix—can actually be associated with a major mode.

You can add your own associations to auto-mode-alist, although the syntax is weird if you are not used to Lisp (see Chapter 11for the gory details). If you are programming in the Ada language, and your Ada compiler expects files with suffix .ada , you can get Emacs to put your files in Ada mode whenever you visit them by putting the following line in your .emacs file:

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

Интервал:

Закладка:

Сделать

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

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


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

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

x