Questions tagged [emacsclient]
emacsclient is a program which allows the user to connect to the Emacs Server. This is useful when using Emacs as the default editor on Unix-like systems, as it allows Emacs to be invoked without creating a new process, allowing the reuse of shared buffers and command history.
68
questions with no upvoted or accepted answers
3
votes
0answers
424 views
Emacs not responding to keyboard input
Sometimes Emacs stops responding to keyboard input. It responds to mouse input though. If I do killall -s SIGUSR2 emacs, the debugger shows this (but remains unresponsive to keyboard):
Debugger ...
3
votes
2answers
406 views
Calling emacsclient from ansi-term makes emacsclient hang, how do I get around this?
Sometimes I use ansi-term in emacsclient instead of directly using my shell. When I do this, it is not an infrequent occurrence that I forget where I am and call emacsclient someFile, which freezes ...
3
votes
0answers
97 views
make-frame-on-display & emacsclient fail w/ exported display while other apps are fine
I am connecting to my office GNU/Linux box from a windows laptop through a putty ssh tunnel.
I have also on the laptop the java WeirdX X11 server, that is declared in putty to use the localhost:2 (...
3
votes
0answers
305 views
emacsclient doesn't start when visiting a file that is already open
I start emacsclient with emacsclient -a 'emacs-server-start' -nw --socket-name=$TTY, where emacs-server-start is a script that runs emacs --daemon="$TTY" (I use $TTY to get a different client for each ...
3
votes
0answers
1k views
When using emacsclient, how can I open the file in the active buffer?
When I open a file with emacsclient without invoking -c, Emacs visits the file in a new buffer in the background while leaving my current window configuration in place. I'd like to change this, e.g. ...
2
votes
0answers
107 views
emasc daemon does not load my init.el completely but emacs do
When I run emacs, everything is Ok, my init.el is read. However, after starting a daemon (emacs --daemon), an emacsclient GUI frame (emacsclient -c) is not configured for the following setting:
font ...
2
votes
1answer
879 views
Emacs as Editor under Win10 WSL 2
From Windows 10, how can I call an Emacs instance residing on a Windows 10 WSL 2 Linux install, passing it a given file to visit?
So far, I've done this:
On my WSL 2 Linux, I've created a script ...
2
votes
1answer
131 views
Is it possible to use emacsclient remotely?
I'd like to use emacsclient on my laptop to connect to an emacs server on my desktop.
I think I know that the emacs server process listens to a unix socket in "/tmp/emacs${UID}".
So I need to make a ...
2
votes
0answers
70 views
Launching GUI emacslient destroys terminal frame resizing capabilities
Whenever I launch a GUI session as $ emacsclient -c all the emacsclient sessions I've created with $ emacsclient -nw -c lose several settings. The problem only occurs right after launching a GUI ...
2
votes
0answers
53 views
How to wait while evaluating an expression with emacsclient?
I use emacsclient regularly to open files. In order to open files owned by root, it is necessary to use tramp. As far as I know this requires the use of the eval option of emacsclient.
emacsclient --...
2
votes
0answers
72 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
72 views
emacsclient -c new frame cannot have an individual new sr-speedbar
Since emacsclient depends on emacs server, when I first start emacs server and then try:
emacsclient -c -n -a emacs --eval "(sr-speedbar-open)"
It reports that sr-speedbar is arlready opened. Is it ...
2
votes
0answers
72 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
87 views
How emacsclient automatically startup with the most recent file?
With the help of recentf I am able to open recently open files from its buffer list. As an example when I execute icicle-buffer, I can see the buffer list.
I was wondering can I do this operation ...
2
votes
1answer
1k 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
0answers
13 views
How can I get Emacs to release a locking folder handle?
After using Emacs to open a file in a folder on MS Windows using emacsclientw -n, killing the buffer does not release a handle Emacs has to the folder, so the folder can't be deleted.
GNU Emacs 27.1 (...
1
vote
1answer
49 views
How does emacsclient determine what XDG_RUNTIME_DIRS is supposed to be?
When I run emacsclient I get this error:
$ emacsclient .
emacsclient: Should XDG_RUNTIME_DIR='/run/user/10030' be in the environment?
emacsclient: (Be careful: XDG_RUNTIME_DIR is security-related.)
...
1
vote
0answers
108 views
How can I set WM_CLASS for Emacs 27?
I use scratchpads in XMonad (my WM) extensively for quickly capturing (notes, TODOs etc) from anyhwere. I have an instance of Emacs running permanently in a workspace, and launch emacsclient as my ...
1
vote
1answer
81 views
How to prevent a file show up for a second when emacsclient starts?
I am using emacs-daemon. When every I re-start my daemon and do C-x C-b my Buffer List seems always full.
Later, when I start my emacsclient for a seconds(like a fast flash) it shows a file that ...
1
vote
0answers
40 views
Accidentally started emacs --daemon, and couldn't kill it!
I was testing emacs --daemon functionality, and called two daemons alive. I wanted to kill them, with
$ pgrep emacs
275760
275857
$ pkill emacs
$ pgrep emacs
276788
276847
# It's alive again!
# Lemme ...
1
vote
0answers
50 views
Differing behaviours with EDITOR=emacsclient between git and sudoedit
In my .profile I've
export EDITOR="emacsclient -qa \"emacs --no-window-system --no-desktop\""
Doing sudo -e /somefile doesn't work even when Emacs server is running. I get
emacsclient: ...
1
vote
0answers
36 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 ...
1
vote
0answers
172 views
emacs.service will delay 2 mins before `reboot/shutdown` my computer
I use emacs a lot and restart it since I change my init.el from time to time, so I started to use emacs.service about one year ago using command like
systemctl --user enable emacs.service
systemctl -...
1
vote
0answers
19 views
Switching Emacs server's socket without leaving existing emacs gui
I would like to switch between emacs socket without leaving the GUI. I am able to start two emacs daemon session by doing the following:
In xterm1:
emacs --daemon="one"
In xterm2:
emacs --daemon="...
1
vote
0answers
251 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
2answers
412 views
Remove emacsclient startup message
How do I go about removing the message "When done with this frame, type C-x 5 0" when launching emacsclient?
I know it's possible to controll the startup message of emacs when not launched as a ...
1
vote
0answers
53 views
emacsclent -nw hangs
As I use emacsclient -nw -c in a terminal e.g. xterm -e emacsclient -nw -c, emacs hangs when I resize horizontally (to the minimum allowed by the wm). I can't no longer launch any emacsclient window, ...
1
vote
0answers
166 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 ...
1
vote
0answers
158 views
Possible to pass arguments to emacsclient alternate-editor?
Currently this works:
emacsclient ..args.. --alternate-editor=some_editor
However this does not:
emacsclient ..args.. --alternate-editor="some_editor --args"
Is there a way to call the alternate-...
1
vote
0answers
75 views
How to RPC from External Process to Emacs
How can I RPC from an external application into Emacs then have a function in Emacs handle the RPC?
For example, I would like to make a D3.js webpage with a dependency graph of a codebase, view and ...
1
vote
0answers
282 views
Problem opening spacemacs on mac OS Sierra when clicking spacemacs icon.
trying to install spacemacs using the Alternate installation instructions, but when I load the app using the app icon on the Applications folder I get the following.
TL;DR: How to link env HOME=$HOME/...
1
vote
0answers
50 views
Running emacsclient causes some flashing effect to happen on other frames
I picked up this code from:
Is there any way to run a hook function only once?
(setq myGraphicModeHash (make-hash-table :test 'equal :size 2))
(puthash "gui" t myGraphicModeHash)
(puthash "term" t ...
1
vote
0answers
353 views
emacs ssh client on windows
I have emacs installed on linux machine, and for most times, I need to connect to the machine on my windows laptop, previous I use putty, but I found it has issue with emacs keybindings, some key ...
1
vote
0answers
75 views
Preventing emacsclient -c from bringing both Emacs frames to the front
Environment Cygwin, emacs-w32 variant.
Use case Setting up my editor for git commits from the terminal.
Problem
When I do a git commit from a terminal, I have it setup to do
emacsclient -c
I get a ...
1
vote
0answers
97 views
Running emacs server via systemd prevents inverse search and nice view
Background: I am using systemd to run my emacs server and my usual workflow always involves invoking emacsclient. Both server and client are on the same computer running Debian Jessie. The method is ...
1
vote
0answers
83 views
Add commands after custom LaTeX split window view
I use
(setq TeX-view-program-list (quote (("Emacs" "emacsclient -e '(split-window-horizontally 88) 'emacsclient -e '(other-window 1)'; emacsclient %o;"))))
(setq TeX-view-program-selection (quote (((...
0
votes
0answers
33 views
emacsclient freezes: Waiting for Emacs
Once in a while emacsclient freezes and unable to open the file. This never happens in linux but happens in macOS. Is there any way to understand the main reason for it?
my setup:
$ ⯠emacs --version
...
0
votes
0answers
51 views
What' s going on with this program?
I have been using emacs for many years, but from version 26 ... there is a mess with server as I have to type emacsclient in place of simply emacs. Going worse with 27.
From 26 I haven't found a way ...
0
votes
0answers
20 views
Emacsclient works in terminal but not in gui mode
Prerequisites
GNU Emacs 28.0.50 built from sources.
Emacs daemon started via systemd with .config/systemd/user/emacs.service:
[Unit]
Description=Emacs text editor
Documentation=info:emacs man:emacs(...
0
votes
0answers
47 views
emacsclient single executions are expensive?
I have server-mode enabled so that I can use emacsclient to execute functions from other parts of my system. My main example is that I have a polybar module that calls emacsclient for some details ...
0
votes
0answers
30 views
How do I make Emacs not complain about not being able to start a new server?
I use the mac port version of emacs for handling org-protocol URLs, because I need a graphical instance when I use org-protocol from Chrome. The problem is that emacs will try to start an emacs server ...
0
votes
0answers
69 views
emacsclient crashes on start
I use doom emacs. Starting emacs normally works just fine.
Having an emacs daemon and trying to use emacsclient -c causes the following error:
*ERROR*: Symbolās function definition is void: persp-mode-...
0
votes
0answers
46 views
org capture: Store new file name or use an existing file name as a variable
I'm looking for a way to use a fuzzy finder menu to store a new file name or select an existing file name as ${title} or %Ė{Name} string variable.
I use the zettelkasten system and my workflow ...
0
votes
0answers
26 views
Server-edit Automatically When Buffer is Killed
I'm considering using emacs as a server (using (server-start)) but I do not want to use C-x # to kill buffers. I've heard of the -n option for emacsclient, but I'm concerned that it may cause unwanted ...
0
votes
0answers
25 views
emacs org capture mode not creating link with “%a”?
my org capture template is
(setq org-capture-templates
'(
("i" "Idea" entry (file+datetree "~/Dropbox/org_mode/ideas.org")
"* %?\n Idea: %U\n ...
0
votes
0answers
143 views
emacsclient: connect: Connection refused
I am trying to run emacs-daemon on a remote machine (connected via ssh), which was working fine. After I try to setup ports for mosh between 60000:61000 emacs-daemon started not to open :-(
The way I ...
0
votes
0answers
24 views
execute a function when emacsclient opens a frame
I am using emacs-evil and when I open a new frame on X11 I can normally use ESC key switch between writing and command mode. But in terminal it won't work, and it just trigers meta.
I have been able ...
0
votes
1answer
151 views
Font and frame configuration in daemon mode
In my .emacs I have
(set-frame-font "Source Code Pro")
(set-face-attribute 'default nil :font "Source Code Pro" :height 140)
(set-face-font 'default "Source Code Pro")
...
0
votes
1answer
61 views
make emacsclient connect to running emacs
In my .emacs I have (server-start).
In my .bashrc I have:
export ALTERNATE_EDITOR="emacs-snapshot"
export VISUAL="emacsclient-snapshot -c"
When I run emacsclient -c EXISTING-FILE ...
0
votes
0answers
41 views
Run command in an emacsclient instance from the terminal
How can one run a command (e.g. to open a file) in an existing emacsclient instance, from the terminal (i.e. not from Emacs itself)?