Questions tagged [async]

The tag has no usage guidance.

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 ...
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 ...
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 ...
8
votes
4answers
783 views

Async shell process buffer always clobbers window arrangement

I frequently launch external programs from emacs using M-!, such as Firefox or Evince, etc. Whenever I do, a buffer pops up full of results for the process, which clobbers whatever else I've got going ...
5
votes
1answer
130 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 ...
5
votes
0answers
178 views

How can I wrap org-preview-latex-fragment to be async?

Calling org-preview-latex-fragment blocks user input for a second or two depending on the size of your fragment, and with universal args, converting all fragments in buffer can take minutes. It would ...
4
votes
1answer
448 views

Run elisp when `async-shell-command` is done

I want to run some Elisp when my command executed by async-shell-command terminates. How can I do this? Does it have completion hooks?
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. ...
4
votes
1answer
537 views

Regenerate ctags TAGS file without freezing Emacs for a while?

When I'm currently in a large project and I call the command projectile-regenate-tags, the project will be scanned by ctags and the tags will be stored in the TAGS file. While all this action is ...
4
votes
2answers
313 views

Silent/Asynchronous gnus-demon?

Is it possible for gnus-demon to be asynchronous and silent? I have this: (gnus-demon-add-handler 'gnus-demon-scan-news 5 nil) And every 5 minutes, emacs gets stuck fetching new stuff. Which is ...
4
votes
2answers
68 views

avoid emacs to lock down or crash when used for many tasks

I consider to start using emacs for IRC, SQL, Shell and maybe twitter and Feed reading. But than I wonder how power users of emacs deal with emacs being single threaded. So if I have one long-running ...
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 ...
3
votes
1answer
94 views

Almost working smoothly attempt to get terminal Emacs to copy to clipboard

I'm running this emacs GNU Emacs 25.2.2 (x86_64-pc-linux-gnu) of 2017-09-22, modified by Debian directly in a Gnome terminal by calling emacs, which is actually a link to /etc/alternatives/emacs. ...
3
votes
0answers
85 views

Is there some way to continue reading from a STDIN file descriptor when data is PIPED to Emacs on Command-line?

Historical Perspective On Unix like operating systems, it is common practice to redirect IO between shell commands using pipes. For example, the command below would insert all the lines that didn't ...
2
votes
1answer
85 views

disable async new buffer question

When I give a new async command with an interactively called async-shell-command, it gives a message "A command is running in the default buffer. Use a new buffer? (y or n)". I think this behaviour ...
2
votes
1answer
329 views

How to prevent tramp from blocking when entering password?

For my speech recognition mode I have emacs listen asynchronously using make-network-process for messages sent by my python client. If I say anything that should translate to emacs taking an action ...
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 "...
1
vote
2answers
34 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 (...
1
vote
1answer
102 views

How can I tail/stream output when evaluating org babel shell blocks?

I learnt about asynchronous execution of org babel shell code blocks, thanks to: How is #+BEGIN_SRC sh :results drawer different to #+BEGIN_SRC sh I want to know if it's possible to tail/stream the ...
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 ...
1
vote
1answer
146 views

How to know when dired is done if called async?

If I am copying files using dired having previously called (dired-async-mode) to make it copy asynchronously, how do I know when it has successfully finished copying the files?
1
vote
0answers
45 views

Org async export show pdf after completion

With synchronous export I can call C-c C-e l o to generate a pdf and open it. If I try the same keys with the async export, i.e. C-c C-e C-a l o, then the pdf will be generated but the pdf won't open. ...
1
vote
1answer
178 views

tramp + async-shell-command ignores shell-file-name

If I locally call async-shell-command it takes the shell from shell-file-name (/bin/bash). However if I use su or ssh via tramp to invoke a shell command remotely it always runs as /bin/sh. The ...
1
vote
0answers
86 views

How to debug hanging emacs-async command?

I'm trying to set up a function running on my timer to refresh my org-gcal files by using the emacs-async library as follows: (async-get (async-start `(lambda () ,(async-inject-variables "...
1
vote
1answer
428 views

tangle init file async

I use this function for tangling my init.el file (defun tangle-init () "If the current buffer is 'init.org' the code-blocks are tangled, and the tangled file is compiled." (when (equal (...
1
vote
0answers
117 views

How to make dired-do-async-shell-command wait for all sub processes to finish

I'm trying to run the bash script, ~/bin/xlda, ... #!/bin/sh # ~/bin/xlda old_filename="$1" new_filename=`echo $old_filename | sed 's/\(.*\.\)flac/\1m4a/'` ~/bin/xld -f alac -o "$new_filename" "$...
0
votes
1answer
57 views

ob-async issue, seq-random-elt not defined

I would like to asynchronously run code blocks in org mode. My org mode version (org-version output) is: Org mode version 9.2.1 (9.2.1-23-g126a37-elpa @ /home/user/.emacs.d/elpa/org-9.2.2/) I ...
0
votes
1answer
45 views

Change async-shell-command with a synchronous command keeping the dynamically displayed buffer

I have this snippet of code: (async-shell-command (concat "perl myscript.pl " (buffer-name)) (read-string "RETURN: ") (with-temp-file "file.new" (insert-file-contents "file.new") (perform-...
0
votes
1answer
58 views

Atomicity with asynchronous execution

Given code such as (defun some-code () (url-retrieve my-url #'my-callback) (setq *a-global-var* (some-func *a-global-var*)) ...) (defun my-callback (status &rest args) (setq *a-global-...
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 ...
0
votes
0answers
46 views

non blocking meta data fetch from within elfeed

some time ago I wrote some elisp code that when you press x when inside a elfeed-search entry some meta-data is fetched from the internet and displayed. I have since that ditched that code because ...
0
votes
1answer
84 views

Best way to test output sent to a buffer

I'm writing an emacs package for Pipenv and the spike solution uses sync shell calls, which is not desirable for general usage. I'm now changing calls to be async (make-process) and for output to go ...
0
votes
1answer
249 views

Async shell command can't find command

I have installed the Rust programming language (Debian). Now i can compile and run programs from terminal (with the cargo build and cargo run commands), but not from inside emacs. The cargo compiler ...