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

How do you grep from within emacs ( git grep 'foo' | grep baa )

I do this often after shelling out to bash $ git grep 'banner-image' | grep mb3 Can I do it without leaving emacs?
2
votes
1answer
366 views

How to run emacsclient from applescript?

I am using https://github.com/sprig/org-capture-extension which is a cool Chrome extension to capture links while browsing. The setup on OS X requires defining an Applescript application which is ...
1
vote
1answer
3k views

Setting up emacsclient (OSX)

I am trying to set up emacs to run as a server to avoid the time required to open individual sessions for each file. This is on OS X El Capitan. Using the instructions provided here, I have the first ...
9
votes
2answers
1k 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 ...
0
votes
0answers
33 views

emacs: leaving buffer in terminal emacs

After opening a file with emacsclient -nw foo.txt I see When done with a buffer, type C-x # in the minibuffer. I however habitually do C-x C-c instead of C-x # Is there a practical difference ...
3
votes
1answer
907 views

Attempt to delete minibuffer or sole ordinary window

I have a daemonized emacs, and I'm able to close any emacs frame, even the last one, using the window manager or old good C-x C-c, just to be able to retrieve all my buffers when i ask the daemon for ...
2
votes
0answers
157 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 ...
0
votes
1answer
51 views

Linking Multiple Implementation Files in C on Emacs

I need help with linking multiple c source code files on emacs. Could anyone show me the way on how to work this out? Thanks!
1
vote
0answers
40 views

Running emacsclient causes some flashing effect to happen on other frames

