Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [server]

The Emacs server, which allows opening files and running commands in an existing Emacs instance

Filter by
Sorted by
Tagged with
11 votes
2 answers
5k views

Equivalent to --no-wait for emacs

The emacsclient program allows a flag --no-wait (abbreviated as -n) which will cause the emacs server to visit the specified file, and return immediately. emacsclient -n ~/.bashrc If I provide an ...
nispio's user avatar
  • 8,235
11 votes
1 answer
816 views

How to control emacs externally?

I'm developing an app in python which sends commands to a running emacs instance. Currently, I start an emacs server and send the commands through the command line, like this: subprocess.call(['...
Jesse's user avatar
  • 1,994
10 votes
1 answer
2k views

How to know if emacs is running as a daemon?

I want to know if emacs is running as a daemon, so I can load some parts of my configuration according, I want to know this from within emacs.
shackra's user avatar
  • 2,782
9 votes
3 answers
6k views

Multiple Emacs instances each with their own server?

In my setup, I have several (GNU) Emacs instances running simultaneously on my local machine, one for each project or task that I'm currently working on. I would like to be able to open buffers in an ...
Felix Hoffmann's user avatar
8 votes
1 answer
864 views

How to test (programmatically) whether the current Emacs session (among several) is running the Emacs server?

The server-running-p predicate will evaluate to t if the Emacs server is running, irrespective of which Emacs session currently "owns" the server process. Therefore, when there are two or more ...
kjo's user avatar
  • 3,247
7 votes
1 answer
1k views

after-make-frame-functions does nothing for an otherwise working function

