My understanding is that this would prompt the user if there were a
buffer named "*Eshell Async Command Output*" (good), but also if there
were a buffer named "*Eshell Async Command Output*<2>" (possibly
unnecessary).
Why?
If we remove the cl-loop, we will have only:
(if (buffer-live-p (get-buffer "*Eshell Async Command Output*"))
(do something according to eshell-command-async-buffer))
which will return nil and
(rename-buffer buf "*Eshell Async Command Output*" nil)
will run inconditionally without asking anything while the process in
"*Eshell Async Command Output*<2>" is still (maybe) running.
Did I miss something?