I picked up this code from: Is there any way to run a hook function only once? (setq myGraphicModeHash (make-hash-table :test 'equal :size 2)) (puthash "gui" t myGraphicModeHash) (puthash "term" t ...
1
vote
0answers
257 views

emacs ssh client on windows

I have emacs installed on linux machine, and for most times, I need to connect to the machine on my windows laptop, previous I use putty, but I found it has issue with emacs keybindings, some key ...
0
votes
1answer
1k views

How can I get `emacs --daemon` to load the Spacemacs configuration?

I have configured my ~/.emacs so: It either launches default emacs via the default init.el, or runs the Spacemacs init.el I run Spacemacs via a spacemacs shell script, ~/bin/spacemacs #!/bin/sh ...
6
votes
1answer
577 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 ...
2
votes
1answer
48 views

How do I prevent emacsclient --tty FILE from flashing the other frame's buffer before loading FILE

With emacs -Q if you M-x server-start, then open a buffer, then back in the terminal emacsclient --tty SOMEOTHERFILE a new frame will be created, but it will initially show the buffer shown in the ...
16
votes
3answers
436 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 ...
0
votes
2answers
954 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" "--" ...
3
votes
1answer
463 views

Run command after opening a file with emacsclient [closed]

Is it possible to specify an argument for emacsclient to run a command in the opened file? I would like to set the editor of a program to emacsclient -r '(search-forward-regexp "^<<<")'. ...
2
votes
1answer
88 views

How to vertically center when opening a file:line from emacsclient?

Is there a way to center the vertical scroll position when using emacs client to open a file at a position? eg: emacsclient +$NUM:$COL $FILE --no-wait --alternate-editor=emacs Is it possible to ...
10
votes
4answers
5k 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 ...
1
vote
1answer
683 views

emacsclient not opening correctly in GUI mode

I installed emacs with homebrew and cask: brew cask install emacs It installed emacs 25.1.1. I then linked the plist file to start emacs as a daemon on start up with: launchctl load ~/Library/...
3
votes
2answers
314 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 ...
0
votes
0answers
51 views

recentf cleanup upon mode enabled: not saved in the actual recentf-save-file

When Emacs starts, it reports a non-existent file is removed from recentf. However, that removal was never saved to the recentf-save-file: the next time Emacs starts, the same removal is reported ...
1
vote
2answers
119 views

local-function-key-map gets overwritten by emacsclient

The following .emacs file works as expected, so long as I invoke emacs the "normal" way (ie by launching the emacs executable directly). (global-unset-key (kbd "C-]")) (global-set-key (kbd "H-C-]") '...
2
votes
2answers
101 views

Count only frame opened outside of terminal?

I want to enforce only one GUI instance for Emacs, so I want to check if at least one GUI frame is open or not (i.e. the frame that is open with emacsclient -c), and ignore the ones opened in Terminal....
6
votes
2answers
6k 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 ...
0
votes
3answers
836 views

ein failed to login to 8888

I was using emacs-ipython-notebook for data visualisation for some days.But then I started getting the error -ein failed to login to 8888.I checked my ipyhton notebook server and it's running on ...
1
vote
1answer
823 views

emacsclient --eval command to bring a background emacs window to front

Suppose I already opened a emacs but its in the background. So, is there an emacsclient eval option that I can type in the shell like: emacsclient --eval "(bring-existing-emacs-window-to-front)" To ...
0
votes
1answer
347 views

emacs --daemon is not loading gui elements

I defined emacsclient as default editor in .bashrc so emacs -daemon will be called upon startup: export ALTERNATE_EDITOR="" export EDITOR=emacsclient But compared to a normal load without client, if ...
2
votes
0answers
70 views

make-frame-on-display & emacsclient fail w/ exported display while other apps are fine

I am connecting to my office GNU/Linux box from a windows laptop through a putty ssh tunnel. I have also on the laptop the java WeirdX X11 server, that is declared in putty to use the localhost:2 (...
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
71 views

Preventing emacsclient -c from bringing both Emacs frames to the front

Environment Cygwin, emacs-w32 variant. Use case Setting up my editor for git commits from the terminal. Problem When I do a git commit from a terminal, I have it setup to do emacsclient -c I get a ...
3
votes
1answer
180 views

What are the actual usage of the command `server-edit`?

According to the documentation of the command server-edit: Switch to next server editing buffer; say "Done" for current buffer. If a server buffer is current, it is marked "done" and optionally ...
2
votes
1answer
181 views

Error loading new emacsclient frame

Recently I was looking for run emacs as daemon in linux, whats give me the oportunity to use org-carture from everywhere in the sistem for example. My first aproach was start it in the init.el file, ...
3
votes
1answer
819 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 ...
2
votes
0answers
69 views

emacsclient -c new frame cannot have an individual new sr-speedbar

Since emacsclient depends on emacs server, when I first start emacs server and then try: emacsclient -c -n -a emacs --eval "(sr-speedbar-open)" It reports that sr-speedbar is arlready opened. Is it ...
3
votes
1answer
392 views

emacsclient opens a file and does eval simultaneously

I know that emacs can open a file while evaluating an expression: emacs file --eval "(toggle-frame-maximized)" However I failed to replicate this with emacsclient: 1.emacsclient can open a file: ...
9
votes
2answers
192 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 ...
2
votes
1answer
432 views

What is the use for server-edit (C-x #)

This is my current Emacs workflow: emacs --daemon emacsclient -c then editing few files and saving some of them (and keeping some of them unsaved and open on the server for later edit); then ...
0
votes
0answers
49 views

Correct commandline options (by pure elisp) for emacsclient to create a new frame only if the file is not already open otherwise switchs to it

If I invoke emacsclient with emacsclient -na runemacs file1 emacsclients switch to the frame containing file1. But if later I invoke emacs with emacsclient -na runemacs file2 emacsclient opens file2 ...
4
votes
1answer
238 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
2answers
329 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-...
2
votes
0answers
67 views

Hide emacs icon when client is off

I am running emacs as daemon, in MacOSX, it works flawlessly but when I kill the client the icon remains in the dock as running. I searched around for a way to hide it when no client is running but I ...
0
votes
0answers
135 views

Is it possible to keep window set up when connecting via emacsclient?

I love using Emacsserver and Emacsclient, as it saves all of my buffers so that if I log in via ssh and then log out, all of my buffers are saved. However, when I log into Emacsserver after quitting ...
2
votes
1answer
323 views

How to check for emacs being initialized in daemon mode?

I use emacs gui in daemon mode and also in standalone terminal mode. There is a package that I just want to use when I'm using emacs in terminal mode. the problem is that I can't use (display-...
1
vote
1answer
252 views

Why is exec-path different in emacsclient / emacsserver than in emacs?

I am trying to run an identical emacsserver setup as the emacs I normally use. I am having issues because the emacsserver has a different exec-path variable when it starts than when normal emacs ...
4
votes
2answers
2k views

How to paste from clipboard litterally into emacsclient within an ssh session?

This is a long-standing problem that I haven't found a solution for months. I sometimes copy text or snippet from somewhere relse and paste into my emacsclient in the Terminal by Ctrl + Shift + V (...
3
votes
1answer
261 views

emacsclient, c-x #, c-x c-f and other confusion

I have used emacs for several years now and wanted to make the leap to daemon mode and using emacsclient. What has prevented me so far is getting ride(closing) of buffers opend via emacsclient. Note ...
0
votes
2answers
877 views

Please help me get emacsclient working

OS X 10.11 Emacs 24.5: /Applications/Emacs.app emacsclient: /Applications/Emacs.app/Contents/MacOS/bin-x86_64-10_9/emacsclient (server-start) in my .emacs file % emacsclient some-file Result is: /...
3
votes
1answer
197 views

Avy - Moving Between Terminal Frames

I've only just recently started using avy to navigate inside my buffers and it seems to work nicely. As for my question however, with avy-all-windows set to all-frames I am able to navigate between ...
2
votes
1answer
241 views

`server-start` hook?

Is there a hook to execute stuff after I've run emacs --daemon? I'd like to keep load stuff only when running emacs --daemon and not when running emacs. I know it sounds like using square wheels, but ...