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.

0
votes
1answer
36 views

How to find out if a file is visible for my shell script?

I want to implement a script that I can call from my file explorer to be able to open a new frame with the chosen file (emacsclient -nc $1), but only if the file does not already exist then I simply ...
1
vote
0answers
23 views

How to always show buffer in the new created frame?

My workflow is: I initialize emacs with a shortcut (in my ~/.i3/config I have a line like this bindcode $mod+49 exec emacsclient -c -n -q -a=''. I use i3wm.org) By default it goes to temp.org, in ....
0
votes
1answer
20 views

Can't use .bashrc file on remote server from ssh within emacs

Login to remote server with ssh in Emacs, general commands run well. Such as ls, docker ls, etc. C-x C-f /ssh:... But when I tried to run a command which alias to another which set in the .bashrc ...
0
votes
0answers
20 views

formatting dates in Emacs when run as a daemon

I run Emacs on a Linux (actually Xubuntu 19.04) machine and my localization settings call for an Italian locale. When generating timestamp, however, I'd like to have English months and weekday names....
0
votes
0answers
20 views

Running emacsclient does not load my display settings

I'm trying out emacs daemon and emacsclient in Linux. There's one thing I haven't been able to figure out: whenever I run emacsclient, my display settings (e.g. font) don't load, as opposed to what ...
1
vote
1answer
22 views

emacsclient -c stopped working, server running, emacs works

I am encountering a very strange problem. I worked with emacsclient for a while but suddenly, after starting an emacsclient frame the frame disappears shortly after start when interacting with it. It ...
1
vote
1answer
27 views

How to convert a package to a layer in spacemacs

I am new to the world of Emacs, and like most ex-vimmers, I am starting with Spacemacs. I have been trying to find time to do some leetcode and would like to use the package leetcode-emacs. I have ...
1
vote
1answer
87 views

Can you install Emacs temporarily for testing purposes like new versions and packages?

Is there a way I can install two versions of Emacs on the same machine ? The last time I tried installing versions 24 and 25 neither of the installations was working and the easiest solution was to ...
2
votes
1answer
57 views

Launch an emacsclient instance in a new terminal window

I am using Sway/wlroots and I decided to switch to using terminal emacs for the forseeable future as there is no transparency in the xwayland version of emacs. I previously bound emacs to run as a ...
0
votes
3answers
56 views

How to prompt to ask for confirmation when C-x C-c in emacsclient?

