[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to execute code after start-process completion?
From: |
Eli Zaretskii |
Subject: |
Re: How to execute code after start-process completion? |
Date: |
Sat, 26 Sep 2020 17:21:30 +0300 |
> From: Pankaj Jangid <pankaj@codeisgreat.org>
> Date: Sat, 26 Sep 2020 19:30:41 +0530
>
> #+BEGIN_SRC emacs-lisp
> (add-hook 'gnus-after-getting-new-news-hook
> (lambda ()
> (start-process "notmuch" "*Notmuch*" "notmuch" "new")
> ;; (print (current-time-string) (get-buffer "*Notmuch*"))
> ))
> #+END_SRC
>
> After completion of the process (`notmuch new`), I want to execute some
> code. As you can see above, I want to put the timestamp in the *Notmuch*
> buffer. I know that `start-process` returns the process object. But I
> couldn't find how to use it. Please share any pointers/code-snippet on
> how to use that object accomplish what I want to do? Or may be there is
> a different way to do the task. Please advise.
The usual way of doing that is to set up a process-sentinel function.
It will be called when the process finishes.