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

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

Интервал:

Закладка:

Сделать

9.7.2.2 Editing mode

You can also put a buffer directly into SQL mode with M-x sql-mode. This provides some assistance for motion and composition of SQL statements, but mostly it's there to let you build complex statements and then ship them to the interactive buffer for execution. Table 9-10shows how to send various segments of the buffer to the database.

Table 9-10. SQL mode send commands

Keystroke Command name Action
C-c C-c sql-send-paragraph Send the paragraph the cursor is on. A paragraph is defined by the particular database client. For the sql-mysqlprocess, for example, a paragraph begins with a statement like select or update and ends with a semicolon. Any number of lines can intervene.
C-c C-r sql-send-region Send the marked region.
C-c C-b sql-send-buffer Send the entire buffer.

The output of all of these send commands shows up in your interactive buffer. Nothing changes in the editing buffer so you should feel free to experiment. That's what these modes are here for!

9.8 The Lisp Modes

Emacs has three Lisp modes, listed here by their command names:

emacs-lisp-mode

Used for editing Emacs Lisp code, as covered in Chapter 11(filename .emacs or suffix .el ).

lisp-mode

Used for editing Lisp code intended for another Lisp system (suffix .l or .lisp ).

lisp-interaction-mode

Used for editing and running Emacs Lisp code.

All three modes have the same basic functionality; they differ only in the support they give to running Lisp code.

All three Lisp modes understand the basic syntax elements common to all language modes. In addition, they have various commands that apply to the more advanced syntactic concepts of S-expressions, lists, and defuns. An S-expression (or syntactic expression) is any syntactically correct Lisp expression, be it an atom (number, symbol, variable, etc.), or parenthesized list. Lists are special cases of S-expressions, and defuns (function definitions) are special cases of lists. Several commands deal with these syntactic concepts; you will most likely become comfortable with a subset of them.

Table 9-11shows the commands that handle S-expressions.

Table 9-11. S-expression commands

Keystrokes Command name Action
C-M-b backward-sexp Move backward by one S-expression.
C-M-f forward-sexp Move forward by one S-expression.
C-M-t transpose-sexps Transpose the two S-expressions around the cursor.
C-M-@ mark-sexp Set mark to the end of the current S-expression; set the cursor to the beginning.
C-M-k kill-sexp Delete the S-expression following the cursor.
( none ) backward-kill-sexp Delete the S-expression preceding the cursor.

Since an S-expression can be a wide variety of things, the actions of commands that handle S-expressions are determined by where your cursor is when you invoke them. If your cursor is on a (or on a space preceding one, the S-expression in question is taken to be the list that starts with that (. If your cursor is on some other character such as a letter or number (or preceding whitespace), the S-expression is taken to be an atom (symbol, variable, or constant).

For example, suppose your cursor is in this position:

(mary bob (dave (pete)) ed)

If you type C-M-f, the cursor moves like this:

(mary bob (dave (pete)) ed)

That is, the cursor moves forward past the S-expression (dave (pete)), which is a list. However, say your cursor is positioned like this:

(mary bob (dave (pete)) ed)

When you type C-M-f, it moves here:

(mary bob (dave (pete)) ed)

In this case, the S-expression is the atom bob.

The commands moving in lists are shown in Table 9-12.

Table 9-12. Commands for moving in lists

Keystrokes Command name Action
C-M-n forward-list Move forward by one list.
C-M-p backward-list Move backward by one list.
C-M-d down-list Move forward and down one parenthesis level.
( none ) up-list Move forward out of one parenthesis level.
C-M-u backward-up-list Move backward out of one parenthesis level.

As a mnemonic device, you can think of lists as analogous to lines and S-expressions as analogous to characters; thus, C-nand C-pappear in list motion commands, whereas C-fand C-bappear in S-expression motion commands. C-M-nand C-M-pwork similarly to C-M-fand C-M-b, respectively, except that you must position the cursor so that there is a list in front or back of it to move across—that is, there must be an opening or closing parenthesis on, after, or before the cursor. If there is no parenthesis, Emacs signals an error. For example, if your cursor is positioned like this:

(fred bob (dave (pe te) ) ed)

and you type C-M-n, Emacs complains with the message:

Containing expression ends prematurely

However, if your cursor is here:

(fred _ b o b (dave (pete)) ed)

the "next list" is actually (dave (pete)), and the cursor ends up like this if you type C-M-n:

(fred bob (dave (pete)) _ ed)

The commands for moving up or down lists enable you to get inside or outside them. For example, say your cursor is here:

(fred bob (dave (pete)) ed)

typing C-M-dmoves the cursor here:

( fred bob (dave (pete)) ed)

This is the result because fredis the next level down after its enclosing list. Typing C-M-dagain has this result:

(fred bob ( dave (pete)) ed)

You are now inside the list (dave (pete)). At this point, typing C-M-udoes the opposite of what C-M-ddoes: it moves the cursor back and outside of the two lists. But if you type M-x up-list Enter, you will move forward as well as out, resulting in this:

(fred bob (dave (pete)) _ ed)

The commands for defuns listed in Table 9-13are more straightforward.

Table 9-13. Commands for working with functions

Keystrokes Command name Action
C-M-a beginning-of-defun Move to the beginning of the current function.
C-M-e end-of-defun Move to the end of the current function.
C-M-h mark-defun Put the cursor at the beginning of the function, put the mark at the end.

These commands work properly only when the (defunthat starts the current function is at the beginning of a line.

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

Интервал:

Закладка:

Сделать

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

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


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

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

x