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
0
votes
2answers
827 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
390 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
70 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 ...
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 ...
1
vote
1answer
598 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
274 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
48 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
106 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
96 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....
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 ...
0
votes
3answers
766 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
717 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
310 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
55 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
68 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
173 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
160 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
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 ...
2
votes
0answers
65 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
323 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
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 ...
1
vote
1answer
377 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
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
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-...
2
votes
0answers
63 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
122 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 ...
1
vote
1answer
264 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-...
0
votes
1answer
220 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 ...
3
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 (...
2
votes
1answer
235 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
815 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
171 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
231 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 ...
2
votes
1answer
1k views

Emacsclient not working

I have been using OS X forever. I have been using Emacs forever. I currently use the MacPorts Emacs.app and do (server-start) in my .emacs file. I can't get emacsclient going: > which emacsclient /...
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 ...
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 ...
3
votes
3answers
237 views

Edit file only once and close it

Is there a way to edit a file only once? So that for example: I open it and its closed (the buffer is killed) after the window closes. A clarification: I usually have an Emacs deamon running and open ...
0
votes
1answer
213 views

Can't find autocomplete on MELPA

So I'm following this guide and when I go to M-x package-list-packages there is no auto-complete in the directory. ; start pacakage.el with emacs (require 'package) ; add Melpa to repository list (...
3
votes
1answer
199 views

emacsclient directly start eshell command command line

Both of the following work to call a graphical/terminal eshell: emacs -f eshell emacs -nw -f eshell Furthermore, this 2-step process also works: `emacsclient -t -a '' /some/real/file/name Metax ...
0
votes
2answers
347 views

emacsclient - discard unsaved changes on exit

I run emacs --daemon and emacsclient. When I C-x C-c from emacsclient, it will show the prompt Save file /dir/filename.txt? (y, n, !, ., q, C-r, d or C-h) for each file that has changes that haven'...
2
votes
1answer
225 views

Emacsclient not focusing if called with --eval argument from terminal

I wish to call man function in emacsclient when I typing "man smth" in terminal. When I open files from iterm via emacsclient - emacs gaining focus and when I kill buffer - terminal gaining focus back....
2
votes
1answer
180 views

When returning from emacsclient to iterm2, terminal not getting focus

I'm using iterm2 v3.0.2 with fishs hell and tmux in osx. When I'm opening file via emacsclient and closing buffer - I'm successfully returning to terminal, BUT iterm2 window has no focus, so I have to ...
0
votes
0answers
25 views

Odd filename parsing error when scripting emacsclient on OSX

I get the same error as this Stack Overflow asker when trying to use a wrapper script to tell OSX where the emacs server socket is: I don't think it's a bash issue, as the Emacs PID is correctly ...
3
votes
1answer
246 views

Get emacsclient to reuse exising X-window, iff any [duplicate]

I'm trying to set my desktop environment to use emacsclient to open text files. I would like only one emacs x-window to be opened. Yet I don't know which command can be used to have an x-window ...
2
votes
1answer
714 views

How do I configure home-brew-provisioned emacs to run a GUI-based emacsclient properly?

Configuration MacOSX 10.11.5 emacs version 24.5.1 brew 0.9.9 I want to have the following behavior in my emacs setup: At login, automatically start an emacs server process. Running the /Application/...
0
votes
1answer
196 views

Python server with Elisp Emacs client

Trying to make a small example on how to do IPC with Elisp using Python for the server. My source of information is this Here is the code I have right now. my-process.el (let ((process-connection-...
0
votes
1answer
360 views

I am using emacs on window OS, possible to use multiple monitor?

I got 2 monitors, but emacs can only use one, can I use both of them, so that I could split windows cross both monitors? so If I want to create 2 windows, then each monitor could show me one windows.
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 ...