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.

Filter by
Sorted by
Tagged with
9
votes
4answers
4k views

Run emacs GUI from emacsclient

I am running emacs 25.1. I have emacs server starting as a daemon on startup and I can open an emacs terminal session with the following alias: alias em="emacsclient -t" How can I start the emacs ...
0
votes
1answer
33 views

How can I make emacsclient use an existing window in the current frame?

I'm on MS Windows, if that makes a difference. My desired behavior: There is only one frame visible at any time. Visiting a file should use an existing window in that frame. (This is the default ...
0
votes
0answers
24 views

List commands / keywords in a directory sorted by frequency of use

I want to do some refactoring. For that purpose I want to list all keywords grouped and sorted by their frequency of appearance. That could help me get ideas, which repetitive code I could start ...
11
votes
2answers
977 views

Make emacsclient create a frame only if there isn't one already

How can I make emacsclient -a '' -n create a new frame only if there isn't one already? The problem with the -c flag is that it creates a new frame every time. The problem without it is that if there ...
0
votes
1answer
19 views

On one specific machine, after some time, new emacsclients can no longer connect to running daemon/server

A strange problem. I run Emacs across a number of machines, with more-or-less a shared configuration. However, on one specific machine, after some time I am no longer able to launch new emacsclient ...
3
votes
2answers
274 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 ...
1
vote
1answer
161 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 ...
0
votes
1answer
28 views

Bring Emacs frame to front when running emacsclient on WSL

