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
44
votes
4answers
18k views

How do I use emacsclient to connect to a remote emacs instance?

I'd like to be able to run emacs on one computer: server $ emacs --daemon And then connect to it from another: local $ emacsclient -c server Is this possible? If so, how?
44
votes
7answers
3k views

How can I use my local Emacs client as the $EDITOR for remote machines I access over TRAMP?

I often use TRAMP to manage several remote servers, both for editing files and running remote shells in shell-mode. However, this does not work when a command uses the EDITOR variable to edit a file, ...
25
votes
5answers
7k views

Emacsdaemon and Emacsclient on Mac

OS: OS X 10.9.5, Mavericks GNU Emacs 24.3.1 (x86_64-apple-darwin13.1.0, Carbon Version 1.6.0 AppKit 1265.19) of 2014-04-03 on Rainers-MacBook-Pro-3.local I installed emacs via homebrew from ...
17
votes
0answers
1k views

How can I debug random Emacs server crashes?

I generally have a long-running instance of emacs --daemon, which I connect to with various emacsclients. Recently I have started experiencing random crashes. I say "random" because I haven't been ...
16
votes
2answers
508 views

Collapsing undo history

I'm working on an Emacs mode that lets you control Emacs with speech recognition. One of the problems I've ran into is that the way Emacs handles undo doesn't match how you would expect it to work ...
16
votes
3answers
354 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 ...
13
votes
2answers
3k views

Using daemon mode in Gnome 3

I've gotten the Emacs daemon to work through the command line using the EmacsWiki page, but I'm stuck on how to get the client to run through the Gnome 3 launcher. How can I set up a Gnome desktop ...
13
votes
3answers
1k views

Is there any way to run a hook function only once?

The context I'm using the after-make-frame-functions hook to load properly the themes in an emacs client/server configuration. Specifically this is the code snippet that I use to make that (based in ...
11
votes
2answers
979 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 ...
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 ...
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 ...
9
votes
2answers
165 views

Call emacsclient from a program called by Emacs

