diff options
| author | Chong Yidong | 2012-01-03 16:55:00 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-01-03 16:55:00 +0800 |
| commit | 88c5c7c8313162b94173fd4333e6062aa07c4d2e (patch) | |
| tree | 058a8318021fef3af7ec54c2750a3ec27ca92649 | |
| parent | 787cdb34ea494f0a800cd6c3f8af2fbfd69b7c29 (diff) | |
| download | emacs-88c5c7c8313162b94173fd4333e6062aa07c4d2e.tar.gz emacs-88c5c7c8313162b94173fd4333e6062aa07c4d2e.zip | |
More updates to misc.texi.
* doc/emacs/misc.texi (Single Shell): Don't document Lisp usage of
shell-command. Tidy up discussion of synchronicity. Add index
entries for async-shell-command.
(Interactive Shell): Note that M-x shell uses shell-file-name.
Note change in behavior in Emacs 24.
(Shell Mode): Shell mode now uses completion-at-point.
(Shell Prompts): Emphasize that comint-use-prompt-regexp isn't the
default method for recognizing prompts nowadays.
(Shell Ring): Add xref to Minibuffer History.
(Directory Tracking): Explain Dirtrack mode in more detail.
(Term Mode): Fix index entries.
(Paging in Term): Merge into Term Mode.
(Serial Terminal, Emacs Server, emacsclient Options): Copyedits.
(Printing): Fix xref. State default of lpr-switches.
(PostScript): Remove obsolete sentence. Omit description of
non-interactive behaviors.
(Hyperlinking): Improve description.
(Browse-URL): Using compose-mail for mailto URLs is the default.
Document browse-url-mailto-function.
(Goto Address mode): Add index entries. Add xref to Browse-URL.
(FFAP): FFAP is not a minor mode.
(Amusements): M-x lm was renamed to M-x landmark. Document
nato-region.
| -rw-r--r-- | admin/FOR-RELEASE | 2 | ||||
| -rw-r--r-- | doc/emacs/ChangeLog | 26 | ||||
| -rw-r--r-- | doc/emacs/emacs.texi | 1 | ||||
| -rw-r--r-- | doc/emacs/misc.texi | 840 | ||||
| -rw-r--r-- | etc/NEWS | 9 |
5 files changed, 404 insertions, 474 deletions
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 114ace6065a..91576dd4c8a 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE | |||
| @@ -156,7 +156,7 @@ macos.texi | |||
| 156 | maintaining.texi cyd | 156 | maintaining.texi cyd |
| 157 | mark.texi cyd | 157 | mark.texi cyd |
| 158 | mini.texi | 158 | mini.texi |
| 159 | misc.texi | 159 | misc.texi cyd |
| 160 | modes.texi cyd | 160 | modes.texi cyd |
| 161 | msdog.texi | 161 | msdog.texi |
| 162 | msdog-xtra.texi | 162 | msdog-xtra.texi |
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 30ba8779e72..c99c64eea68 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,29 @@ | |||
| 1 | 2012-01-03 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * misc.texi (Single Shell): Don't document Lisp usage of | ||
| 4 | shell-command. Tidy up discussion of synchronicity. Add index | ||
| 5 | entries for async-shell-command. | ||
| 6 | (Interactive Shell): Note that M-x shell uses shell-file-name. | ||
| 7 | Note change in behavior in Emacs 24. | ||
| 8 | (Shell Mode): Shell mode now uses completion-at-point. | ||
| 9 | (Shell Prompts): Emphasize that comint-use-prompt-regexp isn't the | ||
| 10 | default method for recognizing prompts nowadays. | ||
| 11 | (Shell Ring): Add xref to Minibuffer History. | ||
| 12 | (Directory Tracking): Explain Dirtrack mode in more detail. | ||
| 13 | (Term Mode): Fix index entries. | ||
| 14 | (Paging in Term): Merge into Term Mode. | ||
| 15 | (Serial Terminal, Emacs Server, emacsclient Options): Copyedits. | ||
| 16 | (Printing): Fix xref. State default of lpr-switches. | ||
| 17 | (PostScript): Remove obsolete sentence. Omit description of | ||
| 18 | non-interactive behaviors. | ||
| 19 | (Hyperlinking): Improve description. | ||
| 20 | (Browse-URL): Using compose-mail for mailto URLs is the default. | ||
| 21 | Document browse-url-mailto-function. | ||
| 22 | (Goto Address mode): Add index entries. Add xref to Browse-URL. | ||
| 23 | (FFAP): FFAP is not a minor mode. | ||
| 24 | (Amusements): M-x lm was renamed to M-x landmark. Document | ||
| 25 | nato-region. | ||
| 26 | |||
| 1 | 2012-01-01 Chong Yidong <cyd@gnu.org> | 27 | 2012-01-01 Chong Yidong <cyd@gnu.org> |
| 2 | 28 | ||
| 3 | * misc.texi (Gnus, Buffers of Gnus): Copyedits. | 29 | * misc.texi (Gnus, Buffers of Gnus): Copyedits. |
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index 9db0bd4616e..7a1e71b0fd2 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi | |||
| @@ -988,7 +988,6 @@ Running Shell Commands from Emacs | |||
| 988 | * Shell Options:: Options for customizing Shell mode. | 988 | * Shell Options:: Options for customizing Shell mode. |
| 989 | * Terminal emulator:: An Emacs window as a terminal emulator. | 989 | * Terminal emulator:: An Emacs window as a terminal emulator. |
| 990 | * Term Mode:: Special Emacs commands used in Term mode. | 990 | * Term Mode:: Special Emacs commands used in Term mode. |
| 991 | * Paging in Term:: Paging in the terminal emulator. | ||
| 992 | * Remote Host:: Connecting to another computer. | 991 | * Remote Host:: Connecting to another computer. |
| 993 | * Serial Terminal:: Connecting to a serial port. | 992 | * Serial Terminal:: Connecting to a serial port. |
| 994 | 993 | ||
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 3d86241a497..9e7c1dbfc94 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi | |||
| @@ -447,27 +447,32 @@ emulator window. | |||
| 447 | 447 | ||
| 448 | @table @kbd | 448 | @table @kbd |
| 449 | @item M-! @var{cmd} @key{RET} | 449 | @item M-! @var{cmd} @key{RET} |
| 450 | Run the shell command line @var{cmd} and display the output | 450 | Run the shell command @var{cmd} and display the output |
| 451 | (@code{shell-command}). | 451 | (@code{shell-command}). |
| 452 | @item M-| @var{cmd} @key{RET} | 452 | @item M-| @var{cmd} @key{RET} |
| 453 | Run the shell command line @var{cmd} with region contents as input; | 453 | Run the shell command @var{cmd} with region contents as input; |
| 454 | optionally replace the region with the output | 454 | optionally replace the region with the output |
| 455 | (@code{shell-command-on-region}). | 455 | (@code{shell-command-on-region}). |
| 456 | @item M-& @var{cmd} @key{RET} | 456 | @item M-& @var{cmd} @key{RET} |
| 457 | Run the shell command line @var{cmd} asynchronously, and display the | 457 | Run the shell command @var{cmd} asynchronously, and display the output |
| 458 | output (@code{async-shell-command}). | 458 | (@code{async-shell-command}). |
| 459 | @item M-x shell | 459 | @item M-x shell |
| 460 | Run a subshell with input and output through an Emacs buffer. | 460 | Run a subshell with input and output through an Emacs buffer. You can |
| 461 | You can then give commands interactively. | 461 | then give commands interactively. |
| 462 | @item M-x term | 462 | @item M-x term |
| 463 | Run a subshell with input and output through an Emacs buffer. | 463 | Run a subshell with input and output through an Emacs buffer. You can |
| 464 | You can then give commands interactively. | 464 | then give commands interactively. Full terminal emulation is |
| 465 | Full terminal emulation is available. | 465 | available. |
| 466 | @end table | 466 | @end table |
| 467 | 467 | ||
| 468 | @kbd{M-x eshell} invokes a shell implemented entirely in Emacs. It | 468 | @kbd{M-x eshell} invokes a shell implemented entirely in Emacs. It |
| 469 | is documented in a separate manual. @xref{Top,Eshell,Eshell, eshell, | 469 | is documented in its own manual. |
| 470 | Eshell: The Emacs Shell}. | 470 | @ifnottex |
| 471 | @xref{Top,Eshell,Eshell, eshell, Eshell: The Emacs Shell}. | ||
| 472 | @end ifnottex | ||
| 473 | @iftex | ||
| 474 | See the Eshell Info manual, which is distributed with Emacs. | ||
| 475 | @end iftex | ||
| 471 | 476 | ||
| 472 | @menu | 477 | @menu |
| 473 | * Single Shell:: How to run one shell command and return. | 478 | * Single Shell:: How to run one shell command and return. |
| @@ -479,7 +484,6 @@ Eshell: The Emacs Shell}. | |||
| 479 | * Options: Shell Options. Options for customizing Shell mode. | 484 | * Options: Shell Options. Options for customizing Shell mode. |
| 480 | * Terminal emulator:: An Emacs window as a terminal emulator. | 485 | * Terminal emulator:: An Emacs window as a terminal emulator. |
| 481 | * Term Mode:: Special Emacs commands used in Term mode. | 486 | * Term Mode:: Special Emacs commands used in Term mode. |
| 482 | * Paging in Term:: Paging in the terminal emulator. | ||
| 483 | * Remote Host:: Connecting to another computer. | 487 | * Remote Host:: Connecting to another computer. |
| 484 | * Serial Terminal:: Connecting to a serial port. | 488 | * Serial Terminal:: Connecting to a serial port. |
| 485 | @end menu | 489 | @end menu |
| @@ -490,53 +494,62 @@ Eshell: The Emacs Shell}. | |||
| 490 | @kindex M-! | 494 | @kindex M-! |
| 491 | @findex shell-command | 495 | @findex shell-command |
| 492 | @kbd{M-!} (@code{shell-command}) reads a line of text using the | 496 | @kbd{M-!} (@code{shell-command}) reads a line of text using the |
| 493 | minibuffer and executes it as a shell command in a subshell made just | 497 | minibuffer and executes it as a shell command, in a subshell made just |
| 494 | for that command. Standard input for the command comes from the null | 498 | for that command. Standard input for the command comes from the null |
| 495 | device. If the shell command produces any output, the output appears | 499 | device. If the shell command produces any output, the output appears |
| 496 | either in the echo area (if it is short), or in an Emacs buffer named | 500 | either in the echo area (if it is short), or in an Emacs buffer named |
| 497 | @samp{*Shell Command Output*}, which is displayed in another window | 501 | @samp{*Shell Command Output*}, displayed in another window (if the |
| 498 | but not selected (if the output is long). | 502 | output is long). |
| 499 | 503 | ||
| 500 | For instance, one way to decompress a file @file{foo.gz} from Emacs | 504 | For instance, one way to decompress a file named @file{foo.gz} is to |
| 501 | is to type @kbd{M-! gunzip foo.gz @key{RET}}. That shell command | 505 | type @kbd{M-! gunzip foo.gz @key{RET}}. That shell command normally |
| 502 | normally creates the file @file{foo} and produces no terminal output. | 506 | creates the file @file{foo} and produces no terminal output. |
| 503 | 507 | ||
| 504 | A numeric argument, as in @kbd{M-1 M-!}, says to insert terminal | 508 | A numeric argument to @code{shell-command}, e.g.@: @kbd{M-1 M-!}, |
| 505 | output into the current buffer instead of a separate buffer. It puts | 509 | causes it to insert terminal output into the current buffer instead of |
| 506 | point before the output, and sets the mark after the output. For | 510 | a separate buffer. It puts point before the output, and sets the mark |
| 507 | instance, @kbd{M-1 M-! gunzip < foo.gz @key{RET}} would insert the | 511 | after the output. For instance, @kbd{M-1 M-! gunzip < foo.gz |
| 508 | uncompressed equivalent of @file{foo.gz} into the current buffer. | 512 | @key{RET}} would insert the uncompressed form of the file |
| 509 | 513 | @file{foo.gz} into the current buffer. | |
| 510 | If the shell command line ends in @samp{&}, it runs asynchronously. | 514 | |
| 511 | For a synchronous shell command, @code{shell-command} returns the | 515 | Provided the specified shell command does not end with @samp{&}, it |
| 512 | command's exit status (0 means success), when it is called from a Lisp | 516 | runs @dfn{synchronously}, and you must wait for it to exit before |
| 513 | program. You do not get any status information for an asynchronous | 517 | continuing to use Emacs. To stop waiting, type @kbd{C-g} to quit; |
| 514 | command, since it hasn't finished yet when @code{shell-command} returns. | 518 | this sends a @code{SIGINT} signal to terminate the shell command (this |
| 515 | 519 | is the same signal that @kbd{C-c} normally generates in the shell). | |
| 516 | You can also type @kbd{M-&} (@code{async-shell-command}) to execute | 520 | Emacs then waits until the command actually terminates. If the shell |
| 517 | a shell command asynchronously. This behaves exactly like calling | 521 | command doesn't stop (because it ignores the @code{SIGINT} signal), |
| 518 | @code{shell-command} with @samp{&}, except that you do not need to add | 522 | type @kbd{C-g} again; this sends the command a @code{SIGKILL} signal, |
| 519 | the @samp{&} to the shell command line. | 523 | which is impossible to ignore. |
| 524 | |||
| 525 | @kindex M-& | ||
| 526 | @findex async-shell-command | ||
| 527 | A shell command that ends in @samp{&} is executed | ||
| 528 | @dfn{asynchronously}, and you can continue to use Emacs as it runs. | ||
| 529 | You can also type @kbd{M-&} (@code{async-shell-command}) to execute a | ||
| 530 | shell command asynchronously; this is exactly like calling @kbd{M-!} | ||
| 531 | with a trailing @samp{&}, except that you do not need the @samp{&}. | ||
| 532 | The output buffer for asynchronous shell commands is named | ||
| 533 | @samp{*Async Shell Command*}. Emacs inserts the output into this | ||
| 534 | buffer as it comes in, whether or not the buffer is visible in a | ||
| 535 | window. | ||
| 520 | 536 | ||
| 521 | @kindex M-| | 537 | @kindex M-| |
| 522 | @findex shell-command-on-region | 538 | @findex shell-command-on-region |
| 523 | @kbd{M-|} (@code{shell-command-on-region}) is like @kbd{M-!} but | 539 | @kbd{M-|} (@code{shell-command-on-region}) is like @kbd{M-!}, but |
| 524 | passes the contents of the region as the standard input to the shell | 540 | passes the contents of the region as the standard input to the shell |
| 525 | command, instead of no input. With a numeric argument, meaning insert | 541 | command, instead of no input. With a numeric argument, it deletes the |
| 526 | the output in the current buffer, it deletes the old region and the | 542 | old region and replaces it with the output from the shell command. |
| 527 | output replaces it as the contents of the region. It returns the | 543 | |
| 528 | command's exit status, like @kbd{M-!}. | 544 | For example, you can use @kbd{M-|} with the @command{gpg} program to |
| 529 | 545 | see what keys are in the buffer. If the buffer contains a GnuPG key, | |
| 530 | One use for @kbd{M-|} is to run @code{gpg} to see what keys are in | 546 | type @kbd{C-x h M-| gpg @key{RET}} to feed the entire buffer contents |
| 531 | the buffer. For instance, if the buffer contains a GPG key, type | 547 | to @command{gpg}. This will output the list of keys to the |
| 532 | @kbd{C-x h M-| gpg @key{RET}} to feed the entire buffer contents to | 548 | @samp{*Shell Command Output*} buffer. |
| 533 | the @code{gpg} program. That program will ignore everything except | ||
| 534 | the encoded keys, and will output a list of the keys the buffer | ||
| 535 | contains. | ||
| 536 | 549 | ||
| 537 | @vindex shell-file-name | 550 | @vindex shell-file-name |
| 538 | Both @kbd{M-!} and @kbd{M-|} use @code{shell-file-name} to specify | 551 | The above commands use the shell specified by the variable |
| 539 | the shell to use. This variable is initialized based on your | 552 | @code{shell-file-name}. Its default value is determined by the |
| 540 | @env{SHELL} environment variable when Emacs is started. If the file | 553 | @env{SHELL} environment variable when Emacs is started. If the file |
| 541 | name is relative, Emacs searches the directories in the list | 554 | name is relative, Emacs searches the directories in the list |
| 542 | @code{exec-path}; this list is initialized based on the environment | 555 | @code{exec-path}; this list is initialized based on the environment |
| @@ -544,81 +557,65 @@ variable @env{PATH} when Emacs is started. Your init file can | |||
| 544 | override either or both of these default initializations (@pxref{Init | 557 | override either or both of these default initializations (@pxref{Init |
| 545 | File}). | 558 | File}). |
| 546 | 559 | ||
| 547 | Both @kbd{M-!} and @kbd{M-|} wait for the shell command to complete, | ||
| 548 | unless you end the command with @samp{&} to make it asynchronous. To | ||
| 549 | stop waiting, type @kbd{C-g} to quit; that terminates the shell | ||
| 550 | command with the signal @code{SIGINT}---the same signal that @kbd{C-c} | ||
| 551 | normally generates in the shell. Emacs then waits until the command | ||
| 552 | actually terminates. If the shell command doesn't stop (because it | ||
| 553 | ignores the @code{SIGINT} signal), type @kbd{C-g} again; this sends | ||
| 554 | the command a @code{SIGKILL} signal which is impossible to ignore. | ||
| 555 | |||
| 556 | Asynchronous commands ending in @samp{&} feed their output into | ||
| 557 | the buffer @samp{*Async Shell Command*}. Output arrives in that | ||
| 558 | buffer regardless of whether it is visible in a window. | ||
| 559 | |||
| 560 | To specify a coding system for @kbd{M-!} or @kbd{M-|}, use the command | 560 | To specify a coding system for @kbd{M-!} or @kbd{M-|}, use the command |
| 561 | @kbd{C-x @key{RET} c} immediately beforehand. @xref{Communication Coding}. | 561 | @kbd{C-x @key{RET} c} immediately beforehand. @xref{Communication Coding}. |
| 562 | 562 | ||
| 563 | @vindex shell-command-default-error-buffer | 563 | @vindex shell-command-default-error-buffer |
| 564 | Error output from these commands is normally intermixed with the | 564 | By default, error output is intermixed with the regular output in |
| 565 | regular output. But if the variable | 565 | the output buffer. But if you change the value of the variable |
| 566 | @code{shell-command-default-error-buffer} has a string as value, and | 566 | @code{shell-command-default-error-buffer} to a string, error output is |
| 567 | it's the name of a buffer, @kbd{M-!} and @kbd{M-|} insert error output | 567 | inserted into a buffer of that name. |
| 568 | before point in that buffer. | ||
| 569 | 568 | ||
| 570 | @node Interactive Shell | 569 | @node Interactive Shell |
| 571 | @subsection Interactive Inferior Shell | 570 | @subsection Interactive Subshell |
| 572 | 571 | ||
| 573 | @findex shell | 572 | @findex shell |
| 574 | To run a subshell interactively, use @kbd{M-x shell}. This creates | 573 | To run a subshell interactively, type @kbd{M-x shell}. This creates |
| 575 | (or reuses) a buffer named @samp{*shell*} and runs a subshell with | 574 | (or reuses) a buffer named @samp{*shell*}, and runs a shell subprocess |
| 576 | input coming from and output going to that buffer. That is to say, | 575 | with input coming from and output going to that buffer. That is to |
| 577 | any ``terminal output'' from the subshell goes into the buffer, | 576 | say, any terminal output from the subshell goes into the buffer, |
| 578 | advancing point, and any ``terminal input'' for the subshell comes | 577 | advancing point, and any terminal input for the subshell comes from |
| 579 | from text in the buffer. To give input to the subshell, go to the end | 578 | text in the buffer. To give input to the subshell, go to the end of |
| 580 | of the buffer and type the input, terminated by @key{RET}. | 579 | the buffer and type the input, terminated by @key{RET}. |
| 581 | 580 | ||
| 582 | Emacs does not wait for the subshell to do anything. You can switch | 581 | While the subshell is waiting or running a command, you can switch |
| 583 | windows or buffers and edit them while the shell is waiting, or while it is | 582 | windows or buffers and perform other editing in Emacs. Emacs inserts |
| 584 | running a command. Output from the subshell waits until Emacs has time to | 583 | the output from the subshell into the Shell buffer whenever it has |
| 585 | process it; this happens whenever Emacs is waiting for keyboard input or | 584 | time to process it (e.g.@: while waiting for keyboard input). |
| 586 | for time to elapse. | ||
| 587 | 585 | ||
| 588 | @cindex @code{comint-highlight-input} face | 586 | @cindex @code{comint-highlight-input} face |
| 589 | @cindex @code{comint-highlight-prompt} face | 587 | @cindex @code{comint-highlight-prompt} face |
| 590 | Input lines, once you submit them, are displayed using the face | 588 | In the Shell buffer, prompts are displayed with the face |
| 591 | @code{comint-highlight-input}, and prompts are displayed using the | 589 | @code{comint-highlight-prompt}, and submitted input lines are |
| 592 | face @code{comint-highlight-prompt}. This makes it easier to see | 590 | displayed with the face @code{comint-highlight-input}. This makes it |
| 593 | previous input lines in the buffer. @xref{Faces}. | 591 | easier to distinguish input lines from the shell output. |
| 594 | 592 | @xref{Faces}. | |
| 595 | To make multiple subshells, you can invoke @kbd{M-x shell} with a | 593 | |
| 596 | prefix argument (e.g. @kbd{C-u M-x shell}), which will read a buffer | 594 | To make multiple subshells, invoke @kbd{M-x shell} with a prefix |
| 597 | name and create (or reuse) a subshell in that buffer. You can also | 595 | argument (e.g. @kbd{C-u M-x shell}). Then the command will read a |
| 598 | rename the @samp{*shell*} buffer using @kbd{M-x rename-uniquely}, then | 596 | buffer name, and create (or reuse) a subshell in that buffer. You can |
| 599 | create a new @samp{*shell*} buffer using plain @kbd{M-x shell}. | 597 | also rename the @samp{*shell*} buffer using @kbd{M-x rename-uniquely}, |
| 598 | then create a new @samp{*shell*} buffer using plain @kbd{M-x shell}. | ||
| 600 | Subshells in different buffers run independently and in parallel. | 599 | Subshells in different buffers run independently and in parallel. |
| 601 | 600 | ||
| 602 | @vindex explicit-shell-file-name | 601 | @vindex explicit-shell-file-name |
| 603 | @cindex environment variables for subshells | 602 | @cindex environment variables for subshells |
| 604 | @cindex @env{ESHELL} environment variable | 603 | @cindex @env{ESHELL} environment variable |
| 605 | @cindex @env{SHELL} environment variable | 604 | @cindex @env{SHELL} environment variable |
| 606 | The file name used to load the subshell is the value of the variable | 605 | To specify the shell file name used by @kbd{M-x shell}, customize |
| 607 | @code{explicit-shell-file-name}, if that is non-@code{nil}. | 606 | the variable @code{explicit-shell-file-name}. If this is @code{nil} |
| 608 | Otherwise, the environment variable @env{ESHELL} is used, or the | 607 | (the default), Emacs uses the environment variable @env{ESHELL} if it |
| 609 | environment variable @env{SHELL} if there is no @env{ESHELL}. If the | 608 | exists. Otherwise, it usually uses the variable |
| 610 | file name specified is relative, the directories in the list | 609 | @code{shell-file-name} (@pxref{Single Shell}); but if the default |
| 611 | @code{exec-path} are searched; this list is initialized based on the | 610 | directory is remote (@pxref{Remote Files}), it prompts you for the |
| 612 | environment variable @env{PATH} when Emacs is started. Your init file | 611 | shell file name. |
| 613 | can override either or both of these default initializations. | ||
| 614 | (@pxref{Init File}). | ||
| 615 | 612 | ||
| 616 | Emacs sends the new shell the contents of the file | 613 | Emacs sends the new shell the contents of the file |
| 617 | @file{~/.emacs_@var{shellname}} as input, if it exists, where | 614 | @file{~/.emacs_@var{shellname}} as input, if it exists, where |
| 618 | @var{shellname} is the name of the file that the shell was loaded | 615 | @var{shellname} is the name of the file that the shell was loaded |
| 619 | from. For example, if you use bash, the file sent to it is | 616 | from. For example, if you use bash, the file sent to it is |
| 620 | @file{~/.emacs_bash}. If this file is not found, Emacs tries to fallback | 617 | @file{~/.emacs_bash}. If this file is not found, Emacs tries with |
| 621 | on @file{~/.emacs.d/init_@var{shellname}.sh}. | 618 | @file{~/.emacs.d/init_@var{shellname}.sh}. |
| 622 | 619 | ||
| 623 | To specify a coding system for the shell, you can use the command | 620 | To specify a coding system for the shell, you can use the command |
| 624 | @kbd{C-x @key{RET} c} immediately before @kbd{M-x shell}. You can | 621 | @kbd{C-x @key{RET} c} immediately before @kbd{M-x shell}. You can |
| @@ -627,44 +624,46 @@ also change the coding system for a running subshell by typing | |||
| 627 | Coding}. | 624 | Coding}. |
| 628 | 625 | ||
| 629 | @cindex @env{INSIDE_EMACS} environment variable | 626 | @cindex @env{INSIDE_EMACS} environment variable |
| 630 | Emacs sets the environment variable @env{INSIDE_EMACS} in the | ||
| 631 | subshell to a comma-separated list including the Emacs version. | ||
| 632 | Programs can check this variable to determine whether they are running | ||
| 633 | inside an Emacs subshell. | ||
| 634 | |||
| 635 | @cindex @env{EMACS} environment variable | 627 | @cindex @env{EMACS} environment variable |
| 636 | Emacs also sets the @env{EMACS} environment variable (to @code{t}) if | 628 | Emacs sets the environment variable @env{INSIDE_EMACS} in the |
| 637 | it is not already defined. @strong{Warning:} This environment | 629 | subshell to @samp{@var{version},comint}, where @var{version} is the |
| 638 | variable is deprecated. Programs that check this variable should be | 630 | Emacs version (e.g.@: @samp{24.1}). Programs can check this variable |
| 639 | changed to check @env{INSIDE_EMACS} instead. | 631 | to determine whether they are running inside an Emacs subshell. (It |
| 632 | also sets the @env{EMACS} environment variable to @code{t}, if that | ||
| 633 | environment variable is not already defined. However, this | ||
| 634 | environment variable is deprecated; programs that use it should switch | ||
| 635 | to using @env{INSIDE_EMACS} instead.) | ||
| 640 | 636 | ||
| 641 | @node Shell Mode | 637 | @node Shell Mode |
| 642 | @subsection Shell Mode | 638 | @subsection Shell Mode |
| 643 | @cindex Shell mode | 639 | @cindex Shell mode |
| 644 | @cindex mode, Shell | 640 | @cindex mode, Shell |
| 645 | 641 | ||
| 646 | Shell buffers use Shell mode, which defines several special keys | 642 | The major mode for Shell buffers is Shell mode. Many of its special |
| 647 | attached to the @kbd{C-c} prefix. They are chosen to resemble the usual | 643 | commands are bound to the @kbd{C-c} prefix, and resemble the usual |
| 648 | editing and job control characters present in shells that are not under | 644 | editing and job control characters present in ordinary shells, except |
| 649 | Emacs, except that you must type @kbd{C-c} first. Here is a complete list | 645 | that you must type @kbd{C-c} first. Here is a list of Shell mode |
| 650 | of the special key bindings of Shell mode: | 646 | commands: |
| 651 | 647 | ||
| 652 | @table @kbd | 648 | @table @kbd |
| 653 | @item @key{RET} | 649 | @item @key{RET} |
| 654 | @kindex RET @r{(Shell mode)} | 650 | @kindex RET @r{(Shell mode)} |
| 655 | @findex comint-send-input | 651 | @findex comint-send-input |
| 656 | At end of buffer send line as input; otherwise, copy current line to | 652 | Send the current line as input to the subshell |
| 657 | end of buffer and send it (@code{comint-send-input}). Copying a line | 653 | (@code{comint-send-input}). Any shell prompt at the beginning of the |
| 658 | in this way omits any prompt at the beginning of the line (text output | 654 | line is omitted (@pxref{Shell Prompts}). If point is at the end of |
| 659 | by programs preceding your input). @xref{Shell Prompts}, for how | 655 | buffer, this is like submitting the command line in an ordinary |
| 660 | Shell mode recognizes prompts. | 656 | interactive shell. However, you can also invoke @key{RET} elsewhere |
| 657 | in the shell buffer to submit the current line as input. | ||
| 661 | 658 | ||
| 662 | @item @key{TAB} | 659 | @item @key{TAB} |
| 663 | @kindex TAB @r{(Shell mode)} | 660 | @kindex TAB @r{(Shell mode)} |
| 664 | @findex comint-dynamic-complete | 661 | @findex completion-at-point |
| 665 | Complete the command name or file name before point in the shell buffer | 662 | Complete the command name or file name before point in the shell |
| 666 | (@code{comint-dynamic-complete}). @key{TAB} also completes history | 663 | buffer (@code{completion-at-point}). This uses the usual Emacs |
| 667 | references (@pxref{History References}) and environment variable names. | 664 | completion rules (@pxref{Completion}), with the completion |
| 665 | alternatives being file names, environment variable names, the shell | ||
| 666 | command history, and history references (@pxref{History References}). | ||
| 668 | 667 | ||
| 669 | @vindex shell-completion-fignore | 668 | @vindex shell-completion-fignore |
| 670 | @vindex comint-completion-fignore | 669 | @vindex comint-completion-fignore |
| @@ -678,17 +677,16 @@ instead. | |||
| 678 | @item M-? | 677 | @item M-? |
| 679 | @kindex M-? @r{(Shell mode)} | 678 | @kindex M-? @r{(Shell mode)} |
| 680 | @findex comint-dynamic-list-filename@dots{} | 679 | @findex comint-dynamic-list-filename@dots{} |
| 681 | Display temporarily a list of the possible completions of the file name | 680 | Display temporarily a list of the possible completions of the file |
| 682 | before point in the shell buffer | 681 | name before point (@code{comint-dynamic-list-filename-completions}). |
| 683 | (@code{comint-dynamic-list-filename-completions}). | ||
| 684 | 682 | ||
| 685 | @item C-d | 683 | @item C-d |
| 686 | @kindex C-d @r{(Shell mode)} | 684 | @kindex C-d @r{(Shell mode)} |
| 687 | @findex comint-delchar-or-maybe-eof | 685 | @findex comint-delchar-or-maybe-eof |
| 688 | Either delete a character or send @acronym{EOF} | 686 | Either delete a character or send @acronym{EOF} |
| 689 | (@code{comint-delchar-or-maybe-eof}). Typed at the end of the shell | 687 | (@code{comint-delchar-or-maybe-eof}). Typed at the end of the shell |
| 690 | buffer, @kbd{C-d} sends @acronym{EOF} to the subshell. Typed at any other | 688 | buffer, this sends @acronym{EOF} to the subshell. Typed at any other |
| 691 | position in the buffer, @kbd{C-d} deletes a character as usual. | 689 | position in the buffer, this deletes a character as usual. |
| 692 | 690 | ||
| 693 | @item C-c C-a | 691 | @item C-c C-a |
| 694 | @kindex C-c C-a @r{(Shell mode)} | 692 | @kindex C-c C-a @r{(Shell mode)} |
| @@ -784,8 +782,8 @@ Move backward across one shell command, but not beyond the current line | |||
| 784 | (@code{shell-backward-command}). | 782 | (@code{shell-backward-command}). |
| 785 | 783 | ||
| 786 | @item M-x dirs | 784 | @item M-x dirs |
| 787 | Ask the shell what its current directory is, so that Emacs can agree | 785 | Ask the shell for its working directory, and update the Shell buffer's |
| 788 | with the shell. | 786 | default directory. @xref{Directory Tracking}. |
| 789 | 787 | ||
| 790 | @item M-x send-invisible @key{RET} @var{text} @key{RET} | 788 | @item M-x send-invisible @key{RET} @var{text} @key{RET} |
| 791 | @findex send-invisible | 789 | @findex send-invisible |
| @@ -854,41 +852,38 @@ specializations of Shell mode. | |||
| 854 | @node Shell Prompts | 852 | @node Shell Prompts |
| 855 | @subsection Shell Prompts | 853 | @subsection Shell Prompts |
| 856 | 854 | ||
| 857 | @vindex shell-prompt-pattern | ||
| 858 | @vindex comint-prompt-regexp | ||
| 859 | @vindex comint-use-prompt-regexp | ||
| 860 | @cindex prompt, shell | 855 | @cindex prompt, shell |
| 861 | A prompt is text output by a program to show that it is ready to | 856 | A prompt is text output by a program to show that it is ready to |
| 862 | accept new user input. Normally, Comint mode (and thus Shell mode) | 857 | accept new user input. Normally, Comint mode (and thus Shell mode) |
| 863 | considers the prompt to be any text output by a program at the | 858 | automatically figures out part of the buffer is a prompt, based on the |
| 864 | beginning of an input line. However, if the variable | 859 | output of the subprocess. (Specifically, it assumes that any received |
| 865 | @code{comint-use-prompt-regexp} is non-@code{nil}, then Comint mode | 860 | output line which doesn't end with a newline is a prompt.) |
| 866 | uses a regular expression to recognize prompts. In Shell mode, | 861 | |
| 867 | @code{shell-prompt-pattern} specifies the regular expression. | 862 | Comint mode divides the buffer into two types of @dfn{fields}: input |
| 868 | 863 | fields (where user input is typed) and output fields (everywhere | |
| 869 | The value of @code{comint-use-prompt-regexp} also affects many | 864 | else). Prompts are part of the output fields. Most Emacs motion |
| 870 | motion and paragraph commands. If the value is non-@code{nil}, the | 865 | commands do not cross field boundaries, unless they move over multiple |
| 871 | general Emacs motion commands behave as they normally do in buffers | 866 | lines. For instance, when point is in the input field on a shell |
| 872 | without special text properties. However, if the value is @code{nil}, | 867 | command line, @kbd{C-a} puts point at the beginning of the input |
| 873 | the default, then Comint mode divides the buffer into two types of | 868 | field, after the prompt. Internally, the fields are implemented using |
| 874 | ``fields'' (ranges of consecutive characters having the same | 869 | the @code{field} text property (@pxref{Text Properties,,, elisp, the |
| 875 | @code{field} text property): input and output. Prompts are part of | 870 | Emacs Lisp Reference Manual}). |
| 876 | the output. Most Emacs motion commands do not cross field boundaries, | 871 | |
| 877 | unless they move over multiple lines. For instance, when point is in | 872 | @vindex comint-use-prompt-regexp |
| 878 | input on the same line as a prompt, @kbd{C-a} puts point at the | 873 | @vindex shell-prompt-pattern |
| 879 | beginning of the input if @code{comint-use-prompt-regexp} is | 874 | If you change the variable @code{comint-use-prompt-regexp} to a |
| 880 | @code{nil} and at the beginning of the line otherwise. | 875 | non-@code{nil} value, then Comint mode recognize prompts using a |
| 881 | 876 | regular expression (@pxref{Regexps}). In Shell mode, the regular | |
| 882 | In Shell mode, only shell prompts start new paragraphs. Thus, a | 877 | expression is specified by the variable @code{shell-prompt-pattern}. |
| 883 | paragraph consists of a prompt and the input and output that follow | 878 | The default value of @code{comint-use-prompt-regexp} is @code{nil}, |
| 884 | it. However, if @code{comint-use-prompt-regexp} is @code{nil}, the | 879 | because this method for recognizing prompts is unreliable, but you may |
| 885 | default, most paragraph commands do not cross field boundaries. This | 880 | want to set it to a non-@code{nil} value in unusual circumstances. In |
| 886 | means that prompts, ranges of input, and ranges of non-prompt output | 881 | that case, Emacs does not divide the Comint buffer into fields, so the |
| 887 | behave mostly like separate paragraphs; with this setting, numeric | 882 | general motion commands behave as they normally do in buffers without |
| 888 | arguments to most paragraph commands yield essentially undefined | 883 | special text properties. However, you can use the paragraph motion |
| 889 | behavior. For the purpose of finding paragraph boundaries, Shell mode | 884 | commands to conveniently navigate the buffer (@pxref{Paragraphs}); in |
| 890 | uses @code{shell-prompt-pattern}, regardless of | 885 | Shell mode, Emacs uses @code{shell-prompt-pattern} as paragraph |
| 891 | @code{comint-use-prompt-regexp}. | 886 | boundaries. |
| 892 | 887 | ||
| 893 | @node Shell History | 888 | @node Shell History |
| 894 | @subsection Shell Command History | 889 | @subsection Shell Command History |
| @@ -945,11 +940,12 @@ Display the buffer's history of shell commands in another window | |||
| 945 | (@code{comint-dynamic-list-input-ring}). | 940 | (@code{comint-dynamic-list-input-ring}). |
| 946 | @end table | 941 | @end table |
| 947 | 942 | ||
| 948 | Shell buffers provide a history of previously entered shell commands. To | 943 | Shell buffers provide a history of previously entered shell |
| 949 | reuse shell commands from the history, use the editing commands @kbd{M-p}, | 944 | commands. To reuse shell commands from the history, use the editing |
| 950 | @kbd{M-n}, @kbd{M-r} and @kbd{M-s}. These work just like the minibuffer | 945 | commands @kbd{M-p}, @kbd{M-n}, @kbd{M-r} and @kbd{M-s}. These work |
| 951 | history commands except that they operate on the text at the end of the | 946 | just like the minibuffer history commands (@pxref{Minibuffer |
| 952 | shell buffer, where you would normally insert text to send to the shell. | 947 | History}), except that they operate within the Shell buffer rather |
| 948 | than the minibuffer. | ||
| 953 | 949 | ||
| 954 | @kbd{M-p} fetches an earlier shell command to the end of the shell | 950 | @kbd{M-p} fetches an earlier shell command to the end of the shell |
| 955 | buffer. Successive use of @kbd{M-p} fetches successively earlier | 951 | buffer. Successive use of @kbd{M-p} fetches successively earlier |
| @@ -1076,39 +1072,40 @@ command @code{comint-magic-space}. | |||
| 1076 | @vindex shell-popd-regexp | 1072 | @vindex shell-popd-regexp |
| 1077 | @vindex shell-cd-regexp | 1073 | @vindex shell-cd-regexp |
| 1078 | Shell mode keeps track of @samp{cd}, @samp{pushd} and @samp{popd} | 1074 | Shell mode keeps track of @samp{cd}, @samp{pushd} and @samp{popd} |
| 1079 | commands given to the inferior shell, so it can keep the | 1075 | commands given to the subshell, in order to keep the Shell buffer's |
| 1080 | @samp{*shell*} buffer's default directory the same as the shell's | 1076 | default directory (@pxref{File Names}) the same as the shell's working |
| 1081 | working directory. It recognizes these commands syntactically, by | 1077 | directory. It recognizes these commands by examining lines of input |
| 1082 | examining lines of input that are sent. | 1078 | that you send. |
| 1083 | 1079 | ||
| 1084 | If you use aliases for these commands, you can tell Emacs to | 1080 | If you use aliases for these commands, you can tell Emacs to |
| 1085 | recognize them also. For example, if the value of the variable | 1081 | recognize them also, by setting the variables |
| 1086 | @code{shell-pushd-regexp} matches the beginning of a shell command | 1082 | @code{shell-pushd-regexp}, @code{shell-popd-regexp}, and |
| 1087 | line, that line is regarded as a @code{pushd} command. Change this | 1083 | @code{shell-cd-regexp} to the appropriate regular expressions |
| 1088 | variable when you add aliases for @samp{pushd}. Likewise, | 1084 | (@pxref{Regexps}). For example, if @code{shell-pushd-regexp} matches |
| 1089 | @code{shell-popd-regexp} and @code{shell-cd-regexp} are used to | 1085 | the beginning of a shell command line, that line is regarded as a |
| 1090 | recognize commands with the meaning of @samp{popd} and @samp{cd}. | 1086 | @code{pushd} command. These commands are recognized only at the |
| 1091 | These commands are recognized only at the beginning of a shell command | 1087 | beginning of a shell command line. |
| 1092 | line. | ||
| 1093 | |||
| 1094 | @ignore @c This seems to have been deleted long ago. | ||
| 1095 | @vindex shell-set-directory-error-hook | ||
| 1096 | If Emacs gets an error while trying to handle what it believes is a | ||
| 1097 | @samp{cd}, @samp{pushd} or @samp{popd} command, it runs the hook | ||
| 1098 | @code{shell-set-directory-error-hook} (@pxref{Hooks}). | ||
| 1099 | @end ignore | ||
| 1100 | 1088 | ||
| 1101 | @findex dirs | 1089 | @findex dirs |
| 1102 | If Emacs gets confused about changes in the current directory of the | 1090 | If Emacs gets confused about changes in the working directory of the |
| 1103 | subshell, use the command @kbd{M-x dirs} to ask the shell what its | 1091 | subshell, type @kbd{M-x dirs}. This command asks the shell for its |
| 1104 | current directory is. This command works for shells that support the | 1092 | working directory and updates the default directory accordingly. It |
| 1105 | most common command syntax; it may not work for unusual shells. | 1093 | works for shells that support the most common command syntax, but may |
| 1094 | not work for unusual shells. | ||
| 1106 | 1095 | ||
| 1107 | @findex dirtrack-mode | 1096 | @findex dirtrack-mode |
| 1108 | You can also use @kbd{M-x dirtrack-mode} to enable (or disable) an | 1097 | @cindex Dirtrack mode |
| 1109 | alternative method of tracking changes in the current directory. This | 1098 | @cindex mode, Dirtrack |
| 1110 | method relies on your shell prompt containing the full current working | 1099 | @vindex dirtrack-list |
| 1111 | directory at all times. | 1100 | You can also use Dirtrack mode, a buffer-local minor mode that |
| 1101 | implements an alternative method of tracking the shell's working | ||
| 1102 | directory. To use this method, your shell prompt must contain the | ||
| 1103 | working directory at all times, and you must supply a regular | ||
| 1104 | expression for recognizing which part of the prompt contains the | ||
| 1105 | working directory; see the documentation of the variable | ||
| 1106 | @code{dirtrack-list} for details. To use Dirtrack mode, type @kbd{M-x | ||
| 1107 | dirtrack-mode} in the Shell buffer, or add @code{dirtrack-mode} to | ||
| 1108 | @code{shell-mode-hook} (@pxref{Hooks}). | ||
| 1112 | 1109 | ||
| 1113 | @node Shell Options | 1110 | @node Shell Options |
| 1114 | @subsection Shell Mode Options | 1111 | @subsection Shell Mode Options |
| @@ -1185,10 +1182,10 @@ subshell with input coming from your keyboard, and output going to | |||
| 1185 | that buffer. | 1182 | that buffer. |
| 1186 | 1183 | ||
| 1187 | The terminal emulator uses Term mode, which has two input modes. In | 1184 | The terminal emulator uses Term mode, which has two input modes. In |
| 1188 | line mode, Term basically acts like Shell mode; see @ref{Shell Mode}. | 1185 | line mode, Term basically acts like Shell mode (@pxref{Shell Mode}). |
| 1189 | 1186 | ||
| 1190 | In char mode, each character is sent directly to the inferior | 1187 | In char mode, each character is sent directly to the subshell, as |
| 1191 | subshell, as ``terminal input.'' Any ``echoing'' of your input is the | 1188 | ``terminal input.'' Any ``echoing'' of your input is the |
| 1192 | responsibility of the subshell. The sole exception is the terminal | 1189 | responsibility of the subshell. The sole exception is the terminal |
| 1193 | escape character, which by default is @kbd{C-c} (@pxref{Term Mode}). | 1190 | escape character, which by default is @kbd{C-c} (@pxref{Term Mode}). |
| 1194 | Any ``terminal output'' from the subshell goes into the buffer, | 1191 | Any ``terminal output'' from the subshell goes into the buffer, |
| @@ -1204,8 +1201,8 @@ handles each one appropriately, changing the buffer so that the | |||
| 1204 | appearance of the window matches what it would be on a real terminal. | 1201 | appearance of the window matches what it would be on a real terminal. |
| 1205 | You can actually run Emacs inside an Emacs Term window. | 1202 | You can actually run Emacs inside an Emacs Term window. |
| 1206 | 1203 | ||
| 1207 | You can use Term mode to communicate with a device connected to a | 1204 | You can also Term mode to communicate with a device connected to a |
| 1208 | serial port of your computer. @xref{Serial Terminal}. | 1205 | serial port. @xref{Serial Terminal}. |
| 1209 | 1206 | ||
| 1210 | The file name used to load the subshell is determined the same way | 1207 | The file name used to load the subshell is determined the same way |
| 1211 | as for Shell mode. To make multiple terminal emulators, rename the | 1208 | as for Shell mode. To make multiple terminal emulators, rename the |
| @@ -1223,22 +1220,24 @@ and later. | |||
| 1223 | @cindex mode, Term | 1220 | @cindex mode, Term |
| 1224 | 1221 | ||
| 1225 | The terminal emulator uses Term mode, which has two input modes. In | 1222 | The terminal emulator uses Term mode, which has two input modes. In |
| 1226 | line mode, Term basically acts like Shell mode; see @ref{Shell Mode}. | 1223 | line mode, Term basically acts like Shell mode (@pxref{Shell Mode}). |
| 1227 | In char mode, each character is sent directly to the inferior | 1224 | In char mode, each character is sent directly to the subshell, except |
| 1228 | subshell, except for the Term escape character, normally @kbd{C-c}. | 1225 | for the Term escape character, normally @kbd{C-c}. |
| 1229 | 1226 | ||
| 1230 | To switch between line and char mode, use these commands: | 1227 | To switch between line and char mode, use these commands: |
| 1231 | 1228 | ||
| 1232 | @table @kbd | 1229 | @table @kbd |
| 1233 | @kindex C-c C-j @r{(Term mode)} | 1230 | @kindex C-c C-j @r{(Term mode)} |
| 1234 | @findex term-char-mode | 1231 | @findex term-line-mode |
| 1235 | @item C-c C-j | 1232 | @item C-c C-j |
| 1236 | Switch to line mode. Do nothing if already in line mode. | 1233 | Switch to line mode (@code{term-line-mode}). Do nothing if already in |
| 1234 | line mode. | ||
| 1237 | 1235 | ||
| 1238 | @kindex C-c C-k @r{(Term mode)} | 1236 | @kindex C-c C-k @r{(Term mode)} |
| 1239 | @findex term-line-mode | 1237 | @findex term-char-mode |
| 1240 | @item C-c C-k | 1238 | @item C-c C-k |
| 1241 | Switch to char mode. Do nothing if already in char mode. | 1239 | Switch to char mode (@code{term-char-mode}). Do nothing if already in |
| 1240 | char mode. | ||
| 1242 | @end table | 1241 | @end table |
| 1243 | 1242 | ||
| 1244 | The following commands are only available in char mode: | 1243 | The following commands are only available in char mode: |
| @@ -1253,28 +1252,23 @@ example, @kbd{C-c o} invokes the global binding of @kbd{C-x o}, which | |||
| 1253 | is normally @samp{other-window}. | 1252 | is normally @samp{other-window}. |
| 1254 | @end table | 1253 | @end table |
| 1255 | 1254 | ||
| 1256 | @node Paging in Term | 1255 | @cindex paging in Term mode |
| 1257 | @subsection Page-At-A-Time Output | 1256 | Term mode has a page-at-a-time feature. When enabled, it makes |
| 1258 | @cindex page-at-a-time | 1257 | output pause at the end of each screenful: |
| 1259 | |||
| 1260 | Term mode has a page-at-a-time feature. When enabled it makes | ||
| 1261 | output pause at the end of each screenful. | ||
| 1262 | 1258 | ||
| 1263 | @table @kbd | 1259 | @table @kbd |
| 1264 | @kindex C-c C-q @r{(Term mode)} | 1260 | @kindex C-c C-q @r{(Term mode)} |
| 1265 | @findex term-pager-toggle | 1261 | @findex term-pager-toggle |
| 1266 | @item C-c C-q | 1262 | @item C-c C-q |
| 1267 | Toggle the page-at-a-time feature. This command works in both line | 1263 | Toggle the page-at-a-time feature. This command works in both line |
| 1268 | and char modes. When page-at-a-time is enabled, the mode-line | 1264 | and char modes. When the feature is enabled, the mode-line displays |
| 1269 | displays the word @samp{page}. | 1265 | the word @samp{page}, and each time Term receives more than a |
| 1266 | screenful of output, it pauses and displays @samp{**MORE**} in the | ||
| 1267 | mode-line. Type @key{SPC} to display the next screenful of output, or | ||
| 1268 | @kbd{?} to see your other options. The interface is similar to the | ||
| 1269 | @code{more} program. | ||
| 1270 | @end table | 1270 | @end table |
| 1271 | 1271 | ||
| 1272 | With page-at-a-time enabled, whenever Term receives more than a | ||
| 1273 | screenful of output since your last input, it pauses, displaying | ||
| 1274 | @samp{**MORE**} in the mode-line. Type @key{SPC} to display the next | ||
| 1275 | screenful of output. Type @kbd{?} to see your other options. The | ||
| 1276 | interface is similar to the @code{more} program. | ||
| 1277 | |||
| 1278 | @node Remote Host | 1272 | @node Remote Host |
| 1279 | @subsection Remote Host Shell | 1273 | @subsection Remote Host Shell |
| 1280 | @cindex remote host | 1274 | @cindex remote host |
| @@ -1297,71 +1291,8 @@ happens automatically; there is no special password processing.) | |||
| 1297 | of terminal you're using, by setting the @env{TERM} environment | 1291 | of terminal you're using, by setting the @env{TERM} environment |
| 1298 | variable in the environment for the remote login command. (If you use | 1292 | variable in the environment for the remote login command. (If you use |
| 1299 | bash, you do that by writing the variable assignment before the remote | 1293 | bash, you do that by writing the variable assignment before the remote |
| 1300 | login command, without separating comma.) Terminal types @samp{ansi} | 1294 | login command, without a separating comma.) Terminal types |
| 1301 | or @samp{vt100} will work on most systems. | 1295 | @samp{ansi} or @samp{vt100} will work on most systems. |
| 1302 | |||
| 1303 | @c If you are talking to a Bourne-compatible | ||
| 1304 | @c shell, and your system understands the @env{TERMCAP} variable, | ||
| 1305 | @c you can use the command @kbd{M-x shell-send-termcap}, which | ||
| 1306 | @c sends a string specifying the terminal type and size. | ||
| 1307 | @c (This command is also useful after the window has changed size.) | ||
| 1308 | |||
| 1309 | @c You can of course run @samp{gdb} on that remote computer. One useful | ||
| 1310 | @c trick: If you invoke gdb with the @code{--fullname} option, | ||
| 1311 | @c it will send special commands to Emacs that will cause Emacs to | ||
| 1312 | @c pop up the source files you're debugging. This will work | ||
| 1313 | @c whether or not gdb is running on a different computer than Emacs, | ||
| 1314 | @c as long as Emacs can access the source files specified by gdb. | ||
| 1315 | |||
| 1316 | @ignore | ||
| 1317 | You cannot log in to a remote computer using the Shell mode. | ||
| 1318 | @c (This will change when Shell is re-written to use Term.) | ||
| 1319 | Instead, Emacs provides two commands for logging in to another computer | ||
| 1320 | and communicating with it through an Emacs buffer using Comint mode: | ||
| 1321 | |||
| 1322 | @table @kbd | ||
| 1323 | @item M-x telnet @key{RET} @var{hostname} @key{RET} | ||
| 1324 | Set up a Telnet connection to the computer named @var{hostname}. | ||
| 1325 | @item M-x rlogin @key{RET} @var{hostname} @key{RET} | ||
| 1326 | Set up an Rlogin connection to the computer named @var{hostname}. | ||
| 1327 | @end table | ||
| 1328 | |||
| 1329 | @findex telnet | ||
| 1330 | Use @kbd{M-x telnet} to set up a Telnet connection to another | ||
| 1331 | computer. (Telnet is the standard Internet protocol for remote login.) | ||
| 1332 | It reads the host name of the other computer as an argument with the | ||
| 1333 | minibuffer. Once the connection is established, talking to the other | ||
| 1334 | computer works like talking to a subshell: you can edit input with the | ||
| 1335 | usual Emacs commands, and send it a line at a time by typing @key{RET}. | ||
| 1336 | The output is inserted in the Telnet buffer interspersed with the input. | ||
| 1337 | |||
| 1338 | @findex rlogin | ||
| 1339 | @vindex rlogin-explicit-args | ||
| 1340 | Use @kbd{M-x rlogin} to set up an Rlogin connection. Rlogin is | ||
| 1341 | another remote login communication protocol, essentially much like the | ||
| 1342 | Telnet protocol but incompatible with it, and supported only by certain | ||
| 1343 | systems. Rlogin's advantages are that you can arrange not to have to | ||
| 1344 | give your user name and password when communicating between two machines | ||
| 1345 | you frequently use, and that you can make an 8-bit-clean connection. | ||
| 1346 | (To do that in Emacs, set @code{rlogin-explicit-args} to @code{("-8")} | ||
| 1347 | before you run Rlogin.) | ||
| 1348 | |||
| 1349 | @kbd{M-x rlogin} sets up the default file directory of the Emacs | ||
| 1350 | buffer to access the remote host via FTP (@pxref{File Names}), and it | ||
| 1351 | tracks the shell commands that change the current directory, just like | ||
| 1352 | Shell mode. | ||
| 1353 | |||
| 1354 | @findex rlogin-directory-tracking-mode | ||
| 1355 | There are two ways of doing directory tracking in an Rlogin | ||
| 1356 | buffer---either with remote directory names | ||
| 1357 | @file{/@var{host}:@var{dir}/} or with local names (that works if the | ||
| 1358 | ``remote'' machine shares file systems with your machine of origin). | ||
| 1359 | You can use the command @code{rlogin-directory-tracking-mode} to switch | ||
| 1360 | modes. No argument means use remote directory names, a positive | ||
| 1361 | argument means use local names, and a negative argument means turn | ||
| 1362 | off directory tracking. | ||
| 1363 | |||
| 1364 | @end ignore | ||
| 1365 | 1296 | ||
| 1366 | @node Serial Terminal | 1297 | @node Serial Terminal |
| 1367 | @subsection Serial Terminal | 1298 | @subsection Serial Terminal |
| @@ -1369,9 +1300,10 @@ off directory tracking. | |||
| 1369 | @findex serial-term | 1300 | @findex serial-term |
| 1370 | 1301 | ||
| 1371 | If you have a device connected to a serial port of your computer, | 1302 | If you have a device connected to a serial port of your computer, |
| 1372 | you can use Emacs to communicate with it. @kbd{M-x serial-term} will | 1303 | you can communicate with it by typing @kbd{M-x serial-term}. This |
| 1373 | ask you for a serial port name and speed and will then open a new | 1304 | command asks for a serial port name and speed, and switches to a new |
| 1374 | window in @ref{Term Mode}. | 1305 | Term mode buffer. Emacs communicates with the serial device through |
| 1306 | this buffer just like it does with a terminal in ordinary Term mode. | ||
| 1375 | 1307 | ||
| 1376 | The speed of the serial port is measured in bits per second. The | 1308 | The speed of the serial port is measured in bits per second. The |
| 1377 | most common speed is 9600 bits per second. You can change the speed | 1309 | most common speed is 9600 bits per second. You can change the speed |
| @@ -1382,10 +1314,6 @@ the mode line. By default, a serial port is configured as ``8N1'', | |||
| 1382 | which means that each byte consists of 8 data bits, No parity check | 1314 | which means that each byte consists of 8 data bits, No parity check |
| 1383 | bit, and 1 stopbit. | 1315 | bit, and 1 stopbit. |
| 1384 | 1316 | ||
| 1385 | When you have opened the serial port connection, you will see output | ||
| 1386 | from the device in the window. Also, what you type in the window is | ||
| 1387 | sent to the device. | ||
| 1388 | |||
| 1389 | If the speed or the configuration is wrong, you cannot communicate | 1317 | If the speed or the configuration is wrong, you cannot communicate |
| 1390 | with your device and will probably only see garbage output in the | 1318 | with your device and will probably only see garbage output in the |
| 1391 | window. | 1319 | window. |
| @@ -1397,12 +1325,14 @@ window. | |||
| 1397 | @cindex server, using Emacs as | 1325 | @cindex server, using Emacs as |
| 1398 | @cindex @env{EDITOR} environment variable | 1326 | @cindex @env{EDITOR} environment variable |
| 1399 | 1327 | ||
| 1400 | Various programs such as @command{mail} can invoke your choice of | 1328 | Various programs can invoke your choice of editor to edit a |
| 1401 | editor to edit a particular piece of text, such as a message that you | 1329 | particular piece of text. For instance, version control programs |
| 1402 | are sending. By convention, most of these programs use the | 1330 | invoke an editor to enter version control logs (@pxref{Version |
| 1403 | environment variable @env{EDITOR} to specify which editor to run. If | 1331 | Control}), and the Unix @command{mail} utility invokes an editor to |
| 1404 | you set @env{EDITOR} to @samp{emacs}, they invoke Emacs---but in an | 1332 | enter a message to send. By convention, your choice of editor is |
| 1405 | inconvenient way, by starting a new Emacs process. This is | 1333 | specified by the environment variable @env{EDITOR}. If you set |
| 1334 | @env{EDITOR} to @samp{emacs}, Emacs would be invoked, but in an | ||
| 1335 | inconvenient way---by starting a new Emacs process. This is | ||
| 1406 | inconvenient because the new Emacs process doesn't share buffers, a | 1336 | inconvenient because the new Emacs process doesn't share buffers, a |
| 1407 | command history, or other kinds of information with any existing Emacs | 1337 | command history, or other kinds of information with any existing Emacs |
| 1408 | process. | 1338 | process. |
| @@ -1411,30 +1341,33 @@ process. | |||
| 1411 | server}, so that it ``listens'' for external edit requests and acts | 1341 | server}, so that it ``listens'' for external edit requests and acts |
| 1412 | accordingly. There are two ways to start an Emacs server: | 1342 | accordingly. There are two ways to start an Emacs server: |
| 1413 | 1343 | ||
| 1344 | @itemize | ||
| 1414 | @findex server-start | 1345 | @findex server-start |
| 1415 | The first is to run the command @code{server-start} in an existing | 1346 | @item |
| 1416 | Emacs process: either type @kbd{M-x server-start}, or put the | 1347 | Run the command @code{server-start} in an existing Emacs process: |
| 1417 | expression @code{(server-start)} in your initialization file | 1348 | either type @kbd{M-x server-start}, or put the expression |
| 1418 | (@pxref{Init File}). The existing Emacs process is the server; when | 1349 | @code{(server-start)} in your init file (@pxref{Init File}). The |
| 1419 | you exit Emacs, the server dies with the Emacs process. | 1350 | existing Emacs process is the server; when you exit Emacs, the server |
| 1351 | dies with the Emacs process. | ||
| 1420 | 1352 | ||
| 1421 | @cindex daemon, Emacs | 1353 | @cindex daemon, Emacs |
| 1422 | The second way to start an Emacs server is to run Emacs as a | 1354 | @item |
| 1423 | @dfn{daemon}, using the @samp{--daemon} command-line option. | 1355 | Run Emacs as a @dfn{daemon}, using the @samp{--daemon} command-line |
| 1424 | @xref{Initial Options}. When Emacs is started this way, it calls | 1356 | option. @xref{Initial Options}. When Emacs is started this way, it |
| 1425 | @code{server-start} after initialization, and returns control to the | 1357 | calls @code{server-start} after initialization, and returns control to |
| 1426 | calling terminal instead of opening an initial frame; it then waits in | 1358 | the calling terminal instead of opening an initial frame; it then |
| 1427 | the background, listening for edit requests. | 1359 | waits in the background, listening for edit requests. |
| 1360 | @end itemize | ||
| 1428 | 1361 | ||
| 1429 | @cindex @env{TEXEDIT} environment variable | 1362 | @cindex @env{TEXEDIT} environment variable |
| 1430 | Once an Emacs server is set up, you can use a shell command called | 1363 | Either way, once an Emacs server is started, you can use a shell |
| 1431 | @command{emacsclient} to connect to the existing Emacs process and | 1364 | command called @command{emacsclient} to connect to the Emacs process |
| 1432 | tell it to visit a file. If you set the @env{EDITOR} environment | 1365 | and tell it to visit a file. You can then set the @env{EDITOR} |
| 1433 | variable to @samp{emacsclient}, programs such as @command{mail} will | 1366 | environment variable to @samp{emacsclient}, so that external programs |
| 1434 | use the existing Emacs process for editing.@footnote{Some programs use | 1367 | will use the existing Emacs process for editing.@footnote{Some |
| 1435 | a different environment variable; for example, to make @TeX{} use | 1368 | programs use a different environment variable; for example, to make |
| 1436 | @samp{emacsclient}, set the @env{TEXEDIT} environment variable to | 1369 | @TeX{} use @samp{emacsclient}, set the @env{TEXEDIT} environment |
| 1437 | @samp{emacsclient +%d %s}.} | 1370 | variable to @samp{emacsclient +%d %s}.} |
| 1438 | 1371 | ||
| 1439 | @vindex server-name | 1372 | @vindex server-name |
| 1440 | You can run multiple Emacs servers on the same machine by giving | 1373 | You can run multiple Emacs servers on the same machine by giving |
| @@ -1445,13 +1378,13 @@ server-name @key{RET} foo @key{RET}} sets the server name to | |||
| 1445 | name, using the @samp{-s} option (@pxref{emacsclient Options}). | 1378 | name, using the @samp{-s} option (@pxref{emacsclient Options}). |
| 1446 | 1379 | ||
| 1447 | @findex server-eval-at | 1380 | @findex server-eval-at |
| 1448 | If you have defined a server by a unique server name, you can | 1381 | If you have defined a server by a unique server name, it is possible |
| 1449 | connect to this server from other Emacs instances and evaluate forms | 1382 | to connect to the server from another Emacs instance and evaluate Lisp |
| 1450 | on it by using the @code{server-eval-at} function. | 1383 | expressions on the server, using the @code{server-eval-at} function. |
| 1451 | 1384 | For instance, @code{(server-eval-at "foo" '(+ 1 2))} evaluates the | |
| 1452 | @code{(server-eval-at "foo" '(+ 1 2))} gives the result @code{3}, if | 1385 | expression @code{(+ 1 2)} on the @samp{foo} server, and returns |
| 1453 | there's a server with that name that is listening. If not, an error | 1386 | @code{3}. (If there is no server with that name, an error is |
| 1454 | will be signaled. | 1387 | signaled.) Currently, this feature is mainly useful for developers. |
| 1455 | 1388 | ||
| 1456 | @menu | 1389 | @menu |
| 1457 | * Invoking emacsclient:: Connecting to the Emacs server. | 1390 | * Invoking emacsclient:: Connecting to the Emacs server. |
| @@ -1565,14 +1498,14 @@ precedence. | |||
| 1565 | 1498 | ||
| 1566 | @item -c | 1499 | @item -c |
| 1567 | Create a new graphical frame, instead of using an existing Emacs | 1500 | Create a new graphical frame, instead of using an existing Emacs |
| 1568 | frame. Emacs 23 can create a graphical frame even if it was started | 1501 | frame. Emacs can create a graphical frame even if it was started in a |
| 1569 | in a text-only terminal, provided it is able to connect to a graphical | 1502 | text-only terminal, provided it is able to connect to a graphical |
| 1570 | display. If no graphical display is available, Emacs creates a new | 1503 | display. If no graphical display is available, Emacs creates a new |
| 1571 | text-only terminal frame (@pxref{Frames}). If you omit a filename | 1504 | text-only terminal frame (@pxref{Frames}). If you omit a filename |
| 1572 | argument while supplying the @samp{-c} option, the new frame displays | 1505 | argument while supplying the @samp{-c} option, the new frame displays |
| 1573 | the @samp{*scratch*} buffer (@pxref{Buffers}). | 1506 | the @samp{*scratch*} buffer (@pxref{Buffers}). |
| 1574 | 1507 | ||
| 1575 | @item -F | 1508 | @item -F @var{alist} |
| 1576 | @itemx --frame-parameters=@var{alist} | 1509 | @itemx --frame-parameters=@var{alist} |
| 1577 | Set the parameters for a newly-created graphical frame | 1510 | Set the parameters for a newly-created graphical frame |
| 1578 | (@pxref{Frame Parameters}). | 1511 | (@pxref{Frame Parameters}). |
| @@ -1653,7 +1586,7 @@ server it finds. (This option is not supported on MS-Windows.) | |||
| 1653 | @itemx --tty | 1586 | @itemx --tty |
| 1654 | @itemx -nw | 1587 | @itemx -nw |
| 1655 | Create a new Emacs frame on the current text-only terminal, instead of | 1588 | Create a new Emacs frame on the current text-only terminal, instead of |
| 1656 | using an existing Emacs frame. Emacs 23 can open a text-only terminal | 1589 | using an existing Emacs frame. Emacs can open a text-only terminal |
| 1657 | even if it was started in another text-only terminal, or on a | 1590 | even if it was started in another text-only terminal, or on a |
| 1658 | graphical display. If you omit a filename argument while supplying | 1591 | graphical display. If you omit a filename argument while supplying |
| 1659 | this option, the new frame displays the @samp{*scratch*} buffer. | 1592 | this option, the new frame displays the @samp{*scratch*} buffer. |
| @@ -1677,23 +1610,23 @@ process, type @kbd{M-x kill-emacs}. | |||
| 1677 | @cindex hardcopy | 1610 | @cindex hardcopy |
| 1678 | @cindex printing | 1611 | @cindex printing |
| 1679 | 1612 | ||
| 1680 | Emacs provides commands for printing hard copies of either an entire | 1613 | Emacs provides commands for printing hardcopies of either an entire |
| 1681 | buffer or just part of one, with or without page headers. You can | 1614 | buffer or part of one. You can invoke the printing commands directly, |
| 1682 | invoke the printing commands directly, as detailed in the following | 1615 | as detailed below, or using the @samp{File} menu on the menu bar. |
| 1683 | section, or using the @samp{File} menu on the menu bar. | ||
| 1684 | 1616 | ||
| 1685 | @findex htmlfontify-buffer | 1617 | @findex htmlfontify-buffer |
| 1686 | Aside from the commands described in this section, you can also | 1618 | Aside from the commands described in this section, you can also |
| 1687 | ``print'' an Emacs buffer to HTML with @kbd{M-x htmlfontify-buffer}. | 1619 | print hardcopies from Dired (@pxref{Operating on Files}) and the diary |
| 1688 | This command converts the current buffer to a HTML file, replacing | 1620 | (@pxref{Displaying the Diary}). You can also ``print'' an Emacs |
| 1689 | Emacs faces with CSS-based markup. In addition, see the hardcopy | 1621 | buffer to HTML with the command @kbd{M-x htmlfontify-buffer}, which |
| 1690 | commands of Dired (@pxref{Misc File Ops}) and the diary | 1622 | converts the current buffer to a HTML file, replacing Emacs faces with |
| 1691 | (@pxref{Displaying the Diary}). | 1623 | CSS-based markup. Furthermore, Org mode allows you to ``print'' Org |
| 1624 | files to a variety of formats, such as PDF (@pxref{Org Mode}). | ||
| 1692 | 1625 | ||
| 1693 | @table @kbd | 1626 | @table @kbd |
| 1694 | @item M-x print-buffer | 1627 | @item M-x print-buffer |
| 1695 | Print hardcopy of current buffer with page headings containing the file | 1628 | Print hardcopy of current buffer with page headings containing the |
| 1696 | name and page number. | 1629 | file name and page number. |
| 1697 | @item M-x lpr-buffer | 1630 | @item M-x lpr-buffer |
| 1698 | Print hardcopy of current buffer without page headings. | 1631 | Print hardcopy of current buffer without page headings. |
| 1699 | @item M-x print-region | 1632 | @item M-x print-region |
| @@ -1707,33 +1640,32 @@ Like @code{lpr-buffer} but print only the current region. | |||
| 1707 | @findex lpr-buffer | 1640 | @findex lpr-buffer |
| 1708 | @findex lpr-region | 1641 | @findex lpr-region |
| 1709 | @vindex lpr-switches | 1642 | @vindex lpr-switches |
| 1710 | The hardcopy commands (aside from the PostScript commands) pass extra | 1643 | @vindex lpr-commands |
| 1711 | switches to the @code{lpr} program based on the value of the variable | 1644 | On most operating system, the above hardcopy commands submit files |
| 1712 | @code{lpr-switches}. Its value should be a list of strings, each string | 1645 | for printing by calling the @command{lpr} program. To change the |
| 1713 | an option starting with @samp{-}. For example, to specify a line width | 1646 | printer program, customize the variable @code{lpr-command}. To |
| 1714 | of 80 columns for all the printing you do in Emacs, set | 1647 | specify extra switches to give the printer program, customize the list |
| 1715 | @code{lpr-switches} like this: | 1648 | variable @code{lpr-switches}. Its value should be a list of option |
| 1716 | 1649 | strings, each of which should start with @samp{-} (e.g.@: the option | |
| 1717 | @example | 1650 | string @code{"-w80"} specifies a line width of 80 columns). The |
| 1718 | (setq lpr-switches '("-w80")) | 1651 | default is the empty list, @code{nil}. |
| 1719 | @end example | ||
| 1720 | 1652 | ||
| 1721 | @vindex printer-name | 1653 | @vindex printer-name |
| 1722 | You can specify the printer to use by setting the variable | 1654 | @vindex lpr-printer-switch |
| 1723 | @code{printer-name}. | 1655 | To specify the printer to use, set the variable @code{printer-name}. |
| 1656 | The default, @code{nil}, specifies the default printer. If you set it | ||
| 1657 | to a printer name (a string), that name is passed to @command{lpr} | ||
| 1658 | with the @samp{-P} switch; if you are not using @command{lpr}, you | ||
| 1659 | should specify the switch with @code{lpr-printer-switch}. | ||
| 1724 | 1660 | ||
| 1725 | @vindex lpr-headers-switches | 1661 | @vindex lpr-headers-switches |
| 1726 | @vindex lpr-commands | ||
| 1727 | @vindex lpr-add-switches | 1662 | @vindex lpr-add-switches |
| 1728 | The variable @code{lpr-command} specifies the name of the printer | 1663 | The variable @code{lpr-headers-switches} similarly specifies the |
| 1729 | program to run; the default value depends on your operating system type. | 1664 | extra switches to use to make page headers. The variable |
| 1730 | On most systems, the default is @code{"lpr"}. The variable | 1665 | @code{lpr-add-switches} controls whether to supply @samp{-T} and |
| 1731 | @code{lpr-headers-switches} similarly specifies the extra switches to | 1666 | @samp{-J} options (suitable for @command{lpr}) to the printer program: |
| 1732 | use to make page headers. The variable @code{lpr-add-switches} controls | 1667 | @code{nil} means don't add them (this should be the value if your |
| 1733 | whether to supply @samp{-T} and @samp{-J} options (suitable for | 1668 | printer program is not compatible with @command{lpr}). |
| 1734 | @code{lpr}) to the printer program: @code{nil} means don't add them. | ||
| 1735 | @code{lpr-add-switches} should be @code{nil} if your printer program is | ||
| 1736 | not compatible with @code{lpr}. | ||
| 1737 | 1669 | ||
| 1738 | @menu | 1670 | @menu |
| 1739 | * PostScript:: Printing buffers or regions as PostScript. | 1671 | * PostScript:: Printing buffers or regions as PostScript. |
| @@ -1776,28 +1708,17 @@ Generate/print PostScript for the current buffer as if handwritten. | |||
| 1776 | @findex ps-print-buffer | 1708 | @findex ps-print-buffer |
| 1777 | @findex ps-print-region-with-faces | 1709 | @findex ps-print-region-with-faces |
| 1778 | @findex ps-print-buffer-with-faces | 1710 | @findex ps-print-buffer-with-faces |
| 1779 | The PostScript commands, @code{ps-print-buffer} and | 1711 | The @code{ps-print-buffer} and @code{ps-print-region} commands print |
| 1780 | @code{ps-print-region}, print buffer contents in PostScript form. One | 1712 | buffer contents in PostScript form. One command prints the entire |
| 1781 | command prints the entire buffer; the other, just the region. The | 1713 | buffer; the other, just the region. The commands |
| 1782 | corresponding @samp{-with-faces} commands, | 1714 | @code{ps-print-buffer-with-faces} and |
| 1783 | @code{ps-print-buffer-with-faces} and @code{ps-print-region-with-faces}, | 1715 | @code{ps-print-region-with-faces} behave similarly, but use PostScript |
| 1784 | use PostScript features to show the faces (fonts and colors) in the text | 1716 | features to show the faces (fonts and colors) of the buffer text. |
| 1785 | properties of the text being printed. The @samp{-with-faces} commands only | ||
| 1786 | work if they are used in a window system, so it has a way to determine color | ||
| 1787 | values. | ||
| 1788 | 1717 | ||
| 1789 | Interactively, when you use a prefix argument (@kbd{C-u}), the command | 1718 | Interactively, when you use a prefix argument (@kbd{C-u}), the command |
| 1790 | prompts the user for a file name, and saves the PostScript image in that file | 1719 | prompts the user for a file name, and saves the PostScript image in that file |
| 1791 | instead of sending it to the printer. | 1720 | instead of sending it to the printer. |
| 1792 | 1721 | ||
| 1793 | Noninteractively, the argument @var{filename} is treated as follows: if it is | ||
| 1794 | @code{nil}, send the image to the printer. If @var{filename} is a string, save | ||
| 1795 | the PostScript image in a file with that name. | ||
| 1796 | |||
| 1797 | If you are using a color display, you can print a buffer of program | ||
| 1798 | code with color highlighting by turning on Font-Lock mode in that | ||
| 1799 | buffer, and using @code{ps-print-buffer-with-faces}. | ||
| 1800 | |||
| 1801 | @findex ps-spool-region | 1722 | @findex ps-spool-region |
| 1802 | @findex ps-spool-buffer | 1723 | @findex ps-spool-buffer |
| 1803 | @findex ps-spool-region-with-faces | 1724 | @findex ps-spool-region-with-faces |
| @@ -1806,31 +1727,21 @@ buffer, and using @code{ps-print-buffer-with-faces}. | |||
| 1806 | generate the PostScript output in an Emacs buffer instead of sending | 1727 | generate the PostScript output in an Emacs buffer instead of sending |
| 1807 | it to the printer. | 1728 | it to the printer. |
| 1808 | 1729 | ||
| 1809 | Use the command @code{ps-despool} to send the spooled images to the printer. | ||
| 1810 | |||
| 1811 | @findex ps-despool | 1730 | @findex ps-despool |
| 1812 | This command sends the PostScript generated by @samp{-spool-} commands (see | 1731 | Use the command @code{ps-despool} to send the spooled images to the |
| 1813 | commands above) to the printer. | 1732 | printer. This command sends the PostScript generated by |
| 1814 | 1733 | @samp{-spool-} commands (see commands above) to the printer. With a | |
| 1815 | Interactively, when you use a prefix argument (@kbd{C-u}), the command | 1734 | prefix argument (@kbd{C-u}), it prompts for a file name, and saves the |
| 1816 | prompts the user for a file name, and saves the spooled PostScript image in | 1735 | spooled PostScript image in that file instead of sending it to the |
| 1817 | that file instead of sending it to the printer. | 1736 | printer. |
| 1818 | |||
| 1819 | Noninteractively, the argument @var{filename} is treated as follows: if it is | ||
| 1820 | @code{nil}, send the image to the printer. If @var{filename} is a string, save | ||
| 1821 | the PostScript image in a file with that name. | ||
| 1822 | 1737 | ||
| 1823 | @findex handwrite | 1738 | @findex handwrite |
| 1824 | @cindex handwriting | 1739 | @cindex handwriting |
| 1825 | @kbd{M-x handwrite} is more frivolous. It generates a PostScript | 1740 | @kbd{M-x handwrite} is more frivolous. It generates a PostScript |
| 1826 | rendition of the current buffer as a cursive handwritten document. It | 1741 | rendition of the current buffer as a cursive handwritten document. It |
| 1827 | can be customized in group @code{handwrite}. This function only | 1742 | can be customized in group @code{handwrite}. This function only |
| 1828 | supports ISO 8859-1 characters. | 1743 | supports ISO 8859-1 characters. |
| 1829 | 1744 | ||
| 1830 | @ifnottex | ||
| 1831 | The following section describes variables for customizing these commands. | ||
| 1832 | @end ifnottex | ||
| 1833 | |||
| 1834 | @node PostScript Variables, Printing Package, PostScript, Printing | 1745 | @node PostScript Variables, Printing Package, PostScript, Printing |
| 1835 | @subsection Variables for PostScript Hardcopy | 1746 | @subsection Variables for PostScript Hardcopy |
| 1836 | 1747 | ||
| @@ -2379,26 +2290,8 @@ key bindings. | |||
| 2379 | @node Hyperlinking, Amusements, Emulation, Top | 2290 | @node Hyperlinking, Amusements, Emulation, Top |
| 2380 | @section Hyperlinking and Navigation Features | 2291 | @section Hyperlinking and Navigation Features |
| 2381 | 2292 | ||
| 2382 | @cindex hyperlinking | 2293 | The following subsections describe convenience features for handling |
| 2383 | @cindex navigation | 2294 | URLs and other types of links occurring in Emacs buffer text. |
| 2384 | Various modes documented elsewhere have hypertext features so that | ||
| 2385 | you can follow links, usually by clicking @kbd{Mouse-2} on the link or | ||
| 2386 | typing @key{RET} while point is on the link. Clicking @kbd{Mouse-1} | ||
| 2387 | quickly on the link also follows it. (Hold @kbd{Mouse-1} for longer | ||
| 2388 | if you want to set point instead.) | ||
| 2389 | |||
| 2390 | Info mode, Help mode and the Dired-like modes are examples of modes | ||
| 2391 | that have links in the buffer. The Tags facility links between uses | ||
| 2392 | and definitions in source files, see @ref{Tags}. Imenu provides | ||
| 2393 | navigation amongst items indexed in the current buffer, see | ||
| 2394 | @ref{Imenu}. Info-lookup provides mode-specific lookup of definitions | ||
| 2395 | in Info indexes, see @ref{Documentation}. Speedbar maintains a frame | ||
| 2396 | in which links to files, and locations in files are displayed, see | ||
| 2397 | @ref{Speedbar}. | ||
| 2398 | |||
| 2399 | Other non-mode-specific facilities described in this section enable | ||
| 2400 | following links from the current buffer in a context-sensitive | ||
| 2401 | fashion. | ||
| 2402 | 2295 | ||
| 2403 | @menu | 2296 | @menu |
| 2404 | * Browse-URL:: Following URLs. | 2297 | * Browse-URL:: Following URLs. |
| @@ -2421,31 +2314,31 @@ fashion. | |||
| 2421 | Load a URL into a Web browser. | 2314 | Load a URL into a Web browser. |
| 2422 | @end table | 2315 | @end table |
| 2423 | 2316 | ||
| 2424 | The Browse-URL package provides facilities for following URLs specifying | 2317 | The Browse-URL package allows you to easily follow URLs from within |
| 2425 | links on the World Wide Web. Usually this works by invoking a web | 2318 | Emacs. Most URLs are followed by invoking a web browser; |
| 2426 | browser, but you can, for instance, arrange to invoke @code{compose-mail} | 2319 | @samp{mailto:} URLs are followed by invoking the @code{compose-mail} |
| 2427 | from @samp{mailto:} URLs. | 2320 | Emacs command to send mail to the specified address (@pxref{Sending |
| 2321 | Mail}). | ||
| 2428 | 2322 | ||
| 2429 | The general way to use this feature is to type @kbd{M-x browse-url}, | 2323 | The command @kbd{M-x browse-url} prompts for a URL, and follows it. |
| 2430 | which displays a specified URL. If point is located near a plausible | 2324 | If point is located near a plausible URL, that URL is offered as the |
| 2431 | URL, that URL is used as the default. Other commands are available | 2325 | default. The Browse-URL package also provides other commands which |
| 2432 | which you might like to bind to keys, such as | 2326 | you might like to bind to keys, such as @code{browse-url-at-point} and |
| 2433 | @code{browse-url-at-point} and @code{browse-url-at-mouse}. | 2327 | @code{browse-url-at-mouse}. |
| 2434 | 2328 | ||
| 2329 | @vindex browse-url-mailto-function | ||
| 2435 | @vindex browse-url-browser-function | 2330 | @vindex browse-url-browser-function |
| 2436 | You can customize Browse-URL's behavior via various options in the | 2331 | You can customize Browse-URL's behavior via various options in the |
| 2437 | @code{browse-url} Customize group, particularly | 2332 | @code{browse-url} Customize group. In particular, the option |
| 2438 | @code{browse-url-browser-function}. You can invoke actions dependent | 2333 | @code{browse-url-mailto-function} lets you define how to follow |
| 2439 | on the type of URL by defining @code{browse-url-browser-function} as | 2334 | @samp{mailto:} URLs, while @code{browse-url-browser-function} lets you |
| 2440 | an association list. The package's commentary available via @kbd{C-h | 2335 | define how to follow other types of URLs. For more information, view |
| 2441 | p} under the @samp{hypermedia} keyword provides more information. | 2336 | the package commentary by typing @kbd{C-h P browse-url @key{RET}}. |
| 2442 | Packages with facilities for following URLs should always go through | ||
| 2443 | Browse-URL, so that the customization options for Browse-URL will | ||
| 2444 | affect all browsing in Emacs. | ||
| 2445 | 2337 | ||
| 2446 | @node Goto Address mode | 2338 | @node Goto Address mode |
| 2447 | @subsection Activating URLs | 2339 | @subsection Activating URLs |
| 2448 | @findex goto-address-mode | 2340 | @findex goto-address-mode |
| 2341 | @cindex mode, Goto Address | ||
| 2449 | @cindex Goto Address mode | 2342 | @cindex Goto Address mode |
| 2450 | @cindex URLs, activating | 2343 | @cindex URLs, activating |
| 2451 | 2344 | ||
| @@ -2454,20 +2347,23 @@ affect all browsing in Emacs. | |||
| 2454 | Activate URLs and e-mail addresses in the current buffer. | 2347 | Activate URLs and e-mail addresses in the current buffer. |
| 2455 | @end table | 2348 | @end table |
| 2456 | 2349 | ||
| 2457 | You can make URLs in the current buffer active with @kbd{M-x | 2350 | @kindex C-c RET @r{(Goto Address mode)} |
| 2458 | goto-address-mode}. This minor mode finds all the URLs in the buffer, | 2351 | @findex goto-address-at-point |
| 2459 | highlights them, and turns them into @dfn{buttons}: if you click on a | 2352 | You can make Emacs mark out URLs specially in the current buffer, by |
| 2460 | URL with @kbd{Mouse-1} or @kbd{Mouse-2} (@pxref{Mouse References}), or | 2353 | typing @kbd{M-x goto-address-mode}. When this buffer-local minor mode |
| 2461 | move to the URL and type @kbd{C-c @key{RET}}, that displays the web | 2354 | is enabled, it finds all the URLs in the buffer, highlights them, and |
| 2462 | page that the URL specifies. For a @samp{mailto} URL, it sends mail | 2355 | turns them into clickable buttons. You can follow the URL by typing |
| 2463 | instead, using your selected mail-composition method (@pxref{Mail | 2356 | @kbd{C-c @key{RET}} (@code{goto-address-at-point}) while point is on |
| 2464 | Methods}). | 2357 | its text; or by clicking with @kbd{Mouse-2}, or by clicking |
| 2358 | @kbd{Mouse-1} quickly (@pxref{Mouse References}). Following a URL is | ||
| 2359 | done by calling @code{browse-url} as a subroutine | ||
| 2360 | (@pxref{Browse-URL}). | ||
| 2465 | 2361 | ||
| 2466 | It can be useful to add @code{goto-address-mode} to mode hooks and | 2362 | It can be useful to add @code{goto-address-mode} to mode hooks and |
| 2467 | the hooks used to display an incoming message (e.g., | 2363 | hooks for displaying an incoming message |
| 2468 | @code{rmail-show-message-hook} for Rmail, and @code{mh-show-mode-hook} | 2364 | (e.g.@: @code{rmail-show-message-hook} for Rmail, and |
| 2469 | for MH-E). This is not needed for Gnus, which has a similar feature | 2365 | @code{mh-show-mode-hook} for MH-E). This is not needed for Gnus, |
| 2470 | of its own. | 2366 | which has a similar feature of its own. |
| 2471 | 2367 | ||
| 2472 | @node FFAP | 2368 | @node FFAP |
| 2473 | @subsection Finding Files and URLs at Point | 2369 | @subsection Finding Files and URLs at Point |
| @@ -2478,24 +2374,24 @@ of its own. | |||
| 2478 | @findex ffap-menu | 2374 | @findex ffap-menu |
| 2479 | @cindex finding file at point | 2375 | @cindex finding file at point |
| 2480 | 2376 | ||
| 2481 | FFAP mode replaces certain key bindings for finding files, including | 2377 | The FFAP package replaces certain key bindings for finding files, |
| 2482 | @kbd{C-x C-f}, with commands that provide more sensitive defaults. | 2378 | such as @kbd{C-x C-f}, with commands that provide more sensitive |
| 2483 | These commands behave like the ordinary ones when given a prefix | 2379 | defaults. These commands behave like the ordinary ones when given a |
| 2484 | argument. Otherwise, they get the default file name or URL from the | 2380 | prefix argument. Otherwise, they get the default file name or URL |
| 2485 | text around point. If what is found in the buffer has the form of a | 2381 | from the text around point. If what is found in the buffer has the |
| 2486 | URL rather than a file name, the commands use @code{browse-url} to | 2382 | form of a URL rather than a file name, the commands use |
| 2487 | view it. | 2383 | @code{browse-url} to view it (@pxref{Browse-URL}). |
| 2488 | 2384 | ||
| 2489 | This feature is useful for following references in mail or news | 2385 | This feature is useful for following references in mail or news |
| 2490 | buffers, @file{README} files, @file{MANIFEST} files, and so on. The | 2386 | buffers, @file{README} files, @file{MANIFEST} files, and so on. For |
| 2491 | @samp{ffap} package's commentary available via @kbd{C-h p} under the | 2387 | more information, view the package commentary by typing @kbd{C-h P |
| 2492 | @samp{files} keyword and the @code{ffap} Custom group provide details. | 2388 | ffap @key{RET}}. |
| 2493 | 2389 | ||
| 2494 | @cindex FFAP minor mode | 2390 | @cindex FFAP minor mode |
| 2495 | @findex ffap-mode | 2391 | @findex ffap-mode |
| 2496 | You can turn on FFAP minor mode by calling @code{ffap-bindings} to | 2392 | To enable FFAP, type @kbd{M-x ffap-bindings}. This makes the |
| 2497 | make the following key bindings and to install hooks for using | 2393 | following key bindings, and also installs hooks for additional FFAP |
| 2498 | @code{ffap} in Rmail, Gnus and VM article buffers. | 2394 | functionality in Rmail, Gnus and VM article buffers. |
| 2499 | 2395 | ||
| 2500 | @table @kbd | 2396 | @table @kbd |
| 2501 | @item C-x C-f @var{filename} @key{RET} | 2397 | @item C-x C-f @var{filename} @key{RET} |
| @@ -2604,18 +2500,22 @@ bored, try an argument of 9. Sit back and watch. | |||
| 2604 | @cindex Life | 2500 | @cindex Life |
| 2605 | @kbd{M-x life} runs Conway's ``Life'' cellular automaton. | 2501 | @kbd{M-x life} runs Conway's ``Life'' cellular automaton. |
| 2606 | 2502 | ||
| 2607 | @findex lm | 2503 | @findex landmark |
| 2608 | @cindex landmark game | 2504 | @cindex landmark game |
| 2609 | @kbd{M-x lm} runs a relatively non-participatory game in which a | 2505 | @kbd{M-x landmark} runs a relatively non-participatory game in which |
| 2610 | robot attempts to maneuver towards a tree at the center of the window | 2506 | a robot attempts to maneuver towards a tree at the center of the |
| 2611 | based on unique olfactory cues from each of the four directions. | 2507 | window based on unique olfactory cues from each of the four |
| 2508 | directions. | ||
| 2612 | 2509 | ||
| 2613 | @findex morse-region | 2510 | @findex morse-region |
| 2614 | @findex unmorse-region | 2511 | @findex unmorse-region |
| 2512 | @findex nato-region | ||
| 2615 | @cindex Morse code | 2513 | @cindex Morse code |
| 2616 | @cindex --/---/.-./.../. | 2514 | @cindex --/---/.-./.../. |
| 2617 | @kbd{M-x morse-region} converts text in a region to Morse code and | 2515 | @kbd{M-x morse-region} converts the text in the region to Morse |
| 2618 | @kbd{M-x unmorse-region} converts it back. No cause for remorse. | 2516 | code; @kbd{M-x unmorse-region} converts it back. @kbd{M-x |
| 2517 | nato-region} converts the text in the region to NATO phonetic | ||
| 2518 | alphabet; @kbd{M-x denato-region} converts it back. | ||
| 2619 | 2519 | ||
| 2620 | @findex pong | 2520 | @findex pong |
| 2621 | @cindex Pong game | 2521 | @cindex Pong game |
| @@ -2635,9 +2535,11 @@ across other pegs. | |||
| 2635 | The command @kbd{M-x zone} plays games with the display when Emacs | 2535 | The command @kbd{M-x zone} plays games with the display when Emacs |
| 2636 | is idle. | 2536 | is idle. |
| 2637 | 2537 | ||
| 2638 | Finally, if you find yourself frustrated, try the famous Eliza | 2538 | @findex doctor |
| 2639 | program. Just do @kbd{M-x doctor}. End each input by typing | 2539 | @cindex Eliza |
| 2640 | @key{RET} twice. | 2540 | Finally, if you find yourself frustrated, try describing your |
| 2541 | problems to the famous psychotherapist Eliza. Just do @kbd{M-x | ||
| 2542 | doctor}. End each input by typing @key{RET} twice. | ||
| 2641 | 2543 | ||
| 2642 | @ifnottex | 2544 | @ifnottex |
| 2643 | @lowersections | 2545 | @lowersections |
| @@ -566,6 +566,7 @@ region (or with the left margin if there is no previous line). | |||
| 566 | +++ | 566 | +++ |
| 567 | ** Archive Mode has basic support for browsing and updating 7z archives. | 567 | ** Archive Mode has basic support for browsing and updating 7z archives. |
| 568 | 568 | ||
| 569 | +++ | ||
| 569 | ** browse-url has a new variable `browse-url-mailto-function' | 570 | ** browse-url has a new variable `browse-url-mailto-function' |
| 570 | specifies how mailto: URLs are handled. The default is `browse-url-mail'. | 571 | specifies how mailto: URLs are handled. The default is `browse-url-mail'. |
| 571 | 572 | ||
| @@ -692,7 +693,7 @@ utf-8, and do the normal `undecided' decoding for the rest. | |||
| 692 | exists, that is used instead. | 693 | exists, that is used instead. |
| 693 | 694 | ||
| 694 | ** gdb-mi | 695 | ** gdb-mi |
| 695 | 696 | +++ | |
| 696 | *** GDB User Interface migrated to GDB Machine Interface and now | 697 | *** GDB User Interface migrated to GDB Machine Interface and now |
| 697 | supports multithread non-stop debugging and debugging of several | 698 | supports multithread non-stop debugging and debugging of several |
| 698 | threads simultaneously. | 699 | threads simultaneously. |
| @@ -718,6 +719,7 @@ handy if you have many manuals in many Info buffers, and don't | |||
| 718 | remember the name of the buffer visiting the manual you want to | 719 | remember the name of the buffer visiting the manual you want to |
| 719 | consult. | 720 | consult. |
| 720 | 721 | ||
| 722 | +++ | ||
| 721 | ** The Landmark game is now invoked with `landmark', not `lm'. | 723 | ** The Landmark game is now invoked with `landmark', not `lm'. |
| 722 | 724 | ||
| 723 | ** MH-E has been upgraded to MH-E version 8.3.1. | 725 | ** MH-E has been upgraded to MH-E version 8.3.1. |
| @@ -742,9 +744,9 @@ This change was made in Emacs 23.1 but was not advertised at the time. | |||
| 742 | Try using `rmail-show-message-hook' instead. | 744 | Try using `rmail-show-message-hook' instead. |
| 743 | 745 | ||
| 744 | ** Shell mode | 746 | ** Shell mode |
| 745 | 747 | +++ | |
| 746 | *** Shell mode uses pcomplete rules, with the standard completion UI. | 748 | *** Shell mode uses pcomplete rules, with the standard completion UI. |
| 747 | 749 | +++ | |
| 748 | *** The `shell' command prompts for the shell path name if the default | 750 | *** The `shell' command prompts for the shell path name if the default |
| 749 | directory is a remote file name and neither the environment variable | 751 | directory is a remote file name and neither the environment variable |
| 750 | $ESHELL nor the variable `explicit-shell-file-name' is set. | 752 | $ESHELL nor the variable `explicit-shell-file-name' is set. |
| @@ -898,6 +900,7 @@ They are superseded by shift-select-mode enabled by default in 23.1. | |||
| 898 | --- | 900 | --- |
| 899 | *** `copyright-fix-years' can optionally convert consecutive years to ranges. | 901 | *** `copyright-fix-years' can optionally convert consecutive years to ranges. |
| 900 | 902 | ||
| 903 | +++ | ||
| 901 | *** New command `nato-region' converts text to NATO phonetic alphabet. | 904 | *** New command `nato-region' converts text to NATO phonetic alphabet. |
| 902 | 905 | ||
| 903 | 906 | ||