https://github.com/berquerant/emacs-little-async
Small asynchronous process execution library for myself
https://github.com/berquerant/emacs-little-async
emacs-lisp
Last synced: 4 months ago
JSON representation
Small asynchronous process execution library for myself
- Host: GitHub
- URL: https://github.com/berquerant/emacs-little-async
- Owner: berquerant
- Created: 2021-04-19T16:07:52.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2025-09-14T18:11:31.000Z (9 months ago)
- Last Synced: 2025-10-31T12:02:25.287Z (8 months ago)
- Topics: emacs-lisp
- Language: Emacs Lisp
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Little things async
Small asynchronous process execution library for myself.
## Usage
``` bash
# test.sh
#!/bin/bash
echo "to stderr" >&2
grep . -o | while read x ; do sleep 0.2 ; echo "$x" ; done
```
``` emacs-lisp
(little-async-start-process '("/path/to/test.sh")
:input "Hello!"
:filter (lambda (p output)
(with-current-buffer
(get-buffer-create "*tmp*")
(insert (format "GOT %s" output))))
:stderr "*tmp-stderr*")
```
You will see below in `*tmp*` buffer:
```
GOT H
GOT e
GOT l
GOT l
GOT o
GOT !
```
Each line is written every 0.2 seconds. Meanwhile, Emacs will not be blocked.
You will see belo in `*tmp-stderr*` buffer:
```
to stderr
```