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).

91 questions
54
votes
4 answers

Using Emacs server and emacsclient on other machines as other users

I know that after I call (start-server) inside an existing Emacs session I can then use emacsclient -c (on the same computer) to create new frames that connect into that server, so that each new frame created by emacsclient has access to the same…
Paul Whittaker
  • 3,547
  • 3
  • 22
  • 19
24
votes
4 answers

How to remove the prompt for killing emacsclient buffers?

After I open something with emacsclient, when I kill that buffer (C-x k) I get a confirmation dialog: Buffer `blah' still has clients; kill it? (yes or no) But when I kill buffers opened directly from Emacs I don't. Is there a way not to get them…
pupeno
  • 256,034
  • 114
  • 324
  • 541
15
votes
5 answers

How to close a emacsclient gui frame without killing the server

How do you close an emacsclient frame without killing the server/daemon? Doing C-x C-c or C-x 5 0 in the gui will exit both frame and server (and other clients), while this just quit the current frame when done from terminal. (Ps: My emacs version…
AdrieanKhisbe
  • 3,532
  • 7
  • 31
  • 45
15
votes
4 answers

How to automatically evaluate certain lisp code after starting an emacsclient?

When starting Emacs, init.el (or .emacs.el) is evaluated. However, when starting emacsclient, no similar lisp code is evaluated. How can I get a lisp file to be evaluated every time I open a new emacsclient? (This would be handy for frame specific…
Kevin
15
votes
2 answers

How to use emacsclient on root files, using sudo and a single daemon

I always run emacs as daemon but when I want to make something alike sudo emacsclient /etc/make.conf I can't do it because root is using another emacs and I don't really want to run 2 daemons or wait usual emacs load for simple file. I need some…
cnd
  • 29,085
  • 60
  • 169
  • 294
13
votes
3 answers

emacsclient window focus

How do I consistently control window focus after running emacsclient? Currently, focus depends on if I already have an emacs server running. When emacsclient invokes an alternative editor, focus is shifted to the new emacs window. When emacsclient…
vlee
  • 1,329
  • 3
  • 14
  • 23
13
votes
4 answers

How can I make emacsclient just open a window for an existing emacs daemon without opening a new file

I use an emacs daemon to preserve my emacs session even if I have to reboot the machine that I run my X server on or if I want to access the same session from a different machine. This works very well but when restoring a session I'd quite like to…
Mike Crowe
  • 504
  • 4
  • 11
13
votes
2 answers

Emacs Magit commit opens new Emacs client

I've been using Magit for awhile, and when committing, it used to simply split the window and allow me to commit from within the same emacs session, but I seem to have changed this behavior to the following: Now, when I commit my staged changes, a…
FellyTone84
  • 525
  • 7
  • 15
11
votes
2 answers

Evaluate emacs lisp expression on command line

I'm a newbie to emacs. I'm working with emacs-24.1 on redhat linux, and trying to evaluate an elisp expression. What I want emacs to do is to evaluate the elisp expression without launching emacs itself. I'm trying different things emacs --eval '(+…
Surya
  • 969
  • 1
  • 9
  • 27
9
votes
2 answers

Emacs - emacsclient or new frame?

this is a rather rudimentary question, but what is the practical difference between opening a new file in a separate frame (make-new-frame) from emacs or opening the file in an instance of emacsclient? I can see that if you are working through a…
hatmatrix
  • 36,897
  • 38
  • 126
  • 217
8
votes
1 answer

Emacsclient hook on kill

I am trying to find a hook in Emacs, which should fire right before emacs server graceful shutdown. I tried kill-emacs-query-functions, kill-emacs-hook, server-done-hook with elisp like : (add-hook 'server-done-hook '(lambda () …
MageSlayer
  • 371
  • 3
  • 12
8
votes
2 answers

How can I set the port that the Emacs Server uses?

I use Emacs to do most of my development work, I'd like to be able to connect to the Emacs server running on my office workstation from home. I connect to my office network over a VPN, I think this is mostly safe. Anyway, I have a script that copies…
Miles
  • 1,561
  • 1
  • 15
  • 21
7
votes
2 answers

how to check if emacs in frame or in terminal?

Based on this question : How to set emacsclient background as Emacs background? I need background only for frames, not for terminal and not for console. Here is how I'm trying to add fix for console (when (display-graphic-p) (tool-bar-mode -1) …
cnd
  • 29,085
  • 60
  • 169
  • 294
7
votes
2 answers

How can I secure an emacs-server?

I'd like to ensure that only I can connect to an emacs server that I initialised. I frequently use machines that other people could be SSH'd into, and I don't see what's to stop them opening emacsclient and running M-x kill-emacs which would screw…
Squidly
  • 2,637
  • 17
  • 39
7
votes
3 answers

Using Emacs as a server and opening only one window exactly, which should be maximized

I'd like to run my Emacs in daemon mode, and then use emacsclient to actually display things. However, if I run emacsclient filename, it shows up in the terminal, which isn't what I want; I instead have to pass it the -c option. However, that option…
Koz Ross
  • 2,714
  • 1
  • 19
  • 40
1
2 3 4 5 6 7