[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to execute code after start-process completion?
From: |
Daniel Martín |
Subject: |
Re: How to execute code after start-process completion? |
Date: |
Sat, 26 Sep 2020 16:22:37 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (darwin) |
Pankaj Jangid <pankaj@codeisgreat.org> writes:
> I am working on tiny customization of my Gnus. And using the function
> `start-process` to call `notmuch new`.
>
> #+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.
You can use a process sentinel for that. Search for "process sentinel"
in the Elisp manual.