1EMACSCLIENT(1) GNU EMACSCLIENT(1)
2
3
4
6 emacsclient - tells a running Emacs to visit a file
7
9 emacsclient [options] files ...
10
12 This manual page documents briefly the emacsclient command. Full docu‐
13 mentation is available in the GNU Info format; see below.
14
15 emacsclient works in conjunction with the built-in Emacs server.
16
17 You can either call emacsclient directly or let other programs run it
18 for you when necessary. On GNU and Unix systems many programs consult
19 the environment variable EDITOR (sometimes also VISUAL) to obtain the
20 command used for editing. Thus, setting this environment variable to
21 'emacsclient' will allow these programs to use an already running Emacs
22 for editing. Other operating systems might have their own methods for
23 defining the default editor.
24
25 For emacsclient to work, you need an already running Emacs with a
26 server. Within Emacs, call the functions "server-start" or "server-
27 mode". (Your ".emacs" file can do this automatically if you add either
28 "(server-start)" or "(server-mode 1)" to it.)
29
30 When you've finished editing the buffer, type "C-x #" ("server-edit").
31 This saves the file and sends a message back to the emacsclient program
32 telling it to exit. The programs that use EDITOR wait for the "editor"
33 (actually, emacsclient) to exit. "C-x #" also checks for other pending
34 external requests to edit various files, and selects the next such
35 file.
36
37 If you set the variable "server-window" to a window or a frame, "C-x #"
38 displays the server buffer in that window or in that frame.
39
40
42 Most options follow the usual GNU command line syntax, with long op‐
43 tions starting with two dashes ("-").
44
45 +line[:column]
46 Go to the specified line and column. A missing column is
47 treated as column 1. This option applies only to the next file
48 specified.
49
50 -a, --alternate-editor=COMMAND
51 If the Emacs server is not running, run the specified shell com‐
52 mand instead. This can also be specified via the ALTERNATE_EDI‐
53 TOR environment variable. If the value of ALTERNATE_EDITOR is
54 the empty string, run "emacs --daemon" to start Emacs in daemon
55 mode, and try to connect to it.
56
57 -c, --create-frame
58 Create a new frame instead of trying to use the current Emacs
59 frame.
60
61 -F, --frame-parameters=ALIST
62 Set the parameters of a newly-created frame.
63
64 -d, --display=DISPLAY
65 Tell the server to display the files on the given display.
66
67 -e, --eval
68 Do not visit files but instead evaluate the arguments as Emacs
69 Lisp expressions.
70
71 -f, --server-file=FILENAME
72 Use TCP configuration file FILENAME for communication. This can
73 also be specified via the EMACS_SERVER_FILE environment vari‐
74 able.
75
76 -n, --no-wait
77 Return immediately without waiting for you to "finish" the buf‐
78 fer in Emacs. If combined with --eval, this option is ignored.
79
80 -nw, -t, --tty
81 Open a new Emacs frame on the current terminal.
82
83 -s, --socket-name=FILENAME
84 Use socket named FILENAME for communication. This can also be
85 specified via the EMACS_SOCKET_NAME environment variable.
86
87 -V, --version
88 Print version information and exit.
89
90 -H, --help
91 Print this usage information message and exit.
92
94 Normally, the exit status is 0. If emacsclient shuts down due to Emacs
95 signaling an error, the exit status is 1.
96
98 The program is documented fully in Using Emacs as a Server available
99 via the Info system.
100
102 This manual page was originally written by Stephane Bortzmeyer
103 <bortzmeyer@debian.org>, for the Debian GNU/Linux system, but is not
104 specific to that system.
105
107 This manual page is in the public domain.
108
109
110
111
112GNU Emacs 2020-10-18 EMACSCLIENT(1)