unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Belohrad <david@belohrad.ch>
To: Adam Wolfe Gordon <awg+notmuch@xvx.ca>
Cc: notmuch@notmuchmail.org
Subject: Re: incrontab?
Date: Sun, 15 Apr 2012 23:39:08 +0200	[thread overview]
Message-ID: <87pqb8ad4z.fsf@david@belohrad.ch> (raw)
In-Reply-To: <CAMoJFUtBRa0FNgpEJQLVZMQ3hk2MR5vFT4Kq9mspeTBOLLBy=g@mail.gmail.com>

Hi Adam,

interestingly, your 'G' short-cut hint works out of the box! What
happens is, that when one presses 'G', this invokes
notmuch-hello-poll-and-update. This function calls 'notmuch-poll',
which does exactly what I want. I.e. it runs 'notmuch new' if no polling
script is specified. In my case however this invokes 'remote-notmuch
new' which asks notmuch installed at the server to tag new
emails. Lovely. (footnote: It suits me excellently because I'm not
seeking for 'mail push' service and rather read my emails whenever I
decide to do and not whenever an email arrives - this is why I consider
not calling notmuch-poll before every invocation of (notmuch) not as a
bug, but just minor annoyance which can be tweaked away if desired)


There is just one slightly weird thing. This is when 'notmuch' is
opened, the focus goes directly to search button instead of 'inbox'
messages (or something else), which is imho more interesting than going into search. Because
at first what one wants to do is to look into new emails. Another
disadvantage of going directly into search box is, that all shortcuts
get inhibited. Is there any way how to set default focus to something
else? 

thanks a lot

david


Adam Wolfe Gordon <awg+notmuch@xvx.ca> writes:

> Hi David,
>
> On Thu, Apr 12, 2012 at 02:25, David Belohrad <david@belohrad.ch> wrote:
>> is somebody using incrontab to issue 'notmuch new'? I've tried but with
>> only partial success. I have setup incrotab to run 'notmuch new' when
>> something changes in my Maildir. However it is not
>> reliable. E.g. sometimes it works out of the box, sometimes it seems
>> that 'notmuch new' is simply not invoked at all even if I see in
>> /var/log/mail.log, that a new mail was delivered correctly to the
>> folder. Anyone really uses this setup?
>
> I don't use incrontab, but I do use my own inotify-based script for
> updating notmuch: https://gist.github.com/1952483 . I haven't had any
> trouble with it.
>
>> I have reverted back to crontab to issue 'notmuch new' every 5
>> minutes. And frankly speaking, I'm rather thinking to run this command
>> from emacs directly everytime I either start notmuch, or refresh view
>> using '=' on notmuch-hello buffer.
>
> You could probably do this with notmuch-hello-refresh-hook, but it
> will be a bit tricky: the hook is executed after the notmuch-hello
> buffer is refreshed, so you'd have to have it refresh after notmuch
> new completes, without running the hook infinitely.
>
> A better approach might be to use advice. Something like (completely untested):
>
> (defadvice notmuch-hello-update (before notmuch-new) (call-process
> "notmuch" nil nil nil "new"))
>
> Hope that helps,
> -- Adam

  parent reply	other threads:[~2012-04-15 21:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-12  8:25 incrontab? David Belohrad
2012-04-12 15:12 ` incrontab? Adam Wolfe Gordon
2012-04-12 20:53   ` incrontab? Jani Nikula
2012-04-15 21:39   ` David Belohrad [this message]
2012-04-16  1:10     ` incrontab? Austin Clements
2012-04-12 15:27 ` incrontab? Christophe-Marie Duquesne
2012-04-12 15:52 ` incrontab? Justus Winter

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

  List information: https://notmuchmail.org/

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

  git send-email \
    --in-reply-to=87pqb8ad4z.fsf@david@belohrad.ch \
    --to=david@belohrad.ch \
    --cc=awg+notmuch@xvx.ca \
    --cc=notmuch@notmuchmail.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 public inbox

	https://yhetil.org/notmuch.git/

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 read-only IMAP folder(s) and NNTP newsgroup(s).