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.

See also Emacs-Server (GNU Emacs Manual) and Emacs Client (emacswiki).

316 questions
55
votes
3 answers

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?
liszt
  • 725
  • 1
  • 5
  • 10
46
votes
7 answers

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, such as crontab -e especially because shell-mode…
Tikhon Jelvis
  • 6,152
  • 2
  • 27
  • 40
26
votes
5 answers

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 railwaycat and it works nicely - no complaints. I do…
Rainer
  • 897
  • 10
  • 16
19
votes
3 answers

How to collapse 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 when controlling by voice. When the user speaks…
Joseph Garvin
  • 2,061
  • 8
  • 21
19
votes
7 answers

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 emacs for each file opened. I am following the…
Snelephant
  • 814
  • 1
  • 7
  • 17
19
votes
1 answer

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 able to figure out what causes the crashes. Often it…
Scott Weldon
  • 2,695
  • 1
  • 17
  • 31
16
votes
4 answers

Run a Function Only Once, Though a Hook Many Times

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 this SO answer): (if (daemonp) (add-hook…
joe di castro
  • 370
  • 3
  • 12
16
votes
3 answers

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 causing a particular prompt to appear.) I'd like…
Trey
  • 865
  • 5
  • 20
14
votes
2 answers

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 file that launches a GUI window that connects to the…
tbekolay
  • 243
  • 3
  • 9
14
votes
2 answers

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 is no frame open it will open in the command…
spelufo
  • 303
  • 1
  • 9
13
votes
3 answers

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 change an environment variable in the shell, I need…
Håkon Hægland
  • 3,608
  • 1
  • 20
  • 51
13
votes
5 answers

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 same terminal, but if I open a new terminal the…
12
votes
2 answers

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 window to switch to emacsclient. It's really…
lucky1928
  • 1,622
  • 8
  • 28
11
votes
4 answers

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 gui in a similar fashion?
dagda1
  • 595
  • 1
  • 3
  • 16
11
votes
2 answers

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 alternate editor, then this will still work in cases…
nispio
  • 8,175
  • 2
  • 35
  • 73
1
2 3
21 22