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

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

Интервал:

Закладка:

Сделать

Shell mode also provides a few convenient shortcuts. The command M-pretrieves the last shell command you typed, no matter how far back in the buffer it is. Typing successive M-p's brings back earlier commands.

Type: M-p

Mpretrieves the last command even if it isnt on the screen Mac OS X In - фото 78

M-pretrieves the last command, even if it isn't on the screen (Mac OS X).

In this example, the previous command was more dickensxmas.tex. It's no longer on the screen; its output has pushed it off the top. M-p(for comint-previous-input) retrieves the command, but doesn't execute it; you can edit the command before pressing Enter. To find subsequent commands, type M-n.

If these commands sound familiar to you, they should. They are history commands, which are identical to the minibuffer history commands we discussed in 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. . The In/Outmenu is devoted to working with command history.

Enterand Tabhave special functions in shell mode. Pressing Enterexecutes the command on the line where the cursor is, even if you move the cursor up to the line of an earlier command you want to execute again. When you press Enter, Emacs copies the command to the end of the buffer and executes it. Of course, you can modify the command before pressing Enter.

Pressing Tabputs the Emacs completion feature into action; use completion for operating system commands, filenames, and variables. Note that the completion of system commands works best on Unix implementations like Linux and Mac OS X; Emacs doesn't seem to find all the possible Windows commands, for example.

If you type a command that produces a lot of output, cluttering up your session, there's an easy way to get rid of it. Type C-c C-o(for comint-kill-output).

Type: C-c C-o

Cc Coautomatically deletes the output from the last command Mac OS X The - фото 79

C-c C-oautomatically deletes the output from the last command (Mac OS X).

The previous command ( ls-la) remains on the screen, but its output, a long list of files, is deleted. C-c C-ocan delete output from only the most recent command; it can't delete output from your previous commands.

Another useful command for shell mode is C-c C-r(for comint-show-output). This command is useful if a command produces a lot of output and causes the first few lines of output to scroll off the screen. C-c C-rrepositions the window so the first line of output from your last command is at the top of the window. If you want to see the end of the output instead, type C-c C-e(for comint-show-maximum-output); this command moves the last line of the input to the bottom of the window.

When you're writing a book, moving by paragraphs makes sense, but when you're using a shell, moving by output group is more helpful. An output group consists of a command and its output. To move to the previous output group, type C-c C-p. To move to the next output group, type C-c C-n.

An advantage of shell mode is that you can start a command and then edit another buffer while the command runs. The shell buffer doesn't need to be onscreen; just type M-x shellto get the buffer back again.

You can have multiple shell buffers running at once; just use the command M-x rename-uniquelyto rename your shell buffer. You can start another shell buffer, and another, and another—as many as you need to juggle all your tasks.

5.1.2.1 Which shell?

Normally, Emacs uses your default shell in shell mode. Under Windows that's cmd.exe (the familiar C:\>prompt or a close relative). [25]But Unix has a wide variety of available shells, including the GNU Project's bashand the zed shell, zsh. Whatever shell you normally use, that's what Emacs starts when you enter shell mode.

How does Emacs know which shell to start? First, it looks at the variable shell-file-name. Then it looks for a Unix environment variable named ESHELL. Finally it looks for an environment variable named SHELL. If you want to run another particular shell (for example, the zed shell) when you're in Emacs, you can add the following command to your .emacs file:

(setq shell-file-name "/bin/zsh")

When Emacs starts an interactive shell, it runs an additional initialization file after your shell's normal startup files. The name of this file is .emacs_shell-name , where shell-name is the name of the shell you want to use in Emacs. It must be located in your home directory. For example, if you use the C shell, you can add Emacs-only startup commands by placing them in the file .emacs_csh . Let's say that when you're in Emacs, you want to change the prompt to emacs:%and you want an environment variable called WITHIN_EDITORto be set to T. Here's the contents of your .emacs_csh file:

set prompt="emacs:% "

setenv WITHIN_EDITOR T

Within a shell buffer, Emacs also sets the environment variable EMACSto t, and sets your terminal type (the TERMvariable) to emacs.

5.1.2.2 Making passwords invisible in shell mode

By default, shell mode displays everything you type and that includes passwords—not a good situation if someone is peering over your shoulder. There is a way around this problem, however. Before you type the password, type M-x send-invisible. Emacs asks for the nonechoed text. When you type a character, Emacs puts an asterisk in the minibuffer. Press Enterand Emacs enters the password without displaying it. To have Emacs hide passwords as you type them, add the following two lines to your .emacs file:

(add-hook 'comint-output-filter-functions

'comint-watch-for-password-prompt)

Emacs asks for nonechoed text in the minibuffer whenever a password prompt appears on the screen, making sure that the password is never displayed. Table 5-1summarizes shell mode commands.

Table 5-1. Shell mode commands

Keystrokes Command name Action
( none ) shell Enter shell mode.
C-c C-c SignalsBREAK comint-interrupt-subjob Interrupt current job; equivalent to C-c.
C-d comint-delchar-or-maybe-eof Send EOF character if at end of buffer; delete a character elsewhere.
C-c C-d SignalsEOF comint-send-eof Send EOF character.
C-c C-u comint-kill-input Erase current line; equivalent to C-uin Unix shells.
C-c C-z SignalsSTOP comint-stop-subjob Suspend or stop a job; C-zin Unix shells.
M-p In/OutPrevious Input comint-previous-input Retrieve previous commands (can be repeated to find earlier commands).
M-n In/OutNext Input comint-next-input Retrieve subsequent commands (can be repeated to find more recent commands).
Enter comint-send-input Send input on current line.
Tab comint-dynamic-complete Complete current command, filename, or variable name.
C-c C-o In/OutDelete Current Output Group comint-kill-output Delete output from last command.
C-c C-r comint-show-output Move first line of output to top of window.
C-c C-e In/OutShow Maximum Output comint-show-maximum-output Move last line of output to bottom of window.
C-c C-p In/OutBackward Output Group comint-previous-prompt Move to previous command.
C-c C-n In/OutForward Output Group comint-next-prompt Move to next command.

5.2 Using Dired, the Directory Editor

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

Интервал:

Закладка:

Сделать

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

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


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

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

x