I've run into a problem viewing pdf documentation files with AucTex. I use pdf-tools to view PDF files from within Emacs, and I've set emacsclient -n as my default pdf-viewer (via xdg-mime on Debian ...
8
votes
3answers
3k views

Reload environment variables

This question has been asked at superuser is-there-a-way-to-reload-environment-variables-in-emacs, but no good solution was given. I am using EmacsClient with often more than 30 buffers open, if I ...
8
votes
1answer
832 views

start emacsclient with focus from command line

When I start emacsclient from command line as below: emacsclient -a '' -c "$@" It always starts in the background (terminal window on top of emacsclient window), so I have to use mouse to click the ...
8
votes
2answers
3k 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 ...
8
votes
1answer
1k views

How to prevent emacsclient starting a new frame every time?

I have Ubuntu 12.04 running with Emacs 24.3. On computer startup, emacs --daemon is executed, and I have modified the emacs24.desktop to take emacsclient -c -a "" as exec parameter. However, whenever ...
8
votes
2answers
406 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 ...
7
votes
2answers
2k views

emacsclient to access remote emacs server

I'm trying to open an emacsclient session from a remote host. I walked through the following steps on the tramp website How can I use TRAMP to connect to a remote Emacs session?. I'll walk you ...
7
votes
1answer
1k views

How do I use emacsclient as EDITOR or VISUAL?

Scenario: I'm in zsh and I want to edit a long shell command in an already open instance of Emacs. I've set $VISUALto emacsclient -n -c. When I run C-x C-e from zsh, a new Emacs frame opens, populated ...
7
votes
2answers
4k 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 ...
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 ...
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 - ...
6
votes
4answers
2k views

What is the difference between standalone version of emacs and the one that runs inside terminal?

I am not sure if my question makes sense. I am naive to this. I see that there is a standalone version of emacs with the menu bar, tool bar etc. Also, I see emacs version that could be run inside a ...
6
votes
4answers
1k views

Emacs cursor color is different in daemon and non-daemon modes

There's some weird stuff I encounter when running Emacs under KDE. Here's how it looks when I run it normally, via the emacs command: If I run it as a daemon, here's what I see: And if I run ...
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 ...
6
votes
1answer
497 views

Why emacsclient say to quit with C-x 5 0?

As soon as I open emacsclient I found the following message in the minibuffer: When done with this frame, type C-x 5 0, I find it strange that it advices how to close the frame with delete-frame, any ...
6
votes
2answers
174 views

Open edit-server files from emacsclient in a specific frame

Is there a way to designate a specific frame in which files opened with emacsclient will appear? I have one monitor that is dedicated to a fullscreen Emacs frame. I do most of my editing in that ...
6
votes
1answer
693 views

Make emacsclient open multiple files in separate windows

When I open multiple files at once with emacs, like emacs file1 file2, it opens the two files side-by-side (in different windows in the same frame). But when I do the same with emacsclient, it only ...
5
votes
2answers
185 views

How to load start up screen (*GNU Emacs*) f it hasn't already been created?

When you run Emacs in daemon mode and then connect to it with emacsclient it doesn't show the start screen (*GNU Emacs*) but instead puts you into the *scratch* buffer, which is normally fine. But if ...
5
votes
1answer
4k views

How do I install emacs on windows 10 pro

I can't find a clear tutorial for how to do this on windows 10. Normally there are a few tricks required to get it running properly so I thought I would ask here before trying one of the windows 8 ...
5
votes
1answer
1k views

Determine graphical display on startup for emacs server/client

I am trying to have specific settings when I start a new emacs frame in X as opposed to in the terminal while using emacs-server. My initial attempt was using this solution, but it appears it isn't ...
5
votes
1answer
123 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 ...
5
votes
1answer
140 views

Is there an Emacs equivalent to Vim's arglist?

I often find myself in the situation of needing to open a bunch of files at the same time and run through them all and do something (search/replace, verify something or other, etc.). In vim, I'd do ...
4
votes
2answers
2k views

less psql, more emacs

I was listening to this song today - https://www.youtube.com/watch?v=ajy71xw351E Don't Wanna Leave You Now 🎵 🎶 and I realized how much I don't want to leave emacs. I often do this after ...
4
votes
1answer
75 views

Access contents of buffers from outside

I want to access contents of emacs buffers from outside like in acme editor. Acme is in part a file server that exports device-like files that may be manipulated to access and control the contents ...
4
votes
1answer
438 views

emacsclient of 24.4 does not work on Yosemite

I have used emacsclient without any problem on OSX. Usually I just start Emacs server by emacs --daemon in Console, and then emacsclient works. I use emacsclient -nc to create a new frame. However, ...
4
votes
1answer
380 views

how to tell graphical Emacs to shutdown cleanly from tty1?

problem Lately I run GNU Emacs mostly as GUI on X/tty7 (which I'll call "the desktop" as opposed to emacs-desktop) on one of my Debian laptops. Occasionally the desktop hangs, in which case I usually ...
4
votes
2answers
77 views

Closing emacsclient after quitting calc?

I'd like to run calc in an emacsclient in my terminal, and then have that particular emacsclient session close completely and return me to my shell when calc quits. I've got the first part of that ...
4
votes
2answers
2k views

emacsclient can't open display :0

My problem is very similar to this one from Unix & Linux Exchange. I use systemd to start emacs --daemon as my user account. Recently I have had the following problem when trying to open a new ...
4
votes
1answer
399 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 ...
4
votes
1answer
302 views

How to detect the term color support inside of a emacsclient session?

I run a emacs daemon on boot as a OpenRC service without info about terminals. When I plug a different terminal on emacsclient so, I don't have env variables instead that was generated inside of emacs ...
4
votes
2answers
274 views

print unquoted output to stdout from emacsclient

I want to use emacsclient to let my running instance of emacs evaluate a function and print the result to a terminal. That is, I want to do something like this: $ emacsclient --eval "(frame-...
4
votes
2answers
165 views

How can I get emacsclient --eval not to print things in an emacs buffer, but only on the command line?

So I have a hack to get my emacs org-clock to display in polybar (a system panel utility). It involves a script that looks like this: CLOCKSTRING=`emacsclient --eval "(if (org-clocking-p)(print (org-...
4
votes
1answer
209 views

How to stop “emacsclient -t -a '' --eval” output to stdout?

I am running emacsclient with the command: emacsclient -t -a "" --eval "some-exp" The emacsclient -t -a "" is a must. The problem is, for example, if I run: emacsclient -t -a "" --eval "nil" when ...
4
votes
1answer
645 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 ...
4
votes
1answer
157 views

How to 'fix' gnuclient after opening a second instance of emacs?

If I open a second instance of emacs accidentally (which happens more often than I am willing to admit) and then close it, gnuclient starts responding with the following error: gnuclient: Connection ...
4
votes
1answer
903 views

“Error reading from stdin” after reboot

I've started using the emacsclient more along with the daemon, and I'm a huge fan, but it's started giving me trouble when I reboot my computer. After reboot when I open up a new emacsclient, I don't ...
3
votes
3answers
200 views

Inserting org-style links from external program

I have written this function to insert an org-style link to a file: (defun jay/insert-file-link (fname) "Insert link to file (called by Midnight Commander)." (interactive "s") (insert "[[") (...
3
votes
1answer
737 views

How to open a file in another window by clicking on a file in my window manager?

When I double click to open a file, a new Emacs session is launched, like this: So now there are two sessions. What I want to do is that when I double click a file, it will be opened in another ...
3
votes
1answer
561 views

How to open a file with emacsclient from Thunar?

I want to use emacsclient to open files from Thunar in Linux Mint 17 xfce. I have tried right-click+"open with other application"+"emacsclient -c", but this does nothing. I have also tried writing a ...