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

94 questions
4
votes
2 answers

Can Emacs server edit remote files specified by Emacs client?

I'm looking to set up an emacs server such that the files specified by emacsclients are relative to the emacsclients' filesystem and not the server's filesystem. For instance, if I set up an emacs server on a machine "darkstar" and I connect to this…
fthinker
  • 646
  • 2
  • 9
  • 17
4
votes
3 answers

Emacs - connect to daemon (if it exists) without using emacsclient

If I have emacs running as a daemon on my system, I can connect to it easily using emacsclient. This I know. However, what I would like to know is, is there a way to tell emacs (not emacsclient) to behave like emacsclient if a daemon is already…
bstamour
  • 7,746
  • 1
  • 26
  • 39
4
votes
4 answers

Alias to make emacs open a file in a new buffer (NOT frame) and be activated/come to front?

What I have so far is alias em="open -a /Applications/Emacs.app "$@" && osascript -e 'tell application "Emacs.app" to activate'" But I am stumped. With that code, em file.txt will activate, but won't open the file. And I get '22:23: syntax error:…
tobeannounced
  • 1,999
  • 1
  • 20
  • 30
4
votes
2 answers

How can one specify a user's emacs init file to load with emacsclient?

Question How can one specify a user's emacs init file to load with emacsclient? emacsclient does not understand '-u user' and '-a ALTERNATE-EDITOR' does not allow me to quote it and provide '-u user'. For example, running: /usr/bin/emacsclient -n -a…
vlee
  • 1,369
  • 3
  • 14
  • 23
4
votes
0 answers

How does emacs client work?

How does emacsclient communicate with emacs server ? Is it through some kind of socket connection? If so, are there any docs available to read about the protocol ? Where can one read the source of emacsclient?
pankajdoharey
  • 1,562
  • 19
  • 30
4
votes
1 answer

emacs --daemon with --batch and input file

I would like to create a script that simply cleans up the whitespace and tabs on several files in a folder for me. I have created a bash file with among other things: emacsclient -t -e '(progn (prelude-cleanup-buffer-or-region)…
Mike H-R
  • 7,726
  • 5
  • 43
  • 65
3
votes
1 answer

How to set emacsclient background as Emacs background?

I've got (in my .emacs) (set-background-color "#101416") (set-foreground-color "#f6f3e8") And I've got 2 bindings: alias ex='emacsclient -nw' alias ec='emacsclient -c -a ""' ex works fine to open client in terminal but when I want to open it as a…
cnd
  • 32,616
  • 62
  • 183
  • 313
3
votes
1 answer

Emacs daemon: swapping keys

I'd like to swap C-x and C-u with Emacs daemon (since I switched to Dvorak layout). The regular keyboard-translate doesn't work with Emacs daemon. In the help-gnu-emacs I found a solution: I should use (define-key key-translation-map ...) instead…
falsum
  • 349
  • 1
  • 7
3
votes
2 answers

Using a single emacs instance from multiple (virtual) machines

I love emacsclient. It allows me to use a single Emacs frame for all my editing, also when programs want to open an editor (i.e. export EDITOR=emacsclient). I'd like to have it work like this with virtual machines, too. I can use tramp to edit…
Petri Lehtinen
  • 1,995
  • 2
  • 17
  • 22
3
votes
2 answers

how to use emacsclient -e "command" to convert a .org file to html?

I want use emacsclient -e "command" to covert org mode file to html file, such as: emacsclient -e "(org-html-export-as-html ./mynote.org)" > ./mynote.html hope it will be save output to mynote.html file. But I'm not familiar with elisp yet.…
LoranceChen
  • 2,453
  • 2
  • 22
  • 48
3
votes
2 answers

How can I set styling and positioning of a newly created emacsclient?

I've recently switched to emacsclient for most text editing. I am trying to migrate some of my settings to the new (and slightly different) environment. In particular, in my .emacs file I have a function that sets the window size, and prepares some…
Willi Ballenthin
  • 6,444
  • 6
  • 38
  • 52
3
votes
4 answers

emacsclient font check not working

I am trying to set my font for emacsclient like so: (let ((default-font (cond ((member "Inconsolata" (font-family-list)) "Inconsolata 14") (t "monospace 20")))) …
Jackson
  • 9,188
  • 6
  • 52
  • 77
3
votes
1 answer

How do I start emacs from the command line but use emacsclient if a server is already running?

I'm using emacs under Ubuntu If I want to edit a.txt then I either click on the emacs icon or use $ emacs --geometry 10x10 --fullscreen --no-splash ~/a.txt & from bash. My .emacs file starts the emacs server. If I then want to edit another file…
John Lawrence Aspden
  • 17,124
  • 11
  • 67
  • 110
3
votes
1 answer

remote emacs client connects, but doesn't create new frame in terminal

I configured and started an emacs server in TCP mode: Added (setq server-host "10.16.184.33") and (setq server-use-tcp t) to .emacs ran emacs --daemon On the same host, running emacsclient -t brings up an emacs frame in the current terminal, and…
Joe Doyle
  • 432
  • 3
  • 10
2
votes
1 answer

Emacs 24 - daemon mode missing -c/-t options?

I'm running the latest beta release of Emacs 24. I can get it to start in daemon mode, however I can't create new consoles or anything. It appears that the -c and -t commands aren't options anymore, even when looking under the help section. Any…
user319436