I use (setq desktop-save 'ask) in my init.el, so every time I C-x C-c to exit Emacs, it will prompt to ask if saving desktop or not; I use this trick to avoid accidentally exiting Emacs. But after ...
0
votes
1answer
36 views

Highlight some specific text in Emacs

I am using web-mode for my php files: http://web-mode.org/ And I call often a php function which looks like this: __lg('Some text here', 'Global', NULL, FALSE); This function can be call with only ...
0
votes
0answers
26 views

Emacsclient uses new instance, weird font

When I open Emacs normally (using runemacs.exe), everything appears fine, including the font. However, when I try opening a file in Emacs using the client, while getting the client to start the server ...
1
vote
1answer
37 views

How do I specify a daemon to start with alternate emacs version with emacsclient

I have found this script from here #!/usr/bin/env zsh # Checks if there's a frame open emacsclient -n -e “(if (> (length (frame-list)) 1) ‘t)” 2> /dev/null | grep t &> /dev/null if [ “$?”...
0
votes
0answers
21 views

Reconnect to the restarted daemon

I have started emacs (v26.1) server: $ emacs --daemon I connected using $ emacsclient -t From within emacs, well spacemacs, I restarted the daemon SPC q r, which executed dotspacemacs/resume-...
0
votes
1answer
58 views

On emacs26, is it possible to halt initializing and attach to running emacs-server with init.el?

I'm using emacs26 on macOS and using server-client for the fast initialization. However, it's a bit annoying that a new emacs instance is always spawning when I run "Emacs.app" with SpotLight instead ...
2
votes
1answer
103 views

Why are emacsclient and emacs separate programs?

I really like the client-server structure of emacs. However, I feel uncomfortable to run 'emacsclient' to attach to running emacs server. Is there any specific reason that emacs seperated emacsclient ...
1
vote
2answers
39 views

Mac OS X: How to permanently change the prompt (value of PS1) in the shell of emacs client?

I have start emacs as daemon through (emacs --daemon). I then launch the client (emacsclient -c) and use its shell mode through (M-x shell RET). However the prompt starts with: bash-3.2$ I have ...
2
votes
2answers
93 views

Opening file with emacsclientw, file name contains non-latin characters

My first post here about Emacs. I've spent days trying to figure out answer before posting here. I'm running Emacs 26.1 on Windows 10. The setup that I'd like to have is running a single instance of ...
0
votes
0answers
26 views

Cannot use toggle-input-mode in emacsclient

Recently, I 'm using gnu-apl and I need to change the input mode. When I use it in emacs it works well, but inside and emacsclient it doesn't work I cannot select any different input: With emacs: ...
0
votes
0answers
32 views

emacsclient exits unexpectedly without any error

I've built GNU Emacs 27.0.50 from source in Ubuntu 18.10. Then started the daemon as a systemd unit: [Unit] Description=Emacs text editor Documentation=info:emacs man:emacs(1) https://gnu.org/...
1
vote
0answers
59 views

Unable to use emacsclient with emacs server when running mac port of emacs

I am running the mac port version of emacs that I installed via homebrew (see here). I'm also trying to run the Emacs server to avoid long startup times. To do this, I first run the server: /...
1
vote
0answers
142 views

Global display line numbers mode not working

I can run (display-line-numbers-mode) and get line numbers but it doesn't work if I run (global-display-line-numbers-mode) (nothing happens). I have traced this to this function: (defun display-line-...
0
votes
1answer
55 views

Emacs: Error message when sending a region to a sql connection buffer: Wrong type argument: processp, nil

Based on the article here: https://emacsredux.com/blog/2013/06/13/using-emacs-as-a-database-client/ I wish to have a .sql buffer to edit my queries and once prepared send it by (C-c C-r) to an already ...
1
vote
1answer
37 views

output emacs buffer to another terminal window

I'm wondering if it's possible to have a terminal windows running emacs talk to each other (running in a server environment) For example: Open an instance of emacs in one terminal window. Open up a ...
1
vote
1answer
121 views

Remove emacsclient startup message

How do I go about removing the message "When done with this frame, type C-x 5 0" when launching emacsclient? I know it's possible to controll the startup message of emacs when not launched as a ...
1
vote
1answer
116 views

How to use emacsclient in terminal to switch git branches?

I'm trying to make a setup that will use emacs as a command line tool to switch git branches. The idea is to run some command in terminal, something like emacsclient -t -e "(magit-checkout)". This ...
4
votes
1answer
333 views

Why does using emacsclient from a remote host connect to the right socket, but I see nothing in my local Emacs?

I'm running a TCP server locally, and I'm trying to open a file from a remote host on my local Emacs through emacsclient. The reason for this is that I have emacspeak running locally which gives me ...
0
votes
0answers
64 views

Using Emacs as a daemon (emacsclient) exhibiting weird behavior

Whenever I use Emacs as a daemon it seems like my init file isn't being fully loaded. My keybindings in particular are acting very odd. I use some unorthodox keybinds; for example: Ctrl+u = ...
1
vote
1answer
135 views

emacs --daemon crashes when parent ssh session dies

I'm using emacs 26.1 (although I don't think this is a new issue with this verison). Note - this is not the GTK bug which results in the daemon crashing if X Connectivity is lost. I am aware of that ...
1
vote
0answers
41 views

emacsclent -nw hangs

As I use emacsclient -nw -c in a terminal e.g. xterm -e emacsclient -nw -c, emacs hangs when I resize horizontally (to the minimum allowed by the wm). I can't no longer launch any emacsclient window, ...
-1
votes
1answer
40 views

Eshell - ./hello command not found(gcc)

emacs was installed by Msys32 on Win7 32bit! gcc can't run hello.c on eshell but on minibuffer, Why?
0
votes
1answer
44 views

Empty buffer shows when using emacsclient on windows

I am using GNU Emacs for Windows alongside of cygwin, and I want to set my EDITOR shell variable to be emacsclient -a=. My problem is that when certain programs try to use EDITOR to launch an editor ...
0
votes
0answers
36 views

How to open file in emacsclient in current tmux pane?

I cant get tmux to run command to open file in emacsclient. I have that in tmux config: bind -n M-F run "emacsclient -c /home/sandric/.tmux_history" Executing shortcut gives me error "emacsclient ...
0
votes
0answers
79 views

