all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Pankaj Jangid <pankaj@codeisgreat.org>
Cc: emacs-devel@gnu.org
Subject: Re: How to execute code after start-process completion?
Date: Sat, 26 Sep 2020 17:21:30 +0300	[thread overview]
Message-ID: <83k0wgr53p.fsf@gnu.org> (raw)
In-Reply-To: <m2k0wg63jq.fsf@codeisgreat.org> (message from Pankaj Jangid on Sat, 26 Sep 2020 19:30:41 +0530)

> 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.



  reply	other threads:[~2020-09-26 14:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-26 14:00 How to execute code after start-process completion? Pankaj Jangid
2020-09-26 14:21 ` Eli Zaretskii [this message]
2020-09-26 16:45   ` Pankaj Jangid
2020-09-26 14:22 ` Daniel Martín

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83k0wgr53p.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=pankaj@codeisgreat.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.