To see if a named process is currently running, you could use the
process-status function. It will return
nil if the named process is not running ...
process-status is a built-in function in `C source code'.
Return the status of PROCESS.
The returned value is one of the following symbols:
run -- for a process that is running.
stop -- for a process stopped but continuable.
exit -- for a process that has exited.
signal -- for a process that has got a fatal signal.
open -- for a network stream connection that is open.
listen -- for a network stream server that is listening.
closed -- for a network stream connection that is closed.
connect -- when waiting for a non-blocking connection to complete.
failed -- when a non-blocking connection has failed.
nil -- if arg is a process name and no such process exists.
PROCESS may be a process, a buffer, the name of a process, or
nil, indicating the current buffer's process.
And as stated here, a process sentinel is a way for code to be invoked (such as displaying a message) when the process ends.