unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* incrontab?
@ 2012-04-12  8:25 David Belohrad
  2012-04-12 15:12 ` incrontab? Adam Wolfe Gordon
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: David Belohrad @ 2012-04-12  8:25 UTC (permalink / raw)
  To: notmuch


Dear All,

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

As I'm using remote-notmuch config (using dtach as specified in wiki), I
think it would not represent so much additional 'load' (in terms of
time to display the emails) to issue refresh the notmuch database with
every 'notmuch' refresh.

any ideas?
thanks
d.


-- 
.david.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: incrontab?
  2012-04-12  8:25 incrontab? David Belohrad
@ 2012-04-12 15:12 ` Adam Wolfe Gordon
  2012-04-12 20:53   ` incrontab? Jani Nikula
  2012-04-15 21:39   ` incrontab? David Belohrad
  2012-04-12 15:27 ` incrontab? Christophe-Marie Duquesne
  2012-04-12 15:52 ` incrontab? Justus Winter
  2 siblings, 2 replies; 7+ messages in thread
From: Adam Wolfe Gordon @ 2012-04-12 15:12 UTC (permalink / raw)
  To: David Belohrad; +Cc: notmuch

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: incrontab?
  2012-04-12  8:25 incrontab? David Belohrad
  2012-04-12 15:12 ` incrontab? Adam Wolfe Gordon
@ 2012-04-12 15:27 ` Christophe-Marie Duquesne
  2012-04-12 15:52 ` incrontab? Justus Winter
  2 siblings, 0 replies; 7+ messages in thread
From: Christophe-Marie Duquesne @ 2012-04-12 15:27 UTC (permalink / raw)
  To: David Belohrad; +Cc: notmuch

This is a quick guess: maybe you monitor a file while its inode is
changing. Do you (or a process) move /var/log/mail.log while
monitoriing it? I suggest you have a look to
http://permalink.gmane.org/gmane.comp.sysutils.incron/16, it helped me
to understand better incron...

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: incrontab?
  2012-04-12  8:25 incrontab? David Belohrad
  2012-04-12 15:12 ` incrontab? Adam Wolfe Gordon
  2012-04-12 15:27 ` incrontab? Christophe-Marie Duquesne
@ 2012-04-12 15:52 ` Justus Winter
  2 siblings, 0 replies; 7+ messages in thread
From: Justus Winter @ 2012-04-12 15:52 UTC (permalink / raw)
  To: David Belohrad, notmuch

Hi David,

Quoting David Belohrad (2012-04-12 10:25:45)
>Dear All,
>
>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?

Yes, kind of. I've extended afew to use inotify to monitor file
renames and to add and tag new mails. It works quite nicely and is
very fast. But it is a bit rough and does not work with an unpatched
version of notmuch.

Make sure you just register for IN_MOVED_TO events and you might miss
mails if a second mail arrives while notmuch new is still running.

Justus

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: incrontab?
  2012-04-12 15:12 ` incrontab? Adam Wolfe Gordon
@ 2012-04-12 20:53   ` Jani Nikula
  2012-04-15 21:39   ` incrontab? David Belohrad
  1 sibling, 0 replies; 7+ messages in thread
From: Jani Nikula @ 2012-04-12 20:53 UTC (permalink / raw)
  To: Adam Wolfe Gordon, David Belohrad; +Cc: notmuch


Adam Wolfe Gordon <awg+notmuch@xvx.ca> writes:
> On Thu, Apr 12, 2012 at 02:25, David Belohrad <david@belohrad.ch> wrote:
>> 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.

There's notmuch-hello-poll-and-update, bound to 'G' in hello, which runs
notmuch-poll-script (customizable; "notmuch new" by default). See the
help for those for details.

If you want '=' to always do "notmuch new", the easiest way is to rebind
it to notmuch-hello-poll-and-update. (But perhaps 'G' is enough?)

HTH,
Jani.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: incrontab?
  2012-04-12 15:12 ` incrontab? Adam Wolfe Gordon
  2012-04-12 20:53   ` incrontab? Jani Nikula
@ 2012-04-15 21:39   ` David Belohrad
  2012-04-16  1:10     ` incrontab? Austin Clements
  1 sibling, 1 reply; 7+ messages in thread
From: David Belohrad @ 2012-04-15 21:39 UTC (permalink / raw)
  To: Adam Wolfe Gordon; +Cc: notmuch

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: incrontab?
  2012-04-15 21:39   ` incrontab? David Belohrad
@ 2012-04-16  1:10     ` Austin Clements
  0 siblings, 0 replies; 7+ messages in thread
From: Austin Clements @ 2012-04-16  1:10 UTC (permalink / raw)
  To: David Belohrad; +Cc: notmuch

Quoth David Belohrad on Apr 15 at 11:39 pm:
> 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? 

This is generally considered to be a bug, but nobody's been brave
enough to fix it yet.  You can, however, remove the search box
entirely by customizing notmuch-hello-sections, which has the
side-effect of fixing this (you can still search by hitting 's', so
the search box itself is of limited utility).

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-04-16  1:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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   ` incrontab? David Belohrad
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

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