Questions tagged [emacs-daemon]

Starting Emacs in daemon mode

7
votes
2answers
5k views

How can I run Emacs 24.x app on Mac OS X in daemon mode

I want to run the Emacs.app in daemon mode on Mac OS X. I can run emacs in daemon mode via the terminal, but instructions for running the app in a client-server pattern do not work (e.g.: http://...
7
votes
2answers
341 views

Unable to connect using emacsclient

I am starting the emacs server using systemctl --now --user enable emacs That server is running, if I run systemctl --user status emacs I got $ systemctl --user status emacs ● emacs.service - ...
6
votes
5answers
1k views

Emacs client can't find server in terminal

So, I'm trying to set up emacs as a server but I'm having trouble getting it to work from the terminal. If I run emacs --daemon on some terminal I can connect to it if I run the emacsclient from that ...
5
votes
1answer
114 views

How to start in daemon mode and suppress interactive dialogs?

I love to start emacs in daemon mode with my first login and then have the same emacs process for all subsequent logins, be it graphical, on physical console or from the network via ssh. But there is ...
5
votes
0answers
3k views

Restart emacs daemon from within emacs

Very much like Restart emacs from within emacs, except I'd like to do this for an emacs daemon and client. Specifically, I'm interested in the terminal client, but of course being able to restart ...
4
votes
2answers
480 views

How to make emacs running in daemon mode read my bashrc before start?

I run Emacs in the daemon mode as a user's systemd unit. However it won't read my environment variables. How to make it import my .bashrc first? I have multiple paths added in there and want to be ...
4
votes
3answers
3k 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 ...
4
votes
1answer
461 views

how to make emacs prompt me before closing the last emacs gui frame when running emacs as a daemon?

I know that if I set: (setq confirm-kill-emacs 'y-or-n-p) Emacs prompts me before I kill it. But I want emacs to prompt me before I close my last gui frame (prompting me before killing any frame ...
4
votes
2answers
723 views

how to start daemon with `--debug-init` or equivalent debugger?

summary problem I'm trying to debug a problem that involves an Emacs config and daemon startup. But when I run emacs --daemon --debug-init from a console, the spew ends with Loading desktop from /...
3
votes
2answers
185 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 ...
3
votes
2answers
340 views

If emacsclient already open, new emacsclient should “inherit” its buffer list

My workflow involves splitting frames a lot because I use i3wm. If I use the emacs native make-frame-command, the new frame will be visiting the buffer I invoked the command in. If I call emacsclient ...
3
votes
1answer
2k views

Emacs (as daemon) doesn't load theme

Related: Emacs: GUI with emacs --daemon not loading fonts correctly My init.el contains the following lines: (require 'darktooth-theme) (load-theme 'darktooth t) If I start Emacs with $ emacs ... ...
3
votes
3answers
220 views

Edit file only once and close it

Is there a way to edit a file only once? So that for example: I open it and its closed (the buffer is killed) after the window closes. A clarification: I usually have an Emacs deamon running and open ...
3
votes
1answer
179 views

emacsclient directly start eshell command command line

Both of the following work to call a graphical/terminal eshell: emacs -f eshell emacs -nw -f eshell Furthermore, this 2-step process also works: `emacsclient -t -a '' /some/real/file/name Metax ...
3
votes
2answers
337 views

Emacs server init when called without file

Whenever I use emacsclient, I tend to use it without a file argument. This is because my emacs file finder is generally better than my shell file finder. Unfortunately, when emacsclient is not given ...
3
votes
0answers
554 views

Starting emacs in daemon mode freezes, emacsclient is not able find a socket

I cannot launch the emacs daemon anymore. I do not know what triggered this. When entering emacs -Q --daemon -v I get only the following and nothing happen. Warning: due to a long standing Gtk+ ...
2
votes
1answer
215 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 ...
2
votes
1answer
322 views

Crash when starting daemon but not when starting normal

OSX Yosemite 10.10.4, emacs installed via brew install emacs-mac GNU Emacs 24.5.1 (x86_64-apple-darwin14.4.0, Carbon Version 157 AppKit 1348.17) of 2015-07-20 on Rainers-MacBook-Pro.local I want ...
2
votes
1answer
171 views

emacs daemon and ssh agent forwarding

In order to use ssh agent forwarding with emacs in daemon mode, running on a remote server, I've come-up with the following. I have an alias for the client like so: alias emacsclient="update_agent;/...
2
votes
1answer
686 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?
2
votes
1answer
417 views

Opening frames from emacs-daemon

How do I open a frame at start-up when using emacs --daemon? I don't run emacs --daemon directly. Instead, I use emacsclient -c -a '' which starts an emacs-server if there isn't one running already. ...
2
votes
1answer
153 views

tool-bar in emacsclient

I have the following for ridding of the toolbar on startup in graphical mode in my init configuration: (if window-system (tool-bar-mode -1) ) the issue: it works fine (albeit slow...see this ...
2
votes
1answer
184 views

Restoring Emacs desktops with daemon + clients

How to use Emacs desktop functionality with emacs daemon + emacsclient instances? I've enabled (desktop-save-mode 1) in my init file, and when I start the daemon I see messages like this: Desktop: 1 ...
2
votes
1answer
648 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 ...
2
votes
1answer
57 views

Launch an emacsclient instance in a new terminal window

I am using Sway/wlroots and I decided to switch to using terminal emacs for the forseeable future as there is no transparency in the xwayland version of emacs. I previously bound emacs to run as a ...
2
votes
1answer
77 views

extra frame in (visible-frame-list) when started in daemon mode, is causing problems

When I start emacs (emacs), and then eval (visible-frame-list), I get a list with one frame, the one that is visable. However if I start emacs as a daemon (emacs --daemon), and then eval (visible-...
2
votes
0answers
52 views

Showing different project-trees in different instances of emacs daemon

At this point I usually hook up into my emacs-daemon using emacsclient -a "" -c "$@". When I also want to display my project using Neotree, this works well for only one instance but if I open a file ...
2
votes
0answers
399 views

Starting daemon without forking to background

I want to run an Emacs daemon under daemontools. So I need to create an Emacs process which Basically does emacs --daemon Does stay in the foreground Displays the Messages buffer (or some other ...
2
votes
0answers
154 views

reopening emacsclient -t with desktop-save-mode doesn't save buffers/frames in place [duplicate]

I added (desktop-save-mode 1) to my custom.el towards the end to save buffers and frames. But I primarily use emacs --daemon and start an emacsclient -t. For some reason, if I use just Emacs the ...
2
votes
0answers
159 views

Faces not set immediately after load-theme

I'm trying to set the faces of highlight-indent-guides automatically whenever a new theme is loaded by making small adjustments to the background color of the default face. I have everything working ...
2
votes
0answers
37 views

mangled terminal output after failing emacsclient / folding mode launch

I consistently get the following problem on Emacs 24.5.1 with folding package (version 20140401.3) for which I've found a workaround but would like to understand what was going on. As you can see in ...
2
votes
0answers
60 views

Hide emacs icon when client is off

I am running emacs as daemon, in MacOSX, it works flawlessly but when I kill the client the icon remains in the dock as running. I searched around for a way to hide it when no client is running but I ...
2
votes
1answer
625 views

How to gracefully kill clientless daemon from commandline?

summary What to utter from commandline to cause a running clientless Emacs daemon/server process to gracefully shutdown--i.e., clean up after itself, then exit--without creating additional Emacs ...
1
vote
1answer
246 views

How to check for emacs being initialized in daemon mode?

I use emacs gui in daemon mode and also in standalone terminal mode. There is a package that I just want to use when I'm using emacs in terminal mode. the problem is that I can't use (display-...
1
vote
1answer
37 views

How do I specify a daemon to start with alternate emacs version with emacsclient

I have found this script from here #!/usr/bin/env zsh # Checks if there's a frame open emacsclient -n -e “(if (> (length (frame-list)) 1) ‘t)” 2> /dev/null | grep t &> /dev/null if [ “$?”...
1
vote
2answers
41 views

Emacs daemon preventing correct operation of saveplace

Writes to saveplace are not persisting after the emacs daemon stops. Saveplace is configured in my init file as: ;; saveplace remembers your location in a file when saving files (use-package ...
1
vote
1answer
186 views

Running emacs client: how do you know if the init files had errors loading

I use emacs 25, in nw mode, with "alias emacs='emacsclient -nw'" When I add something to my personal.el, I do brew services restart emacs My issue is, if I make a big blunder inside my personal.el ...
1
vote
1answer
91 views

Applying additional display settings on new client frames

I have the following function in my emacs config: (defun *make-frame-pretty (frame) "`*make-frame-pretty' will apply additional theme settings to make it prettier" ;; Add a fringe. ;; It's ...
1
vote
0answers
58 views

Unable to use emacsclient with emacs server when running mac port of emacs

I am running the mac port version of emacs that I installed via homebrew (see here). I'm also trying to run the Emacs server to avoid long startup times. To do this, I first run the server: /...
1
vote
0answers
142 views

Global display line numbers mode not working

I can run (display-line-numbers-mode) and get line numbers but it doesn't work if I run (global-display-line-numbers-mode) (nothing happens). I have traced this to this function: (defun display-line-...
1
vote
1answer
135 views

emacs --daemon crashes when parent ssh session dies

I'm using emacs 26.1 (although I don't think this is a new issue with this verison). Note - this is not the GTK bug which results in the daemon crashing if X Connectivity is lost. I am aware of that ...
1
vote
0answers
62 views

workgroups, server mode, and emacsclient

I'm trying to use emacsclient in conjuction with the workgroups package for emacs. However, I have one major annoyance; whenever I invoke emacsclient -c from the command line and open a file, the file ...
0
votes
1answer
94 views

Remote emacs daemon setup?

I've got a "shell account" on a distant server and I've done a successful local user setup of Emacs 25. Now I'd like to have a bash alias that will start an Emacs daemon and give me (a) client(s) to ...
0
votes
1answer
116 views

Preserving Layout Using emacsclient

If I spawn Emacs in --daemon mode, I can then use emacsclient to connect to the daemon from within a terminal window. If this then dies, I can reconnect my terminal and my Emacs session is still ...
0
votes
1answer
1k views

How can I get `emacs --daemon` to load the Spacemacs configuration?

I have configured my ~/.emacs so: It either launches default emacs via the default init.el, or runs the Spacemacs init.el I run Spacemacs via a spacemacs shell script, ~/bin/spacemacs #!/bin/sh ...
0
votes
1answer
293 views

emacs --daemon is not loading gui elements

I defined emacsclient as default editor in .bashrc so emacs -daemon will be called upon startup: export ALTERNATE_EDITOR="" export EDITOR=emacsclient But compared to a normal load without client, if ...
0
votes
1answer
257 views

problems connecting to an emacs daemon on RHEL

I am running into problems creating and connecting to an Emacs daemon on RHEL 6. I am using Emacs 23.1.1. The daemon starts correctly: emacs --daemon=foo ... Starting Emacs daemon. … but ...
0
votes
0answers
64 views

Using Emacs as a daemon (emacsclient) exhibiting weird behavior

Whenever I use Emacs as a daemon it seems like my init file isn't being fully loaded. My keybindings in particular are acting very odd. I use some unorthodox keybinds; for example: Ctrl+u = ...
0
votes
2answers
95 views

Emacs, .historian and root user

I use the following alias: alias e='emacsclient -a '\'''\'' -t alias sudo='sudo ' That way I can execute both, commands and aliases, with sudo, including e, which launchs the emacs server if it is ...
0
votes
0answers
99 views

Running Emacs as a client does not load my settings

I'm using the new systemd daemon option with Emacs 26. I have a problem, though. If I open a client instance (emacsclient -c) no config files (my .emacs) are loaded. So I don't see the usefulness in ...