Emacs client doesn't connect to running server on Windows

I have fresh new installation of emacs altogether with spacemacs. I set env vars for alternate editor and server file. My server file after starting emacs looks like: 127.0.0.1:64518 11948 'M.P$#NT[...
0
votes
0answers
99 views

Running Emacs as a client does not load my settings

I'm using the new systemd daemon option with Emacs 26. I have a problem, though. If I open a client instance (emacsclient -c) no config files (my .emacs) are loaded. So I don't see the usefulness in ...
7
votes
2answers
341 views

Unable to connect using emacsclient

I am starting the emacs server using systemctl --now --user enable emacs That server is running, if I run systemctl --user status emacs I got $ systemctl --user status emacs ● emacs.service - ...
1
vote
1answer
125 views

Can I exit the second client without closing the first client's buffers that were opened in the second client?

First I ran emacs --daemon. Then in one shell, I ran emacsclient -nw and open several files in the buffer. Then in another shell, I did the same thing. At the same time I found that the file buffers ...
0
votes
0answers
30 views

Decryption and emacs client

I started using (server-start) recently and only using emacs client (with -c -a emacs option). The expected behavior when opening a .gpg file is that epa automatically tries to decrypt the file but ...
0
votes
1answer
69 views

emacsclient “unknown command” when opening file

Whenever I try to open a file with emacsclient (and emacs is running, and the server is running, and the socket is there), I get this error message: Marcins-MBP:docker-influxdb-grafana marcin$ ...
1
vote
1answer
134 views

How do I focus Emacs from elisp in macOS?

I want to focus emacs by running some elisp. I have tried using do-applescript and the following snippet to focus Emacs: if application "Emacs" is running then tell application "System Events" to ...
2
votes
0answers
43 views

Launching GUI emacslient destroys terminal frame resizing capabilities

Whenever I launch a GUI session as $ emacsclient -c all the emacsclient sessions I've created with $ emacsclient -nw -c lose several settings. The problem only occurs right after launching a GUI ...
2
votes
1answer
153 views

tool-bar in emacsclient

I have the following for ridding of the toolbar on startup in graphical mode in my init configuration: (if window-system (tool-bar-mode -1) ) the issue: it works fine (albeit slow...see this ...
2
votes
0answers
40 views

How to wait while evaluating an expression with emacsclient?

I use emacsclient regularly to open files. In order to open files owned by root, it is necessary to use tramp. As far as I know this requires the use of the eval option of emacsclient. emacsclient --...
1
vote
0answers
102 views

Possible to pass arguments to emacsclient alternate-editor?

Currently this works: emacsclient ..args.. --alternate-editor=some_editor However this does not: emacsclient ..args.. --alternate-editor="some_editor --args" Is there a way to call the alternate-...
1
vote
1answer
68 views

How to open a file using eval that works with '--alternative-editor'

The following command works to open a file in an existing emacs instance: emacsclient --eval \ "(progn (find-file \\"/a/b.txt\\") (goto-line 1) (forward-char 2) (recenter))" \ --no-wait \ --alternate-...
0
votes
1answer
114 views

How do I exit a serial terminal buffer using keyboard?

I am using emacs for Windows. I start a new terminal using serial-term. Once in that buffer, I cannot open a minibuffer or use meta keys to escape this shell. The only way I can navigate out is ...
1
vote
3answers
524 views

How to make homebrew emacsclient open files in Emacs.app frame from terminal?

When I run emacsclient -nc filename.txt in my terminal, emacs opens in my terminal. I would prefer it to open in the main Emacs.app frame. Similar to how the terminal shortcuts work for Atom.
0
votes
2answers
81 views

How do I do this autumagically in emacs

How do I get emacs to automatically format a large text file like section a to section b. I have tried using notepad++ and a macro, but it just froze my computer section a words wordss wordsss ...
4
votes
1answer
70 views

Access contents of buffers from outside

I want to access contents of emacs buffers from outside like in acme editor. Acme is in part a file server that exports device-like files that may be manipulated to access and control the contents ...
0
votes
1answer
76 views

Running some functions from emacsclient doesn't work

This works: emacsclient -s emacs -e "(call-interactively 'find-file)" But this one doesn't: emacsclient -s emacs -e "(call-interactively 'newline)" In fact, none of the functions I tried to ...