aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2006-12-08 17:02:57 +0000
committerEli Zaretskii2006-12-08 17:02:57 +0000
commitd9d81805f77d23cec92e01470810e58de958efce (patch)
tree51d3732c2dbd1e837dd21a5a6498e68d0d8b3109
parentefe230277ff3df8974d9b442e76902bc1a78f49a (diff)
downloademacs-d9d81805f77d23cec92e01470810e58de958efce.tar.gz
emacs-d9d81805f77d23cec92e01470810e58de958efce.zip
(Emacs Server): Improve wording. Don't mention the ``server program''.
Add a cross-reference to "Init File" node. (Invoking emacsclient): Add index entries. Document both short and long versions of command-line options. Document the -f option.
-rw-r--r--man/ChangeLog7
-rw-r--r--man/misc.texi91
2 files changed, 67 insertions, 31 deletions
diff --git a/man/ChangeLog b/man/ChangeLog
index bfbcffd0784..2698750e72a 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,10 @@
12006-12-08 Eli Zaretskii <eliz@gnu.org>
2
3 * misc.texi (Emacs Server): Improve wording. Don't mention the
4 ``server program''. Add a cross-reference to "Init File" node.
5 (Invoking emacsclient): Add index entries. Document both short and
6 long versions of command-line options. Document the -f option.
7
12006-12-08 Michael Olson <mwolson@gnu.org> 82006-12-08 Michael Olson <mwolson@gnu.org>
2 9
3 * erc.texi (Modules): Remove documentation for list module. 10 * erc.texi (Modules): Remove documentation for list module.
diff --git a/man/misc.texi b/man/misc.texi
index da8c3179b91..ae92ed6095d 100644
--- a/man/misc.texi
+++ b/man/misc.texi
@@ -1244,28 +1244,36 @@ variable @env{EDITOR} to specify which editor to run. If you set
1244@env{EDITOR} to @samp{emacs}, they invoke Emacs---but in an 1244@env{EDITOR} to @samp{emacs}, they invoke Emacs---but in an
1245inconvenient fashion, by starting a new, separate Emacs process. This 1245inconvenient fashion, by starting a new, separate Emacs process. This
1246is inconvenient because it takes time and because the new Emacs process 1246is inconvenient because it takes time and because the new Emacs process
1247doesn't share the buffers in any existing Emacs process. 1247doesn't share the buffers with any existing Emacs process.
1248 1248
1249 You can arrange to use your existing Emacs process as the editor for 1249 You can arrange to use your existing Emacs process as the editor for
1250programs like @code{mail} by using the Emacs client and Emacs server 1250programs like @code{mail} by using the Emacs client program and the
1251programs. Here is how. 1251server that is part of Emacs. Here is how.
1252 1252
1253@cindex @env{TEXEDIT} environment variable 1253@cindex @env{TEXEDIT} environment variable
1254 First, the preparation. Within Emacs, call the function 1254@findex server-start
1255@code{server-start}. (Your @file{.emacs} file can do this automatically 1255 First, the preparations. Within Emacs, call the function
1256if you add the expression @code{(server-start)} to it.) Then, outside 1256@code{server-start}. (Your @file{.emacs} init file can do this
1257Emacs, set the @env{EDITOR} environment variable to @samp{emacsclient}. 1257automatically if you add the expression @code{(server-start)} to it,
1258(Note that some programs use a different environment variable; for 1258see @ref{Init File}.) Then, outside Emacs, set the @env{EDITOR}
1259example, to make @TeX{} use @samp{emacsclient}, you should set the 1259environment variable to @samp{emacsclient}. (Note that some programs
1260@env{TEXEDIT} environment variable to @samp{emacsclient +%d %s}.) 1260use a different environment variable; for example, to make @TeX{} use
1261@samp{emacsclient}, you should set the @env{TEXEDIT} environment
1262variable to @samp{emacsclient +%d %s}.)
1263
1264@pindex emacs.bash
1265@cindex Bash command to use Emacs server
1266 As an alternative to using @code{emacsclient}, the file
1267@file{etc/emacs.bash} defines a Bash command @code{edit} which will
1268communicate with a running Emacs session, or start one if none exist.
1261 1269
1262@kindex C-x # 1270@kindex C-x #
1263@findex server-edit 1271@findex server-edit
1264 Then, whenever any program invokes your specified @env{EDITOR} 1272 Now, whenever any program invokes your specified @env{EDITOR}
1265program, the effect is to send a message to your principal Emacs telling 1273program, the effect is to send a message to your principal Emacs telling
1266it to visit a file. (That's what the program @code{emacsclient} does.) 1274it to visit a file. (That's what the program @code{emacsclient} does.)
1267Emacs displays the buffer immediately and you can immediately begin 1275Emacs displays the buffer immediately and you can immediately begin
1268editing it. 1276editing it in the already running Emacs session.
1269 1277
1270 When you've finished editing that buffer, type @kbd{C-x #} 1278 When you've finished editing that buffer, type @kbd{C-x #}
1271(@code{server-edit}). This saves the file and sends a message back to 1279(@code{server-edit}). This saves the file and sends a message back to
@@ -1297,8 +1305,8 @@ kills it if the file name matches the regular expression
1297each one a unique ``server name'', using the variable 1305each one a unique ``server name'', using the variable
1298@code{server-name}. For example, @kbd{M-x set-variable @key{RET} 1306@code{server-name}. For example, @kbd{M-x set-variable @key{RET}
1299server-name @key{RET} foo @key{RET}} sets the server name to 1307server-name @key{RET} foo @key{RET}} sets the server name to
1300@samp{foo}. The @code{emacsclient} program can visit a server by name 1308@samp{foo}. The @code{emacsclient} program can specify a server by
1301using the @samp{-s} option. @xref{Invoking emacsclient}. 1309name using the @samp{-s} option. @xref{Invoking emacsclient}.
1302 1310
1303 While @code{mail} or another application is waiting for 1311 While @code{mail} or another application is waiting for
1304@code{emacsclient} to finish, @code{emacsclient} does not read terminal 1312@code{emacsclient} to finish, @code{emacsclient} does not read terminal
@@ -1335,6 +1343,7 @@ automatically when you finish with them.
1335 1343
1336@node Invoking emacsclient,, Emacs Server, Emacs Server 1344@node Invoking emacsclient,, Emacs Server, Emacs Server
1337@subsection Invoking @code{emacsclient} 1345@subsection Invoking @code{emacsclient}
1346@cindex @code{emacsclient} invocation and options
1338 1347
1339 To run the @code{emacsclient} program, specify file names as arguments, 1348 To run the @code{emacsclient} program, specify file names as arguments,
1340and optionally line numbers as well, like this: 1349and optionally line numbers as well, like this:
@@ -1363,37 +1372,57 @@ a client buffer, the next client buffer is automatically selected.
1363@code{emacsclient}, then it returns immediately. (You can take as 1372@code{emacsclient}, then it returns immediately. (You can take as
1364long as you like to edit the files in Emacs.) 1373long as you like to edit the files in Emacs.)
1365 1374
1366 The option @samp{--alternate-editor=@var{command}} specifies a 1375 The option @samp{-a @var{command}} or
1367command to run if @code{emacsclient} fails to contact Emacs. This is 1376@samp{--alternate-editor=@var{command}} specifies a command to run if
1368useful when running @code{emacsclient} in a script. For example, the 1377@code{emacsclient} fails to contact Emacs. This is useful when
1369following setting for the @env{EDITOR} environment variable will 1378running @code{emacsclient} in a script. For example, the following
1370always give you an editor, even if no Emacs server is running: 1379setting for the @env{EDITOR} environment variable will always give you
1380an editor, even if no Emacs server is running:
1371 1381
1372@example 1382@example
1373EDITOR="emacsclient --alternate-editor emacs +%d %s" 1383EDITOR="emacsclient --alternate-editor emacs +%d %s"
1374@end example 1384@end example
1375 1385
1376@noindent 1386@noindent
1387@cindex @env{ALTERNATE_EDITOR} environment variable
1377The environment variable @env{ALTERNATE_EDITOR} has the same effect, with 1388The environment variable @env{ALTERNATE_EDITOR} has the same effect, with
1378the value of the @samp{--alternate-editor} option taking precedence. 1389the value of the @samp{--alternate-editor} option taking precedence.
1379 1390
1380@pindex emacs.bash
1381 Alternatively, the file @file{etc/emacs.bash} defines a bash
1382function which will communicate with a running Emacs server, or start
1383one if none exists.
1384
1385If you use several displays, you can tell Emacs on which display to 1391If you use several displays, you can tell Emacs on which display to
1386open the given files with the option @samp{--display=@var{DISPLAY}}. 1392open the given files with the @samp{-d @var{display}} or
1387This can be used typically when connecting from home to an Emacs 1393@samp{--display=@var{display}} option to @code{emacsclient}. This is
1388server running on your machine at your workplace. 1394handy when connecting from home to an Emacs session running on your
1395machine at your workplace.
1389 1396
1390If there is more than one Emacs server running, you can specify a 1397If there is more than one Emacs server running, you can specify a
1391server name with the option @samp{-s @var{name}}. 1398server name with the @samp{-s @var{name}} or
1399@samp{--socket-name=@var{name}} option to @code{emacsclient}. (This
1400option is not supported on MS-Windows.)
1392 1401
1393You can also use @code{emacsclient} to execute any piece of Emacs Lisp 1402You can also use @code{emacsclient} to execute any piece of Emacs Lisp
1394code, using the option @samp{--eval}. When this option is given, the 1403code, using the @samp{-e} or @samp{--eval} option. When this option
1395rest of the arguments is not taken as a list of files to visit but as 1404is given, the rest of the arguments is interpreted as a list of
1396a list of expressions to evaluate. 1405expressions to evaluate, not a list of files to visit.
1406
1407@cindex @env{EMACS_SERVER_FILE} environment variable
1408When you start the Emacs server (by calling @code{server-start}),
1409Emacs creates a file with information about the TCP connection to the
1410server: the host where Emacs runs, the port where it listens for
1411@code{emacsclient} requests, and the authentication string to use for
1412the connection. @code{emacsclient} uses this information if it needs
1413to connect to the server via TCP. By default, this TCP configuration
1414file is placed in the @file{~/.emacs.d/server/} directory@footnote{
1415On MS-Windows, if @env{HOME} is not set or the TCP configuration file
1416cannot be found there, Emacs in addition attempts to find the file in
1417the @file{.emacs.d/server/} subdirectory of the directory pointed
1418to by the @env{APPDATA} environment variable, which is a user-specific
1419directory for application data files. This is similar to what Emacs
1420does on MS-Windows to search for the user's @file{.emacs} file.}
1421; you can
1422direct @code{emacsclient} to use a different file with the @samp{-f
1423@var{file}} or @samp{--server-file=@var{file}} option, or by defining
1424the @env{EMACS_SERVER_FILE} environment variable that points to the
1425non-default TCP configuration file.
1397 1426
1398@node Printing, Sorting, Emacs Server, Top 1427@node Printing, Sorting, Emacs Server, Top
1399@section Printing Hard Copies 1428@section Printing Hard Copies