incrontab?

2012-04-15 Thread David Belohrad
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  writes:

> Hi David,
>
> On Thu, Apr 12, 2012 at 02:25, David Belohrad  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


incrontab?

2012-04-15 Thread Austin Clements
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).


Re: incrontab?

2012-04-15 Thread Austin Clements
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).
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: incrontab?

2012-04-15 Thread David Belohrad
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  writes:

> Hi David,
>
> On Thu, Apr 12, 2012 at 02:25, David Belohrad  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
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


incrontab?

2012-04-12 Thread Jani Nikula

Adam Wolfe Gordon  writes:
> On Thu, Apr 12, 2012 at 02:25, David Belohrad  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.


incrontab?

2012-04-12 Thread Justus Winter
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


incrontab?

2012-04-12 Thread Christophe-Marie Duquesne
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...


Re: incrontab?

2012-04-12 Thread Jani Nikula

Adam Wolfe Gordon  writes:
> On Thu, Apr 12, 2012 at 02:25, David Belohrad  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.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


incrontab?

2012-04-12 Thread David Belohrad

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.


incrontab?

2012-04-12 Thread Adam Wolfe Gordon
Hi David,

On Thu, Apr 12, 2012 at 02:25, David Belohrad  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


Re: incrontab?

2012-04-12 Thread Justus Winter
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
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: incrontab?

2012-04-12 Thread Christophe-Marie Duquesne
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...
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: incrontab?

2012-04-12 Thread Adam Wolfe Gordon
Hi David,

On Thu, Apr 12, 2012 at 02:25, David Belohrad  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
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


incrontab?

2012-04-12 Thread David Belohrad

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.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch