Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [subprocess]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
29 views

Not asking to kill a dead process?

When I hit g (recompile) in a *Compilation* buffer while the previous compilation is not done yet, I am asked whether I want compilation killed. If I wait for it to finish, I get the echo area look ...
sds's user avatar
  • 6,124
1 vote
0 answers
75 views

How can I execute synchronously a xdotool process in an Elisp function?

I want to perform a repetitive task using Emacs and another program (which, unfortunately, runs under X). I have then set up an elisp function and a xdotool script to do the two parts of the work. The ...
Alessandro Bertulli's user avatar
0 votes
2 answers
34 views

Test whether a non-Emacs system process is running and, if so, kill it

I'm running Emacs on Ubuntu 20.04.04 LTS with the GNOME desktop and Xorg window system. I launch a file previewer located at /usr/bin/sushi with: (start-process "proc-name" nil "/usr/...
lawlist's user avatar
  • 19.2k
2 votes
1 answer
76 views

Convenient piping for multiple processes?

Is there a convenient way to pipe processes into each other? (without relying on the shell as this won't always work predictably on WIN32 - I'd assume). e.g. (call-process-pipe-chain '("ls"...
ideasman42's user avatar
  • 8,826
0 votes
0 answers
72 views

start-process permissions in Windows

I can open an HTML file using shell command: M-! start file.html, but when I try to write an elisp function which includes the line (some of these arguments are actually variables but I've written out ...
hatmatrix's user avatar
  • 1,096
2 votes
0 answers
84 views

How to avoid losing focus after starting an asynchronous process?

The lisp function start-process is meant to start an asynchronous subprocess, namely a process running independently of Emacs itself. I have noticed that, under my GNOME desktop environment, when my ...
Ruy's user avatar
  • 839
0 votes
2 answers
64 views

Looking for a better way to test whether the current Emacs process is running under GNU Screen

NB: For the sake of this question, please assume that the underlying OS is some flavor of Unix. If more specificity is required, then please assume that it is either Darwin or some flavor of Linux. ...
kjo's user avatar
  • 3,247
0 votes
1 answer
130 views

Getting the PID of process initiated with call-process

Is there a way to find out the pid of an emacs subprocess started with call-process? I realize that the return value of start-process is precisely its pid but I would like to know the pid of a ...
Ruy's user avatar
  • 839
2 votes
1 answer
383 views

How to stop a subprocess?

I am unable to make stop-process work. I expect that it behaves as C-z in a terminal so that I can later continue it with continue-process. Minimal not working example: (setq ptest (start-process &...
Firmin Martin's user avatar
1 vote
1 answer
259 views

How to start a persistent asynchronous process trough emacs?

I am writing a lisp program to be run as a batch file through emacs. The program calls an external application which is supposed to stay running after the call to emacs finishes. The two basic ways ...
Ruy's user avatar
  • 839
2 votes
1 answer
346 views

start-process: Setting current directory: No such file or directory

I have a timer which call a function itself calling start-process. Whenever the current buffer's directory changed (deleted/moved), I have the error start-process: Setting current directory: No such ...
Firmin Martin's user avatar
1 vote
1 answer
186 views

How can I run a subprocess with emacs --script

I'm trying to write a script using emacs --script and in it I am using start-process, because I want to use set-process-filter. The following does nothing if run as a script: #!/usr/bin/env -S emacs -...
theia-jane's user avatar
0 votes
1 answer
450 views

Cannot paste text copied from Emacs to synchronous subprocess

TL;DR When trying to paste text copied/killed in Emacs to another program while Emacs is waiting for a synchronous subprocess to finish, the target program hangs until Emacs becomes responsive again. ...
kdb's user avatar
  • 1,561
1 vote
0 answers
59 views

How to prevent emacs hanging when 'accept-process-output' is called multiple times on a single process?

I'm running into a bug where Emacs locks up when accept-process-output is being called on the same process multiple times. In this case this is the ispell-process, however I don't think that matters ...
ideasman42's user avatar
  • 8,826
4 votes
1 answer
2k views

How to run a custom formatting tool on save?

While there are packages that format on save, I'd like to be able to run a custom command that auto-formats a file on save. Upon saving it runs an external process that: Takes the buffer as stdin. ...
ideasman42's user avatar
  • 8,826
2 votes
1 answer
83 views

Troubleshooting a hanging `list-processes`

Normally I'd use M-x list-processes to see what Emacs is running in the background. But in this case list-processes itself hangs. What is the right thing to do in this situation?
Matthew Piziak's user avatar
1 vote
0 answers
54 views

Allow user to interact with subprocess

I would like to call a subprocess, and that subprocess has some interactive behavior. Thus, I would emacs to parse the output of the subprocess, ask the user for input, and then hand that input back ...
quackrabbit's user avatar
0 votes
0 answers
65 views

How can I make multiple calls to external binaries?

I want to write an interactive function to Call an external binary Write the output of the binary into a buffer Process the buffer to extracts args for next call Call another external binary using ...
Realraptor's user avatar
  • 1,293
1 vote
2 answers
645 views

Multi-processing via TRAMP with asynchronous shell commands

I found the following code in TRAMP: (defun tramp-adb-handle-shell-command (command &optional output-buffer error-buffer) "Like `shell-command' for Tramp files." (let* ((asynchronous (...
Alexander Shukaev's user avatar
1 vote
1 answer
365 views

how to do command substitution in eshell generally (NOT just for loop)

How to do command substitution à la Bash in Eshell, and not just for loops? (Unfortunately, while this question asks my question, its answer only provides Eshell for-loop syntax. So please don't dupe ...
TomRoche's user avatar
  • 632
4 votes
1 answer
133 views

How to partially block user input while Emacs subprocess is running

I have a custom function that updates the etags file before prompting the user to input a desired tag to be located. Although I am pretty good about setting the current buffer to read-only before ...
lawlist's user avatar
  • 19.2k
0 votes
1 answer
172 views

How to let make-process prompt user in echo area

This works: (make-process :name "test" :command (list "bash" "-c" (concat "echo hello stdout!; " "echo hello stderr! >&2; " "exit 20")) :buffer (generate-new-buffer "...
american-ninja-warrior's user avatar
3 votes
1 answer
346 views

Execute program on string

I am trying to execute an external program on a string. This code works, but it saves the string to a temporary file in order to run call-process. This seems quite roundabout. I'd rather not use a ...
Hatshepsut's user avatar
8 votes
3 answers
2k views

Set environment variables for spawned subprocesses

I would like to set the environment variables for a spawned subprocess only. They are controlled by process-environment. The documentation says: binding that variable with let is also reasonable ...
antonio's user avatar
  • 1,822
10 votes
1 answer
537 views

Process input seems buggy in Emacs on OS X

I have a process that I'm trying to send input to on OS X. I'm using Emacs' builtin functions for doing this: process-send-string and process-send-region. However, it seems that there are issues when ...
GDP2's user avatar
  • 1,350
5 votes
1 answer
496 views

Asynchronous version of shell-command-on-region?

I have a problem which is very similar to this one. I have some text that I'd like to listen to with macOS's say utility. Unfortunately, Emacs locks up when I use shell-command-on-region because it is ...
GDP2's user avatar
  • 1,350
1 vote
1 answer
164 views

Eshell simple echo in parenthesis not working

Why doesn't the following work in eshell $ (echo "foo") Symbol's function definition is void: echo What I tried: googled eshell parenthesis not working More Context: Eventually I'm trying to ...
american-ninja-warrior's user avatar
1 vote
1 answer
393 views

How to run a command via elisp, completely ignoring its output and status? (fire and forget)

Currently I'm using shell command - which makes a buffer, showing the output, sometimes locking emacs. What is a good way to run a process that: Doesn't make a buffer. Doesn't lock emacs. Ignores ...
ideasman42's user avatar
  • 8,826
0 votes
1 answer
298 views

redirect stderr to a file in call-process-region

I have been reading the documentation for call-process-region here and I am trying to redirect stderr to a file. from the the documentation, this looks correct (call-process-region beg end perltidy-...
Prgrm.celeritas's user avatar
1 vote
1 answer
91 views

Cleanly terminating asynchronous process after it reads stdin

I'm starting a process with start-process and immediately calling set-process-sentinel to get notifications when it ends. After attaching the sentinel I send the buffer's contents to the process's ...
abingham's user avatar
  • 927
0 votes
0 answers
125 views

Retaining focus while displaying graphics windows

NB: The Emacs world uses the word frame to refer to what in most other contexts is called window, and uses the word window to describe something else. In this post, however, the word window always ...
kjo's user avatar
  • 3,247
1 vote
1 answer
99 views

Wait for (tex-file) to execute before go on with an elisp script

I wrote a script that reads the .aux and .log files after some replacements in the ·tex file (LaTeX). To achieve this i did: (tex-file) (read-string "Wait to tex-file to complete, then press ...
Gabriele's user avatar
  • 1,618
5 votes
1 answer
202 views

How to attach/connect two subprocesses?

The general case: Simply put, given that I start two processes (Aand B) with, e.g., async-start-process, what is best way of killing B if A terminates? My specific usecase: I'm debugging embedded ...
thomsten's user avatar
3 votes
4 answers
2k views

How can Emacs set an environment/shell variable in a subordinate shell?

I often use subordinate shells within Emacs. (I instantiate these shells with M-x shell.) I put all these shells under auto-save-mode (through my shell-mode-hook; see below). Is there some way that ...
kjo's user avatar
  • 3,247
1 vote
1 answer
74 views

install missing external packages automatically from within emacs

I have some snippets in my config, that depend on external tools. For example I use xmodmap at startup. (if (eq window-system 'x) (if (file-exists-p "/usr/bin/xmodmap") (shell-command "...
bertfred's user avatar
  • 1,729
0 votes
2 answers
262 views

Windows eshell alias command line arguments.. how?

I have alias msexcel (w32-browser "C:/program files/microsoft office/office12/excel.exe") and this means I can do msexcel from eshell and an asynchronous MS Excel will begin to run. I am looking for ...
vpit3833's user avatar
  • 111
1 vote
1 answer
262 views

Quicklook in dired-mode using a process/sentinel with external viewer

In dired-mode, I use an external quicklook tool on OSX called qlmanage, which pops open a window displaying a human readable image of the file with mouse scrolling capabilities. If I hit the space ...
lawlist's user avatar
  • 19.2k
0 votes
1 answer
314 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-...
user3139545's user avatar
0 votes
1 answer
383 views

communication with remote inferior python shell slowing down code editing

I am working with python code on a remote machine using tramp. Once I start the start the remote python shell, the editor window starts to freeze up for around/under a second second at a time, but ...
Daniel Mahler's user avatar
4 votes
1 answer
408 views

How does one create back and forth communication to a process

I am writing an emacs mode that interfaces with a shell process. The shell process is expensive to start which means that I would like to do it once and then send commands to it from emacs as need be. ...
Jules's user avatar
  • 1,225
1 vote
0 answers
284 views

How to avoid slow response by set-process-sentinel to process that produces many lines of output

I am running a command that produces a few thousand lines of output, which I would like to store in a buffer. I want to run it in the background and be alerted when it is finished. The problem is that ...
Ben Maughan's user avatar
4 votes
2 answers
1k views

Interpret terminal escape codes in generic process output

I'm running a (start-process) which spits out terminal escape codes into a buffer and it looks ugly. Is there a mode that will interpret these codes into colors? Something similar to whatever ansi-...
erjoalgo's user avatar
  • 873
8 votes
1 answer
359 views

Read process output line by line

If there a way to read the output of a subprocess line by line, or at least to get it in small batches? I have a subprocess doing work in the background, and printing a line every time it completes ...
Clément's user avatar
  • 3,995
5 votes
1 answer
857 views

Capturing stderr of subprocesses

I'm trying to capture stderr separately from stdout for a (synchronous) process run from emacs. I've found one way of doing it based on some code copied from emacs' shell-command function (I don't ...
dshepherd's user avatar
  • 1,281
10 votes
1 answer
181 views

How do I prevent one subprocess from starving others?

To be clear, I'm not talking about anything that should require emacs to be multithreaded (though that would probably also solve this). To reproduce: emacs -Q # I'm running 24.4.1 Make a second frame ...
Joseph Garvin's user avatar
4 votes
2 answers
886 views

What is the syntax for a subshell in eshell?

How to write the analogue of a bash-command like: (cd ../repo && git fast-export master) | darcs convert import repo_master in eshell? Here a subshell is employed to restrict the effect of ...
imz -- Ivan Zakharyaschev's user avatar
6 votes
2 answers
659 views

Temporarily set the `default-directory` for `start-process`

Is it possible to set the default-directory temporarily (e.g., let-bound) when using start-process? If so, how please. (let ((default-directory "/Users/HOME/Desktop/tmp")) (start-process "touch-...
lawlist's user avatar
  • 19.2k
15 votes
2 answers
2k views

How to prevent slow-down when an inferior processes generates long lines?

I use Emacs with Geiser to hack on some Scheme code. As I'm playing around in the REPL I sometimes evaluate expressions that result in a lot of output, often all on one line. For example, I just ...
user avatar
1 vote
1 answer
554 views

How to set up Emacs with Clozure CL but without SLIME

I want to manually set up my own Emacs CL environment on Mac OS X 7 without the SLIME package i.e. it will only use Clozure CL. To put it other way, I want to use the Emacs CL just like I use the "...
Terry's user avatar
  • 370
4 votes
1 answer
740 views

How do I pass all the output of process to a function?

I want to call a command asynchronously, and define a function that handles output from that command. I don't want to simply write output to a buffer. According to the Elisp info (36.9.2 Process ...
Wilfred Hughes's user avatar