Questions tagged [process]

A process is a running instance of a program. Use this tag for how Emacs interacts with programs that it runs (compilers, viewers, network backends, etc.)

3
votes
0answers
179 views

Shutting down computer from emacs killing gracefully emacs itself

I am using EXWM on Arch as my windows manager. Substantially my startx launches exec dbus-launch --exit-with-session emacs so I am running only emacs and living inside it. I would like to define a ...
1
vote
1answer
113 views

How to show process in another already opened frame?

I have two frames opened in emacs (one in each monitor, but this is irrelevant). I would like to have a lisp function to switch the buffer in the other frame (in the other monitor), whose focus is in ...
12
votes
5answers
3k views

Does emacs have a process viewer (resource manager) or equivalent?

Occasionally emacs will hit 100% cpu usage. Obviously when this occurs there is an issue with a runaway process. Just wondering if there is a way to view all running processes in emacs? Kind of ...
0
votes
1answer
61 views

Emacs init file with yasnippets and magit submodule update error

I have cloned yasnippets repo repo in ~/.emacs.d/yasnippet-snippets. I would like to synchronize it each time I start Emacs (btw, it would be nice to do it only if there is a connection available), my ...
0
votes
1answer
24 views

Why does magit-git-lines differ from git output in this case?

~/github/hub $ git rev-parse HEAD 4777bd363058213605ebb292b35ef1a6edb3663c ~/github/hub $ git --no-pager log \ --grep='\[ci skip\]' --invert-grep \ --format=oneline --...
0
votes
1answer
299 views

How to find what process won't die?

I'm having an intermittent issue where Emacs appears to freeze. Pressing C-g eventually returns control of Emacs to me with the following message in the *Messages* buffer: Waiting for process to die....
4
votes
2answers
233 views

How to pass messages between emacs and a Python program? (goal: trying to use emacs as a UI)

The situation. Say I have opened up a file in emacs, and I type in something like: x \and \top Then, a Python program reads that file, and: replaces all \and to ∧ replaces all \top to T it does ...
4
votes
1answer
816 views

Exiting emacs without confirmation to kill running processes

It turned out not to be the same problem as Kill process buffer without confirmation?: emacs asks for different kind of confirmations when exiting and when just killing a buffer. How to specify for ...
2
votes
0answers
175 views

make-network-process fails in Emacs 25

