Questions tagged [subprocess]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
42 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 ...
1
vote
2answers
39 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 (...
0
votes
1answer
32 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 ...
4
votes
1answer
56 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 ...
0
votes
1answer
56 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 "...
3
votes
1answer
54 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 ...
5
votes
2answers
235 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 ...
6
votes
1answer
253 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 ...
5
votes
1answer
137 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 ...
1
vote
1answer
50 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 ...
1
vote
1answer
123 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 ...
0
votes
1answer
100 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-...
1
vote
1answer
42 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 ...
0
votes
0answers
59 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 ...
1
vote
1answer
52 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 ENTER:") ...
5
votes
1answer
89 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 ...
2
votes
3answers
636 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 ...
1
vote
1answer
64 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 "...
0
votes
2answers
160 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 ...
1
vote
1answer
134 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 ...
0
votes
1answer
190 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
209 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 ...
4
votes
1answer
215 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. ...
1
vote
0answers
209 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 ...
3
votes
2answers
562 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-...
6
votes
1answer
176 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 ...
5
votes
1answer
553 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 ...
10
votes
1answer
137 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 ...
4
votes
2answers
434 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 ...
3
votes
2answers
253 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-...
14
votes
2answers
1k 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 ...
1
vote
1answer
359 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 Lion without the SLIME package i.e. it will use only Clozure CL. Or to explain it another way, I want to use Emacs CL just like I ...
5
votes
1answer
441 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 ...
8
votes
3answers
806 views

Persistent environment for M-x compile

When I run M-x compile it spawns a new subshell to execute my compile command. As soon as the compile command returns, the shell process is killed. I can see why this would be desirable in most cases, ...
12
votes
1answer
1k views

Asynchronously wait for output from a comint process

First of all, a disclaimer. I have researched this many times, and I am pretty sure that I have already found the answer one way or another, but I just don't understand it. My problem is the ...
7
votes
2answers
749 views

Run ssh-add from Emacs and enter a passphrase

I want to call the ssh-add shell command. So I invoke M-x shell-command RET, and in the minibuffer, I type: ssh-add .ssh/id_rsa The only thing I get is: ssh_askpass: exec(/usr/bin/ssh-askpass): No ...