Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
1answer
16 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
83 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
36 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
38 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
32 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
18 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
35 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
13 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
48 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
100 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
34 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
66 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
22 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
27 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
38 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
111 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
50 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
34 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
100 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
102 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
274 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
59 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 = ...
0
votes
1answer
109 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
37 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
36 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
35 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
31 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
71 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
91 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
318 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
96 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
28 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
0answers
50 views

mutt in emacsclient: how to get the focus back to mutt?

I want to have the focus back to mutt after writing an email in emacsclient. I saw few options on the web, incuding this one (see below) But I am not sure how to implement it. Where should I paste ...
0
votes
1answer
62 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
124 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
126 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
39 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
89 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
62 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
106 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
446 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
78 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 ...
0
votes
2answers
321 views

Emacsclient freezes on terminal [closed]

I run Emacs 25.3 on Mac OS X. I installed it with brew cask. I launch frames with the following set of scripts taken from here I open GUI frames with emacsclient like below #!/bin/bash # Number of ...
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
63 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 ...
1
vote
0answers
42 views

How to RPC from External Process to Emacs

How can I RPC from an external application into Emacs then have a function in Emacs handle the RPC? For example, I would like to make a D3.js webpage with a dependency graph of a codebase, view and ...
3
votes
0answers
48 views

Showing different project-trees in different instances of emacs daemon

At this point I usually hook up into my emacs-daemon using emacsclient -a "" -c "$@". When I also want to display my project using Neotree, this works well for only one instance but if I open a file ...
1
vote
1answer
172 views

Running emacs client: how do you know if the init files had errors loading

I use emacs 25, in nw mode, with "alias emacs='emacsclient -nw'" When I add something to my personal.el, I do brew services restart emacs My issue is, if I make a big blunder inside my personal.el ...
0
votes
2answers
325 views

How to check if my emacsclient is running in a GUI window?

Emacs version: 25.3.50.2 I'm using Fira Code font whose ligatures are now supported by Emacs. To solve this, I used this solution (I think it's not important, just to inform you), say, replacing the ...