emacs: rewrote asynchronous code