I am using workgroups and I have the following code in my init.el: (defun my-start-emacs (_) (interactive) (message "HI") (sleep-for 1) (if (daemonp) (progn (if (not (...
space_voyager's user avatar
7 votes
1 answer
2k views

Run elisp from command line in running emacs

How can I execute elisp in the currently running emacs from the command line? The following command echoes 'hi' but doesn't set 'abc in the emacs instance. emacsclient --no-wait --eval '(message "hi"...
Joe's user avatar
  • 1,322
7 votes
3 answers
6k views

Emacs 24.5.1 on Windows: How to use server mode?

I used to have Emacs 25.xx on my windows pc and was very happy with the daemon/server mode of emacs. Emacs started via batch-script on startup and everything worked fine -- on every subsequent call ...
itmuckel's user avatar
  • 267
5 votes
1 answer
165 views

How to have C-g *not* cancel emacsclient eval commands?

I'm sending some commands to my emacs using emacsclient --eval on a timer. The only problem with this is if at the time I happen to be using emacs and press C-g to cancel something, instead of ...
Joseph Garvin's user avatar
5 votes
1 answer
1k views

Why does using emacsclient from a remote host connect to the right socket, but I see nothing in my local Emacs?

I'm running a TCP server locally, and I'm trying to open a file from a remote host on my local Emacs through emacsclient. The reason for this is that I have emacspeak running locally which gives me ...
Parham Doustdar's user avatar
4 votes
1 answer
1k views

server-edit vs kill-buffer to kill an emacsclient buffer

I use emacsclient to open files from my webrowser (pdfs, text files etc). When I'm done with the file, I know I need to close it with C-x # (server-edit); if I use C-x k (kill-buffer) I get a warning ...
Tyler's user avatar
  • 22.3k
4 votes
1 answer
281 views

How to debug emacsclient?

Sometimes emacsclient fails with an error like: $ emacsclient .gitlab-ci.yml Waiting for Emacs... *ERROR*: Args out of range: 63695, 1, 1173 How can I debug this? emacsclient has no debug option, no ...
charmoniumQ's user avatar
4 votes
1 answer
4k views

Setting up emacsclient (OSX)

I am trying to set up emacs to run as a server to avoid the time required to open individual sessions for each file. This is on OS X El Capitan. Using the instructions provided here, I have the first ...
Snelephant's user avatar
4 votes
2 answers
472 views

Opening file with emacsclientw, file name contains non-latin characters

My first post here about Emacs. I've spent days trying to figure out answer before posting here. I'm running Emacs 26.1 on Windows 10. The setup that I'd like to have is running a single instance of ...
Lauris's user avatar
  • 111
4 votes
1 answer
1k views

From an external script, open file and run some simple expression whether emacs already running or not

Context / initial need (works fine) I wrote and use a script that generates a file and uses emacsclient to edit it in an existing or new instance of emacs, in a new window. Similar to Set up Emacs ...
Stéphane Gourichon's user avatar
3 votes
2 answers
895 views

How to get the server-name?

When starting a server it's possible to set a name for the server (http://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html). These names are to be useful for connecting emacsclients ...
Aaron Lee's user avatar
  • 377
3 votes
3 answers
2k views

Emacs as server (daemon) struggles

I am trying to setup emacs as server so that emacs (same instance) can be invoked from a file browser like nautilus Results not satisfactory Attempt 1 I have the foll. in ~/.local/share/...
Rusi's user avatar
  • 333
3 votes
2 answers
913 views

Is it possible to figure out which package/script takes most of the startup time?

I used to run Emacs on Linux using Emacsclient, it is really easy and great experience: emacs --daemon emacsclient When I work on a Windows machine, Emacs starts very slow. It seems there's no ...
Nick's user avatar
  • 4,493
3 votes
1 answer
510 views

Open file at startup from init file

I like that at start emacs visits a file with my todo list. For long time, this has been accomplished by adding (find-file "~/my-file.org") at the end of my configuration file (.emacs). ...
Massimo2013's user avatar
3 votes
1 answer
2k views

Changing the location of the emacs server socket

When I run emacs --daemon it creates a socket at /tmp/emacs1000/server How can I tell it to use a different location?
izkon's user avatar
  • 1,878
3 votes
2 answers
534 views

server-start with dynamic server-name

I'm using (server-start) in my init.el, but I'd like to be able to launch multiple server instances, every time I launch emacs. Today, server-start complains if the server is already launched. It ...
Sophana's user avatar
  • 31
3 votes
1 answer
242 views

What are the actual usage of the command `server-edit`?

According to the documentation of the command server-edit: Switch to next server editing buffer; say "Done" for current buffer. If a server buffer is current, it is marked "done" and optionally ...
Name's user avatar
  • 7,871
3 votes
2 answers
420 views

How to make Emacs run from a single Gnome desktop icon?

I often use Emacs with Linux Manjaro and Gnome. I need straightforward access to Emacs from desktop. Therefore, I have pinned the Emacs icon to dash so I can launch Emacs by clicking the Emacs icon. ...
Pierre ALBARÈDE's user avatar
3 votes
3 answers
3k views

connect to remote emacs session via ssh

Unfortunately, I forgot to start the emacs-server at work, running on Linux. Is there now any option to connect to my remote graphical X11 emacs session via ssh?
pawel_winzig's user avatar
3 votes
1 answer
169 views

Emacs 26.1 crash on server-start with stale auth files when server-use-tcp enabled

I've been experiencing a crash since upgrading to Emacs 26.1 and MacOS 10.13.4. It happens when running server-start (which is in my .emacs file), and a stale server auth file exists from a previous ...
Tim Harper's user avatar
2 votes
2 answers
3k views

bashrc script to automatically create emacs server session on startup?

I want to have .bashrc check to see if an emacs server is currently running, and if not, start one. I know how to start the server but I am not sure how to check whether it is already running - should ...
Andrew's user avatar
  • 561
2 votes
1 answer
2k views

Forwarding emacs server TCP connection works, but cannot create local frame

I'm trying to connect to a remote Emacs server. I created the server with server-use-tcp set to t so a connection file was created. I inspected the connection file and found out that it contains the ...
Ondřej Grover's user avatar
2 votes
1 answer
482 views

Cannot start Emacs daemon server after forced reboot

I was running Emacs in daemon server mode when my computer was force rebooted. After reboot was complete, I could not start the Emacs server again, receiving the error message: Starting Emacs daemon. ...
holocronweaver's user avatar
2 votes
1 answer
737 views

How can I use Emacs in a SSH sever that I logged in through emacs terminal?

I really like the emacs terminal but each time I use it to log into my server. I don't know how to use emacs to edit files on the server. Or it is not possible to do it? I can only edit files on ...
LifeWorks's user avatar
  • 123
2 votes
1 answer
571 views

`server-start` hook?

Is there a hook to execute stuff after I've run emacs --daemon? I'd like to keep load stuff only when running emacs --daemon and not when running emacs. I know it sounds like using square wheels, but ...
Felipe Lema's user avatar
2 votes
1 answer
590 views

emacs in --deamon mode dies when X display socket closes. How to prevent this?

My initial quest is Can emacs on Mac using native window system connect to an emacs server on a Linux system but I got off on a tangent that might work ok but I hit a speed bump. As described in the ...
pedz's user avatar
  • 375
2 votes
1 answer
295 views

custom-set-faces not working for client

I have a custom (custom-set-faces ...) section in my ~/.emacs file. When I run emacs this section seems to get completely ignored since the custom colours don't get set. But if I go to ~/.emacs, ...
Jan Stolarek's user avatar
2 votes
1 answer
606 views

X11 GUI low quality display when using server

Why is Emacs X11's display such bad quality, and how do I fix it? When I use Emacs Cocoa locally, I get a good visuals. But when I use the X11 forwarding on my department's server, the quality is ...
Alex Chitsazan's user avatar
2 votes
1 answer
87 views

How do I prevent emacsclient --tty FILE from flashing the other frame's buffer before loading FILE

With emacs -Q if you M-x server-start, then open a buffer, then back in the terminal emacsclient --tty SOMEOTHERFILE a new frame will be created, but it will initially show the buffer shown in the ...
Aaron Jensen's user avatar
1 vote
3 answers
859 views

When `emacs` is started, use `emacsclient` instead if there is a server

Most modern editors don't have a separate <editor>client binary. Instead, the main binary acts as a client to open a new window/the file given as an argument when possible. Is there a way to ...
Nova's user avatar
  • 1,119
1 vote
2 answers
375 views

Cannot start emacs server

I'm running Debian Jessie. I have installed emacs24-lucid package. I tried running emacs --daemon and got this: Loading 00debian-vars... Loading 00debian-vars...done Loading /etc/emacs/site-start.d/...
stranger's user avatar
  • 111
1 vote
1 answer
170 views

Separate Environments for each emacsclient

I have a single emacs server that I use for all of my work. It is located on a machine that I ssh into from every location. My 'browse-url is set to run a bash script that ssh's into the machine I am ...
jhleath's user avatar
  • 113
1 vote
1 answer
1k views

Emacs client starts in no windows mode

I have the following in .bashrc. export ALTERNATE_EDITOR="" export EDITOR="emacsclient -t" When I run, for example emacsclient something.tex & when running X, in a Konsole terminal (Konsole is ...
Faheem Mitha's user avatar
1 vote
1 answer
88 views

How can I use some package after other some other packages loaded?

I am trying to start dap-mode in my golang project. I already have lsp-mode config set. for example: (use-package lsp-mode :hook ((go-mode . lsp-deferred) (rust-mode . lsp-deferred) ) ) What ...
ccQpein's user avatar
  • 123
1 vote
1 answer
37 views

org files are not refreshed in emacsclient

My org files are stored on the cloud so I can edit them from multiple machines. Whenever I make a change to an org file (from a different machine), emacsclient does not reflect these changes, but a ...
marc.soda's user avatar
  • 133
1 vote
1 answer
202 views

Emacs client doesn't recognize non-ascii input

The problem: When I type a non-ascii character, the character is not wrote and instead a weird key combination is performed, depending on which character I have typed, as if it didn't support utf-8. ...
jthulhu's user avatar
  • 225
1 vote
1 answer
263 views

emacsclientw does not use font specified in init.el (Windows)

Emacs version: GNU Emacs 25.3.1 (x86_64-w64-mingw32) I have set up a shell-script which runs Emacs server at Windows startup as mentioned in Emacs Wiki. I have set up a shortcut on my desktop which I ...
aks's user avatar
  • 145
1 vote
2 answers
711 views

access remote emacs server via ssh crashed

I run an emacs server on a remote server. emacs --daemon and I access this server with ssh user@server -Y 'emacsclient -c &' everything works fine until I close the client. SSH session doesn'...
kosmos's user avatar
  • 21
1 vote
0 answers
67 views

How to keep buffers when closing only Emacs client?

I use Emacs 29.1. When I open Emacsclient, I do it with the following command: emacsclient -a -c --create-frame --no-wait This is bounded to a key combination to start the Emacsclient. To kill a ...
ReneFroger's user avatar
  • 3,880
1 vote
0 answers
136 views

Some Icons Don't Show Up When Running in Server/Client Mode

I am writing my own config from scratch in emacs. It's not a very complicated config so far. I have installed all-the-icons font. It works just fine when I launch emacs directly and start working in ...
Vipul Rajan's user avatar
1 vote
0 answers
76 views

How to start tide server in Emacs For Mac OS X?

In the .spacemacs file, typescript configuration layer is dotspacemacs-configuration-layers '( ┆(typescript :variables ┆ ┆ ┆ ┆javascript-backend 'tide ┆ ┆ ┆ ┆typescript-fmt-tool '...
Alpin Cleopatra's user avatar
1 vote
0 answers
70 views

Why does server-eval-at seem to change the behavior of read-string?

I am trying to create a script that, when run with emacs, will read commands from stdin a line at a time, execute them in another emacs process (with server-eval-at) and print the result. The process ...
Chris Hunt's user avatar
1 vote
0 answers
67 views

Is it possible to see the cursor of other emacsclients?

I'm trying to run Emacs server in order to collaborate on org files in our office. emacsclient makes it quite easy to have everyone connect to the same instance of a file and we can see real time ...
alecvn's user avatar
  • 419
1 vote
1 answer
927 views

Running Emacs server from snap installation

I've installed Emacs 26.2 using snap on Lubuntu 18.04. I'm trying to figure out how to get the server/client/daemon going. I've done as instructed on EmacsWiki: "Emacs Client" by putting (server-...
granti128's user avatar
1 vote
0 answers
315 views

Can emacs on Mac using native window system connect to an emacs server on a Linux system

At this point I believe I am using the emacs version on my Mac that is built by Homebrew and the "stock" emacs on Ubuntu 18.04. I set up emacs server on the Ubuntu host as it is described in Starting ...
pedz's user avatar
  • 375