Currently using Emacs on Windows Subsystem for Linux (WSL). I have this alias for emacsclient executable: alias e='emacsclient -n' Which I run very often when I am on the terminal (I use ConEmu or ...
0
votes
2answers
141 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 ...
1
vote
2answers
167 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

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 ...
2
votes
1answer
41 views

emacsclient GUI has small fonts

Recently I updated Emacs to the newest version (26.2) which comes with new daemon functionality and Emacs server in combination with Systemd (Manjaro here). Previously there were no issues with ...
0
votes
0answers
22 views

help: bash error in emacs rust/cargo

i get this error in emacs when runing a rust file (have rust and cargo): cargo run /bin/bash: cargo: command not found Compilation exited abnormally with code 127 at Thu Aug 8 20:28:50 yet i ...
1
vote
1answer
28 views

Help? - Freeze up to 10 seconds happening on windows when exiting (kill-emacs) when desktop-save-mode and back-button-mode are enabled

I've spent a full working day trying to somehow resolve this, no luck, so I'm turning to this place hoping for help. Recently I started experiencing freeze of something like up to 10 seconds when ...
2
votes
2answers
43 views

problem with starting emacs via emacsclient

I have no problems starting Emacs from a terminal, while if I start it from the desktop (I have a desktop file containing emacsclient -ca '') Emacs starts with a putt-ugly font (see below a screenshot)...
1
vote
4answers
643 views

How to make homebrew emacsclient open files in Emacs.app frame from terminal?

When I run emacsclient -nc filename.txt in my terminal, emacs opens in my terminal. I would prefer it to open in the main Emacs.app frame. Similar to how the terminal shortcuts work for Atom.
1
vote
1answer
32 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-...
0
votes
0answers
21 views

How can I open WoMan's pages from bash?

I first tried emacsclient -t -e '(woman "sox")', but it opens the WoMan's buffer as a popup: Then I tried emacsclient -t -e '(woman "sox") (spacemacs/toggle-maximize-buffer) (sleep-for 3) (delete-...
1
vote
1answer
40 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 ...
0
votes
1answer
43 views

How to find out if a file is visible for my shell script?

I want to implement a script that I can call from my file explorer to be able to open a new frame with the chosen file (emacsclient -nc $1), but only if the file does not already exist then I simply ...
1
vote
0answers
28 views

How to always show buffer in the new created frame?

My workflow is: I initialize emacs with a shortcut (in my ~/.i3/config I have a line like this bindcode $mod+49 exec emacsclient -c -n -q -a=''. I use i3wm.org) By default it goes to temp.org, in ....
0
votes
1answer
25 views

Can't use .bashrc file on remote server from ssh within emacs

Login to remote server with ssh in Emacs, general commands run well. Such as ls, docker ls, etc. C-x C-f /ssh:... But when I tried to run a command which alias to another which set in the .bashrc ...
0
votes
0answers
21 views

formatting dates in Emacs when run as a daemon

I run Emacs on a Linux (actually Xubuntu 19.04) machine and my localization settings call for an Italian locale. When generating timestamp, however, I'd like to have English months and weekday names....
0
votes
0answers
20 views

Running emacsclient does not load my display settings

I'm trying out emacs daemon and emacsclient in Linux. There's one thing I haven't been able to figure out: whenever I run emacsclient, my display settings (e.g. font) don't load, as opposed to what ...
1
vote
1answer
25 views

emacsclient -c stopped working, server running, emacs works

I am encountering a very strange problem. I worked with emacsclient for a while but suddenly, after starting an emacsclient frame the frame disappears shortly after start when interacting with it. It ...
1
vote
1answer
35 views

How to convert a package to a layer in spacemacs

I am new to the world of Emacs, and like most ex-vimmers, I am starting with Spacemacs. I have been trying to find time to do some leetcode and would like to use the package leetcode-emacs. I have ...
2
votes
0answers
156 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 ...
1
vote
1answer
87 views

Can you install Emacs temporarily for testing purposes like new versions and packages?

Is there a way I can install two versions of Emacs on the same machine ? The last time I tried installing versions 24 and 25 neither of the installations was working and the easiest solution was to ...
15
votes
3answers
351 views

Daemon mode: Defer interactive prompts on startup?

(Note that, title to the contrary, this question is not the same as How to start in daemon mode and suppress interactive dialogs?, as that question was "answered" by the submitter eliminating what was ...
2
votes
1answer
129 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 ...
0
votes
3answers
71 views

How to prompt to ask for confirmation when C-x C-c in emacsclient?

I use (setq desktop-save 'ask) in my init.el, so every time I C-x C-c to exit Emacs, it will prompt to ask if saving desktop or not; I use this trick to avoid accidentally exiting Emacs. But after ...
0
votes
1answer
36 views

Highlight some specific text in Emacs

I am using web-mode for my php files: http://web-mode.org/ And I call often a php function which looks like this: __lg('Some text here', 'Global', NULL, FALSE); This function can be call with only ...
0
votes
0answers
26 views

Emacsclient uses new instance, weird font

When I open Emacs normally (using runemacs.exe), everything appears fine, including the font. However, when I try opening a file in Emacs using the client, while getting the client to start the server ...
1
vote
1answer
40 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 [ “$?”...
7
votes
2answers
2k views

Setting up emacsclient on MS windows

I am trying to set up the emacs server daemon and use emacsclient on MS Windows so that files can be opened quickly without the delay and overhead associated with starting additional instances of ...
0
votes
0answers
30 views

Reconnect to the restarted daemon

I have started emacs (v26.1) server: $ emacs --daemon I connected using $ emacsclient -t From within emacs, well spacemacs, I restarted the daemon SPC q r, which executed dotspacemacs/resume-...
0
votes
1answer
72 views

On emacs26, is it possible to halt initializing and attach to running emacs-server with init.el?

I'm using emacs26 on macOS and using server-client for the fast initialization. However, it's a bit annoying that a new emacs instance is always spawning when I run "Emacs.app" with SpotLight instead ...
2
votes
1answer
109 views

Why are emacsclient and emacs separate programs?

I really like the client-server structure of emacs. However, I feel uncomfortable to run 'emacsclient' to attach to running emacs server. Is there any specific reason that emacs seperated emacsclient ...
6
votes
5answers
2k 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 ...
1
vote
2answers
45 views

Mac OS X: How to permanently change the prompt (value of PS1) in the shell of emacs client?

I have start emacs as daemon through (emacs --daemon). I then launch the client (emacsclient -c) and use its shell mode through (M-x shell RET). However the prompt starts with: bash-3.2$ I have ...
2
votes
2answers
120 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 ...
8
votes
2answers
405 views

Emacs can't save history of recent visited files opened in current session before shutdown

I have a problem with emacs started as daemon using Systemd. Every shutdown/reboot if I don't stop emacs daemon service manually, the history of recent opened files in current session is lost. I ...
0
votes
0answers
29 views

Cannot use toggle-input-mode in emacsclient

Recently, I 'm using gnu-apl and I need to change the input mode. When I use it in emacs it works well, but inside and emacsclient it doesn't work I cannot select any different input: With emacs: ...
0
votes
0answers
40 views

emacsclient exits unexpectedly without any error

I've built GNU Emacs 27.0.50 from source in Ubuntu 18.10. Then started the daemon as a systemd unit: [Unit] Description=Emacs text editor Documentation=info:emacs man:emacs(1) https://gnu.org/...
1
vote
0answers
77 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: /...
9
votes
3answers
3k views

Emacsclient: One single emacs process all the time from start up & never close & better hide GUI

Since emacsclient can handle long package loading time proerly, I really want to keep at least one emacs process, and most of the time only one emacs process, open as a background process and better ...
1
vote
0answers
169 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-...
0
votes
1answer
71 views

Emacs: Error message when sending a region to a sql connection buffer: Wrong type argument: processp, nil

Based on the article here: https://emacsredux.com/blog/2013/06/13/using-emacs-as-a-database-client/ I wish to have a .sql buffer to edit my queries and once prepared send it by (C-c C-r) to an already ...
7
votes
2answers
374 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 - ...
0
votes
2answers
822 views

Magit commit error: “cannot spawn sh” + “cannot start editor”

When I try to commit using Magit, I get the following error message: 1 c:/Users/chanyoungs/AppData/Local/GitHub/PortableGit_f02737a78695063deace08e96d5042710d3e32db/cmd/git.exe … "commit" "--" ...