Gnus development mailing list
 help / color / mirror / Atom feed
From: Pankaj Jangid <pankaj@codeisgreat.org>
To: Eric Abrahamsen <eric@ericabrahamsen.net>
Cc: "Pankaj Jangid" <pankaj@codeisgreat.org>,
	"Adam Sjøgren" <asjo@koldfront.dk>,
	ding@gnus.org
Subject: Re: Does Gnus automatically run 'notmuch new' if configured?
Date: Fri, 25 Sep 2020 23:17:00 +0530	[thread overview]
Message-ID: <m28scxn3zf.fsf@codeisgreat.org> (raw)
In-Reply-To: <873635akcz.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Fri, 25 Sep 2020 09:31:40 -0700")

On Fri, Sep 25 2020, Eric Abrahamsen wrote:

> Ahem, I may have led you astray with `async-shell-command', which is
> mostly meant to be called interactively -- in which case you usually
> want to see the output. In lisp code that runs in the background,
> you're better off using `start-process', where you can tell it not to
> keep the output:

I had explored a little bit of `start-process` and `call-process` when I
was reading help on `async-shell-comman`. But then I thought these are
low level methods and I don't need that much control.

> (start-process "unnecessary label" nil "/path/to/notmuch" '("new"))

This is nice. I am using this now. Just a correction. Last argument is
not list. List was giving error. I am using below code,

(start-process "notmuch" "*Notmuch*" "notmuch" "new")

Now, I have another related question - which hook is best for the
purpose? Currently I am using `gnus-after-getting-new-news-hook`. But
that is run only when I press `g` (gnus-group-get-new-news). It seems
that the hook is not invoked when I start Gnus. Also the hook is
probably invoked before splitting.

Since I am using `nnml` backend, there are couple of choices for my
use-case. One is `nnmail-read-incoming-mail`. The documentation also
says, "use this hook to notify any mail watch programs". But I also use
simple splittig (`nnmail-split-methods`). And the documentation also has
a `nnmail-split-hook`. But from the documentation it looks like that
this hook is run, after the splitting has started, and not after the
splitting is over -

--8<---------------cut here---------------start------------->8---
‘nnmail-split-hook’
     Hook run in the buffer where the mail headers of each message is
     kept just before the splitting based on these headers is done.  The
     hook is free to modify the buffer contents in any way it sees
     fit—the buffer is discarded after the splitting has been done, and
     no changes performed in the buffer will show up in any files.
     ‘gnus-article-decode-encoded-words’ is one likely function to add
     to this hook.
--8<---------------cut here---------------end--------------->8---

In such case if I run `notmuch new` then the indexing might create links
to non-existing paths.

Any other hook that you can think of?


  reply	other threads:[~2020-09-25 17:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-24  8:32 Pankaj Jangid
2020-09-24 16:42 ` Eric Abrahamsen
2020-09-24 17:55 ` Adam Sjøgren
2020-09-25  4:00   ` Pankaj Jangid
2020-09-25  6:05     ` Eric Abrahamsen
2020-09-25  7:51       ` Pankaj Jangid
2020-09-25  8:09   ` Eric S Fraga
2020-09-25  9:31     ` Adam Sjøgren
2020-09-25 14:44       ` Pankaj Jangid
2020-09-25 16:31         ` Eric Abrahamsen
2020-09-25 17:47           ` Pankaj Jangid [this message]
2020-09-25 18:16             ` Adam Sjøgren
2020-09-25 18:45             ` Eric Abrahamsen
2020-09-25 18:52               ` Adam Sjøgren
2020-09-26  1:29               ` Pankaj Jangid
2020-09-26 11:48                 ` Adam Sjøgren
2020-09-26 17:08                   ` Pankaj Jangid
2020-09-25 18:25       ` Adam Sjøgren

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=m28scxn3zf.fsf@codeisgreat.org \
    --to=pankaj@codeisgreat.org \
    --cc=asjo@koldfront.dk \
    --cc=ding@gnus.org \
    --cc=eric@ericabrahamsen.net \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).