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 -r --reuse-frame
62 Reuse an existing frame if one exists, otherwise create a new
63 frame.
64
65 -F, --frame-parameters=ALIST
66 Set the parameters of a newly-created frame.
67
68 -d, --display=DISPLAY
69 Tell the server to display the files on the given display.
70
71 -e, --eval
72 Do not visit files but instead evaluate the arguments as Emacs
73 Lisp expressions.
74
75 -f, --server-file=FILENAME
76 Use TCP configuration file FILENAME for communication. This can
77 also be specified via the EMACS_SERVER_FILE environment vari‐
78 able.
79
80 -n, --no-wait
81 Return immediately without waiting for you to "finish" the buf‐
82 fer in Emacs. If combined with --eval, this option is ignored.
83
84 -w, --timeout=N
85 How long to wait, in seconds, for Emacs to respond before giving
86 up. The default is 0, which means to wait forever.
87
88 -nw, -t, --tty
89 Open a new Emacs frame on the current terminal.
90
91 -s, --socket-name=FILENAME
92 Use socket named FILENAME for communication. This can also be
93 specified via the EMACS_SOCKET_NAME environment variable.
94
95 -V, --version
96 Print version information and exit.
97
98 -H, --help
99 Print this usage information message and exit.
100
102 Normally, the exit status is 0. If emacsclient shuts down due to Emacs
103 signaling an error, the exit status is 1.
104
106 The program is documented fully in Using Emacs as a Server available
107 via the Info system.
108
110 This manual page was originally written by Stephane Bortzmeyer
111 <bortzmeyer@debian.org>, for the Debian GNU/Linux system, but is not
112 specific to that system.
113
115 This manual page is in the public domain.
116
117
118
119
120GNU Emacs 2022-09-05 EMACSCLIENT(1)