comparison man/misc.texi @ 29107:203ba1f77b7b

*** empty log message ***
author Gerd Moellmann <gerd@gnu.org>
date Tue, 23 May 2000 11:12:04 +0000
parents 17c7b5770672
children c17c1380a43d
comparison
equal deleted inserted replaced
29106:a0dc7fa92f5d 29107:203ba1f77b7b
368 returns the command's exit status when it is called from a Lisp program. 368 returns the command's exit status when it is called from a Lisp program.
369 369
370 @vindex shell-file-name 370 @vindex shell-file-name
371 @cindex environment 371 @cindex environment
372 Both @kbd{M-!} and @kbd{M-|} use @code{shell-file-name} to specify the 372 Both @kbd{M-!} and @kbd{M-|} use @code{shell-file-name} to specify the
373 shell to use. This variable is initialized based on your @code{SHELL} 373 shell to use. This variable is initialized based on your @env{SHELL}
374 environment variable when Emacs is started. If the file name does not 374 environment variable when Emacs is started. If the file name does not
375 specify a directory, the directories in the list @code{exec-path} are 375 specify a directory, the directories in the list @code{exec-path} are
376 searched; this list is initialized based on the environment variable 376 searched; this list is initialized based on the environment variable
377 @code{PATH} when Emacs is started. Your @file{.emacs} file can override 377 @env{PATH} when Emacs is started. Your @file{.emacs} file can override
378 either or both of these default initializations.@refill 378 either or both of these default initializations.@refill
379 379
380 Both @kbd{M-!} and @kbd{M-|} wait for the shell command to complete. 380 Both @kbd{M-!} and @kbd{M-|} wait for the shell command to complete.
381 To stop waiting, type @kbd{C-g} to quit; that terminates the shell 381 To stop waiting, type @kbd{C-g} to quit; that terminates the shell
382 command with the signal @code{SIGINT}---the same signal that @kbd{C-c} 382 command with the signal @code{SIGINT}---the same signal that @kbd{C-c}
417 shell} again to create a new buffer @samp{*shell*} with its own 417 shell} again to create a new buffer @samp{*shell*} with its own
418 subshell. If you rename this buffer as well, you can create a third 418 subshell. If you rename this buffer as well, you can create a third
419 one, and so on. All the subshells run independently and in parallel. 419 one, and so on. All the subshells run independently and in parallel.
420 420
421 @vindex explicit-shell-file-name 421 @vindex explicit-shell-file-name
422 @cindex @code{ESHELL} environment variable 422 @cindex @env{ESHELL} environment variable
423 @cindex @code{SHELL} environment variable 423 @cindex @env{SHELL} environment variable
424 The file name used to load the subshell is the value of the variable 424 The file name used to load the subshell is the value of the variable
425 @code{explicit-shell-file-name}, if that is non-@code{nil}. Otherwise, 425 @code{explicit-shell-file-name}, if that is non-@code{nil}. Otherwise,
426 the environment variable @code{ESHELL} is used, or the environment 426 the environment variable @env{ESHELL} is used, or the environment
427 variable @code{SHELL} if there is no @code{ESHELL}. If the file name 427 variable @env{SHELL} if there is no @env{ESHELL}. If the file name
428 specified is relative, the directories in the list @code{exec-path} are 428 specified is relative, the directories in the list @code{exec-path} are
429 searched; this list is initialized based on the environment variable 429 searched; this list is initialized based on the environment variable
430 @code{PATH} when Emacs is started. Your @file{.emacs} file can override 430 @env{PATH} when Emacs is started. Your @file{.emacs} file can override
431 either or both of these default initializations. 431 either or both of these default initializations.
432 432
433 To specify a coding system for the shell, you can use the command 433 To specify a coding system for the shell, you can use the command
434 @kbd{C-x @key{RET} c} immediately before @kbd{M-x shell}. You can also 434 @kbd{C-x @key{RET} c} immediately before @kbd{M-x shell}. You can also
435 specify a coding system after starting the shell by using @kbd{C-x 435 specify a coding system after starting the shell by using @kbd{C-x
471 @findex dirtrack-mode 471 @findex dirtrack-mode
472 You can also use @kbd{M-x dirtrack-mode} to enable (or disable) an 472 You can also use @kbd{M-x dirtrack-mode} to enable (or disable) an
473 alternative and more aggressive method of tracking changes in the 473 alternative and more aggressive method of tracking changes in the
474 current directory. 474 current directory.
475 475
476 Emacs defines the environment variable @code{EMACS} in the subshell, 476 Emacs defines the environment variable @env{EMACS} in the subshell,
477 with value @code{t}. A shell script can check this variable to 477 with value @code{t}. A shell script can check this variable to
478 determine whether it has been run from an Emacs subshell. 478 determine whether it has been run from an Emacs subshell.
479 479
480 @node Shell Mode 480 @node Shell Mode
481 @subsection Shell Mode 481 @subsection Shell Mode
1030 When you log in to a different machine, you need to specify the 1030 When you log in to a different machine, you need to specify the
1031 type of terminal your using. Terminal types @samp{ansi} 1031 type of terminal your using. Terminal types @samp{ansi}
1032 or @samp{vt100} will work on most systems. 1032 or @samp{vt100} will work on most systems.
1033 1033
1034 @c If you are talking to a Bourne-compatible 1034 @c If you are talking to a Bourne-compatible
1035 @c shell, and your system understands the @code{TERMCAP} variable, 1035 @c shell, and your system understands the @env{TERMCAP} variable,
1036 @c you can use the command @kbd{M-x shell-send-termcap}, which 1036 @c you can use the command @kbd{M-x shell-send-termcap}, which
1037 @c sends a string specifying the terminal type and size. 1037 @c sends a string specifying the terminal type and size.
1038 @c (This command is also useful after the window has changed size.) 1038 @c (This command is also useful after the window has changed size.)
1039 1039
1040 @c You can of course run @samp{gdb} on that remote computer. One useful 1040 @c You can of course run @samp{gdb} on that remote computer. One useful
1094 @node Emacs Server, Hardcopy, Shell, Top 1094 @node Emacs Server, Hardcopy, Shell, Top
1095 @section Using Emacs as a Server 1095 @section Using Emacs as a Server
1096 @pindex emacsclient 1096 @pindex emacsclient
1097 @cindex Emacs as a server 1097 @cindex Emacs as a server
1098 @cindex server, using Emacs as 1098 @cindex server, using Emacs as
1099 @cindex @code{EDITOR} environment variable 1099 @cindex @env{EDITOR} environment variable
1100 1100
1101 Various programs such as @code{mail} can invoke your choice of editor 1101 Various programs such as @code{mail} can invoke your choice of editor
1102 to edit a particular piece of text, such as a message that you are 1102 to edit a particular piece of text, such as a message that you are
1103 sending. By convention, most of these programs use the environment 1103 sending. By convention, most of these programs use the environment
1104 variable @code{EDITOR} to specify which editor to run. If you set 1104 variable @env{EDITOR} to specify which editor to run. If you set
1105 @code{EDITOR} to @samp{emacs}, they invoke Emacs---but in an 1105 @env{EDITOR} to @samp{emacs}, they invoke Emacs---but in an
1106 inconvenient fashion, by starting a new, separate Emacs process. This 1106 inconvenient fashion, by starting a new, separate Emacs process. This
1107 is inconvenient because it takes time and because the new Emacs process 1107 is inconvenient because it takes time and because the new Emacs process
1108 doesn't share the buffers in the existing Emacs process. 1108 doesn't share the buffers in the existing Emacs process.
1109 1109
1110 You can arrange to use your existing Emacs process as the editor for 1110 You can arrange to use your existing Emacs process as the editor for
1111 programs like @code{mail} by using the Emacs client and Emacs server 1111 programs like @code{mail} by using the Emacs client and Emacs server
1112 programs. Here is how. 1112 programs. Here is how.
1113 1113
1114 @cindex @code{TEXEDIT} environment variable 1114 @cindex @env{TEXEDIT} environment variable
1115 First, the preparation. Within Emacs, call the function 1115 First, the preparation. Within Emacs, call the function
1116 @code{server-start}. (Your @file{.emacs} file can do this automatically 1116 @code{server-start}. (Your @file{.emacs} file can do this automatically
1117 if you add the expression @code{(server-start)} to it.) Then, outside 1117 if you add the expression @code{(server-start)} to it.) Then, outside
1118 Emacs, set the @code{EDITOR} environment variable to @samp{emacsclient}. 1118 Emacs, set the @env{EDITOR} environment variable to @samp{emacsclient}.
1119 (Note that some programs use a different environment variable; for 1119 (Note that some programs use a different environment variable; for
1120 example, to make @TeX{} use @samp{emacsclient}, you should set the 1120 example, to make @TeX{} use @samp{emacsclient}, you should set the
1121 @code{TEXEDIT} environment variable to @samp{emacsclient +%d %s}.) 1121 @env{TEXEDIT} environment variable to @samp{emacsclient +%d %s}.)
1122 1122
1123 @kindex C-x # 1123 @kindex C-x #
1124 @findex server-edit 1124 @findex server-edit
1125 Then, whenever any program invokes your specified @code{EDITOR} 1125 Then, whenever any program invokes your specified @env{EDITOR}
1126 program, the effect is to send a message to your principal Emacs telling 1126 program, the effect is to send a message to your principal Emacs telling
1127 it to visit a file. (That's what the program @code{emacsclient} does.) 1127 it to visit a file. (That's what the program @code{emacsclient} does.)
1128 Emacs displays the buffer immediately and you can immediately begin 1128 Emacs displays the buffer immediately and you can immediately begin
1129 editing it. 1129 editing it.
1130 1130
1131 When you've finished editing that buffer, type @kbd{C-x #} 1131 When you've finished editing that buffer, type @kbd{C-x #}
1132 (@code{server-edit}). This saves the file and sends a message back to 1132 (@code{server-edit}). This saves the file and sends a message back to
1133 the @code{emacsclient} program telling it to exit. The programs that 1133 the @code{emacsclient} program telling it to exit. The programs that
1134 use @code{EDITOR} wait for the ``editor'' (actually, @code{emacsclient}) 1134 use @env{EDITOR} wait for the ``editor'' (actually, @code{emacsclient})
1135 to exit. @kbd{C-x #} also checks for other pending external requests 1135 to exit. @kbd{C-x #} also checks for other pending external requests
1136 to edit various files, and selects the next such file. 1136 to edit various files, and selects the next such file.
1137 1137
1138 You can switch to a server buffer manually if you wish; you don't have 1138 You can switch to a server buffer manually if you wish; you don't have
1139 to arrive at it with @kbd{C-x #}. But @kbd{C-x #} is the only way to 1139 to arrive at it with @kbd{C-x #}. But @kbd{C-x #} is the only way to