make-network-process fails on Emacs25 (25.1.50.2 2016-07-03) when loaded with -q and -Q and trying to eval the following example: (make-network-process :name "*server2*" :type nil ; stream :server ...
2
votes
1answer
161 views

getting a process buffer for an eshell buffer

To get a process buffer an eshell buffer I thought I used to be able to run: (get-buffer-process (current-buffer)) In Emacs 25 this no longer works. Specifically "GNU Emacs 25.1.50.2 (x86_64-...
0
votes
1answer
117 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 ...
10
votes
2answers
678 views

Possible to “detach” a child process?

I use browse-url/browse-url-firefox to open links in Firefox from within Emacs 24.5.1 under Linux (Fedora 23) which in essence executes the firefox executable with the URL by start-process. If there ...
1
vote
1answer
334 views

run-python does not work if added to python-mode-hook

I would like the Python inferior process to start (if it is not already running) whenever I create a python-mode buffer (for example, by visiting a .py file). Some functions in anaconda-mode etc. ...
3
votes
2answers
231 views

Can emacs be used for the same purpose of GNU Screen and Tmux?

GNU Screen and Tmux can make processes survive user's logging out, and resume when logging back again. Can Emacs be used for the same purpose, and how?
1
vote
1answer
883 views

Windows 10 + Emacs shell--can't run processes from eshell; unwanted cmd windows open

I've been upgraded at work to a Windows 10 machine, from Windows 7. Apparently, this has caused problems. First, eshell doesn't seem to be able to launch windows processes anymore. I get "Spawning ...
0
votes
1answer
47 views

Problem about `evil-visual-state` and advising `read-key-sequence` with `call-process`

In Evil mode, after I enter visual-state, I can use f to expand the selection by jumping to a character. Now if I've pressed f after entering visual-state, Emacs asks me to input a character to jump ...
2
votes
2answers
341 views

how to properly capture `diff` output in buffer (without first opening a file)?

summary If one captures diff output to a file name=*.diff and opens that file in a buffer, one gets nicely-formatted mode=Diff. How to get that directly, without first capturing to a file? details ...
1
vote
1answer
131 views

How to run several programs one after another asynchronously

I want to run several programs one after another and display their output in a single buffer. I can do this by calling call-process multiple times: (call-process "cmd1" nil "*out*" t) (call-process "...
4
votes
1answer
213 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. ...
2
votes
0answers
148 views

Basic process management under Windows

I've got the following elisp: (setq proc (start-process "powershell" "*powershell*" "powershell.exe")) Unfortunately, I can't seem to get proc to do anything. For instance, in an normal shell, I ...
2
votes
1answer
368 views

Help with `call-process-region`: Searching for program: no such file or directory

I have the following snippet: (call-process-region (point-min) (point-max) "python /Users/myname/code/move_imports/moveimports.py") Incredibly, it tells me that it cannot find the file, even ...
5
votes
2answers
415 views

Print process output line by line

Read process output line by line gives some partial ideas about how to deal with sub-process output in an intelligent manner, but no example and no working solution. I have a couple of examples, one ...
3
votes
1answer
369 views

Control of garbage collection?

I'm curious about this. The author seems to talk about "processes" and whole buffers that hang around past their welcome. I'm hearing in this article that Emacs elisp can start a process, (this ...
3
votes
1answer
261 views

How can I connect to a REPL and send and read data?

Let us say I have a command to start a REPL. How do I most easily read output and send input? A minimal example with shell, sending ls and reading the output would be appreciated. The shell should ...
4
votes
2answers
311 views

Discard stderr in start-process

I'm using start-process to run mplayer and when playing videos I get a ton of output to stderr from "vdp_...". On the command line I usually just 2>/dev/null but start-process runs it directly without ...
1
vote
1answer
214 views

How to inject a PNG into a buffer in image-mode from a process output

I'm the maintainer of puml-mode, a major mode for editing PlantUML files. It works by submitting the content of the current buffer to an external Java process, PlantUML, which then outputs an image to ...
17
votes
2answers
2k views

Kill process buffer without confirmation?

I have C-x C-k bound to kill-this-buffer. But when I enter into a buffer which is running a process like Python or MySQL, if I do C-x C-k it asks Buffer "*Python*" has a running process; kill it (...
4
votes
2answers
237 views

start-process output processed too slowly

When start a command asynchronously, using (start-process ...), the output is added to the buffer 3-5 times more slowly than if I had used (async-shell-command ...). I don't have any output filters, I ...
14
votes
1answer
113 views

Turning active M-! into M-& (a'ka emacs equiv to bash Ctrl-Z)

From time to time I happen to M-! some_command just to find that the command runs longer than I expected and keeps my emacs frozen for long seconds. So I glaze at my frozen emacs and kick myself for ...
1
vote
1answer
185 views

How can I restart an ansi-term buffer?

I have an open buffer with major mode ansi-term, and with scrollback. This buffer has crashed. I'd like to "recycle" the buffer into a new ansi-term such that scrollback is kept. How can I do this?
5
votes
1answer
549 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 ...
2
votes
2answers
226 views

Make shell-command / async-shell-command respect carriage return?

Say I have a simple perl program: for my $i (0..10) { print "$i\r" } print "\n" Now if I run the program through shell-command, instead of getting a single line with 10, I will see the ...
1
vote
1answer
98 views

Why doesn't changing buffer in filter function have any effect in ERT?

I have a test for fsharp-mode to exercise the jump to definition functionality. Communicating with the background process involves sending a command and then letting the filter function handle the ...
2
votes
1answer
204 views

Size of process output sent to filter functions

I'm using comint to communicate with a REPL. From time to time the REPL sends large amounts of data. This causes a significant lag (about one second), because my filter function gets called on a ...
7
votes
2answers
647 views

Applying a timeout on call-process/shell-command?

In some cases, when delegating work to an external process, it's useful to set a timeout on the command to prevent Emacs from hanging indefinitely. Unfortunately, the following does not work. (with-...
1
vote
0answers
65 views

How can I make two running emacs processes to exchange text like in one?

When I have a running emacs process, before running another, I can make the running one a server, and then running the next as a client. When I have two emacs processes already running, how can I ...
2
votes
1answer
49 views

Running process interactively (like compilation) but without parsing

Is there any command which let me observe output of async-called process (just like M-x compile), but does not try to parse output buffer? Background: for quite a lot of non-compilation tasks (hg ...
5
votes
2answers
2k views

how to set environment variables={EDITOR, VISUAL} to prefer running emacs?

my usecase I'm currently running GNU Emacs version=24.3.1 graphically (i.e., under GNOME/X though started from a script invoked from a gnome-terminal running bash) on a Debian Linux. Just now I was ...
9
votes
3answers
1k views

Send process output to *Messages* buffer, but bypass the echo area

Is it possible to send the output from a process-filter to the *Messages* buffer and suppress that message output from appearing in the echo area, such that I am able to simultaneously use interactive ...
3
votes
2answers
251 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-...
2
votes
1answer
252 views

Using ESS in console Emacs

When I start Emacs 24.4.1 for Windows with the -nw option, I am unable to start R via Meta+R. Emacs becomes unrensponsive and I have to kill the process. The problem seems connected with the call ...
5
votes
1answer
439 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 ...
9
votes
4answers
2k views

How to make shell-command run using shell profile and current directory hooks (ex. direnv)

I am trying to get shell-command and async-shell-command to integrate seamlessly with a couple of programs in my .bashrc file, specifically direnv in this example. I found that if I customized shell-...
8
votes
3answers
795 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, ...
4
votes
1answer
644 views

Efficiently call remote processes

I would like to be able to manage external processes from Emacs, in a way that is: (a) safe w.r.t. arguments escaping for the shell, (b) efficient both for local and remote processes (using TRAMP w/ ...
23
votes
3answers
3k views

How can I run an async process in the background without popping up a buffer?

I have defined some functions to run async background process using async-shell-command in my .emacs, but everytime I run the commands a new window (not frame) is created and the process' buffer is ...