11
votes
Accepted
Run elisp when `async-shell-command` is done
You can specify the output buffer for async-shell-command.
The shell runs as a process of the output buffer.
You can get that process with get-buffer-process.
Define your own process sentinel for the ...
6
votes
Accepted
disable async new buffer question
You may be interested in creating a new/modified function of shell-command that does not seek confirmation. You may also be interested in customizing the variable async-shell-command-buffer. For a ...
6
votes
Accepted
async-shell-command: run COMMAND without displaying the output
Try this:
(add-to-list 'display-buffer-alist '("*Async Shell Command*" display-buffer-no-window (nil)))
The buffer is still created and it still gets the output of the command (or the error output): ...
5
votes
Accepted
Almost working smoothly attempt to get terminal Emacs to copy to clipboard
I'm also a loyal emacs-nw user, and have struggled with this over the recent emacs versions. What works for me, and without any need to C-g, follows. Note that it has a safety check that is linux-...
5
votes
Accepted
Regenerate ctags TAGS file without freezing Emacs for a while?
You can use https://github.com/redguardtoo/counsel-etags/blob/master/counsel-etags.el which originally called aysnc-shell-command to run shell command ctags -e -R.
Or else write your own ...
4
votes
Accepted
Asynchronous version of shell-command-on-region?
Something in this spirit should do the trick. I tried it with espeak under Ubuntu; I guess it would work with say as well.
(defun my-read-words-on-region ()
"Send the region to `espeak'."
(...
4
votes
How can I run an async process in the background without popping up a buffer?
There's no need to change how you run an asynchronous command. Emacs has a generic ability to allow you to control where or whether any buffer will pop-up, by modifying a single data structure, the ...
3
votes
Accepted
Is there a version of lisp-interaction, à la *scratch* buffer, with asynchronous processing of evaluation?
Try the async package (M-x package-install, if you don't already have it).
See the functions async-start and async-inject-variables. The given example is:
(async-start
`(lambda ()
(require ...
3
votes
Accepted
How to start a persistent asynchronous process trough emacs?
You can use call-process the same way as you did, but just replace the third argument by 0. If the third argument is 0, Emacs don't wait for the process and quit without killing it.
SHELL-PROMPT> ...
2
votes
Async shell process buffer always clobbers window arrangement
You can suppress that window for a single command instead of globally using let
(let ((display-buffer-alist
(cons (cons "\\*Async Shell Command\\*.*"
(cons #'display-buffer-...
2
votes
Accepted
Is variable assignment an atomic operation in elisp?
Elisp relies on cooperative concurrency, so yes, these are "atomic".
But I suspect, like Tobias, that this answer won't help you very much because you're probably not asking the right question.
2
votes
Accepted
Is it possible to run package-refresh-contents as some sort of background process?
As @xuchunyang pointed out, package-refresh-contents takes an optional argument which allows it to be called asynchronously.
Therefor one can call it programmatically like:
(package-refresh-contents ...
2
votes
Accepted
ob-async issue, seq-random-elt not defined
I believe the answer is essentially that ob-async has a bug (either with how it implements this feature, or with its stated minimum supported verion of Emacs).
The user is running Emacs 25.2.2
seq-...
2
votes
Wait for result of fzf without blocking input
I think I have found a solution, although It's quite hacky. Basically, I use the following loop to pass key presses to the fzf process:
(while (null fzf-result)
(command-execute (read-key-sequence ...
2
votes
async functions in completion at point functions?
looks like using while-no-input is the simplest way to go. i received advice from capf guru extraordinaire minad to this effect:
(list start
end
;; only search when necessary:
(...
1
vote
#+BIND and org-mode asynchronous exporting document
You are probably missing an initialization. Async is done by spawning a new Emacs process with a special initialization file (specified by org-export-async-init-file). If that file is incomplete in ...
1
vote
async/await in emacs?
Buffers don’t have a “ready” state, and don’t take time to load. You’re not waiting on the buffer, you are waiting for some Jupyter process to start up and accept the connection from ein.
ein already ...
1
vote
Non-blocking prompt for user input
The solution I've come up with is to run the function prompting for user input in a timer using run-at-time:
(defun my-org-pomodoro-started-break-reminder-prompt (prompt)
"Create Google ...
1
vote
Accepted
async org-agenda
SECOND EDIT
A solution that also fixes the links has been posted/implemented here.
Thanks Thierry!
EDIT
Okay, so you can fix it by adding the following two lines before just before the (goto-char (...
1
vote
How to open a file in other window in the middle of function run?
Thanks to lawlist's suggestion, I've ended up with this:
(use-package notmuch
:bind
(("G" . (lambda ()
(interactive)
(find-file-other-window "~/Maildir/....
1
vote
Async Rsync Dired error on tramp file not found
I would consider looking at dired-rsync which is available from MELPA.
DISCLAIMER: I am the author.
1
vote
Accepted
Multi-processing via TRAMP with asynchronous shell commands
The quoted limitation does not exist any longer. Moreover, the function tramp-adb-handle-shell-command does not exist any longer. All different implementations of shell-command in Tramp have been ...
1
vote
Accepted
Change async-shell-command with a synchronous command keeping the dynamically displayed buffer
Since you know what the output buffer is, you can hack around this issue by getting the process object from the output buffer and then waiting for it to finish.
(defun run-kinda-async-shell-command (...
1
vote
Accepted
How can I tail/stream output when evaluating org babel shell blocks?
Found the answer to my own question. Use
https://raw.githubusercontent.com/whacked/ob-shstream/master/ob-shstream.el
1
vote
Accepted
Atomicity with asynchronous execution
@npostavs made this comment on the question:
"I didn't find anything on the semantics of asynchronous operations." - Emacs doesn't have asynchronous operations, hence no semantics.
That comment ...
1
vote
Cleanly terminating asynchronous process after it reads stdin
Turns out I was doing this correctly, and the process was correctly returning a 1 result. So the posted code is the correct thing to do.
1
vote
Accepted
How to know when dired is done if called async?
The final status information of the process is reported on the mode
line for 3 seconds, however if you enter some keys during the 3
seconds, it will disappear immediately, thus if you are using Emacs
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
async × 59process × 10
org-mode × 9
shell-command × 9
subprocess × 9
shell × 7
org-babel × 4
tramp × 4
org-export × 3
dired × 3
preview-latex × 3
call-process × 3
latex × 2
buffers × 2
debugging × 2
microsoft-windows × 2
x-window × 2
org-agenda × 1
elisp × 1
package × 1
window × 1
hooks × 1
completion × 1
terminal-emacs × 1
eshell × 1