ANNOUNCE: nottoomuch-addresses.pl version 1.4

2011-12-16 Thread Tomi Ollila
On Fri, 16 Dec 2011 14:01:26 +0100, Philipp ?berbacher  
wrote:
> Quoting Tomi Ollila (2011-12-14 21:10:28)
> 
> Hi Tomi,
> can this be used to automatically populate abook?
> I wonder because alot uses abook for addresses, and this could be handy.

Converter from 'flat list of email-addresses' in
$HOME/.config/nottoomuch/addresses to abook format is probably pretty
trivial (unless it is binary which lessens triviality...)... But there
could be (updating) issues.

Alternative would be to run something like

  notmuch search --sort=newest-first --output=files '*' | 
  while read file; do abook --add-email "$file"; done

initially. then register current date using date=`$date +%s`

and, in following rounds run

  notmuch search --sort=newest-first --output=files $(($date - 604800)).. | 
  while read file; do abook --add-email "$file"; done

(604800 == 86400 * 7 -- 7 days -- just analogous what nottoomuch-addresses.sh
does)

Note that this is just untested example (read abook.1 a bit)


An alternative would be to make 'abook' run nottoomuch-addresses.sh for
address completion (then get it's output order for matches (email addresses
from recent messages first)) -- or even just run

  grep -aiF "$string" "${XDG_CONFIG_HOME:-$HOME/.config}/nottoomuch/addresses"

(this is what nottoomuch-addresses.sh does when finding matches for given
search string. One can imagine how fast this approach is...)

> Regards,
> Philipp

Tomi


Re: ANNOUNCE: nottoomuch-addresses.pl version 1.4

2011-12-16 Thread Tomi Ollila
On Fri, 16 Dec 2011 14:01:26 +0100, Philipp Überbacher mu...@lavabit.com 
wrote:
 Quoting Tomi Ollila (2011-12-14 21:10:28)
 
 Hi Tomi,
 can this be used to automatically populate abook?
 I wonder because alot uses abook for addresses, and this could be handy.

Converter from 'flat list of email-addresses' in
$HOME/.config/nottoomuch/addresses to abook format is probably pretty
trivial (unless it is binary which lessens triviality...)... But there
could be (updating) issues.

Alternative would be to run something like

  notmuch search --sort=newest-first --output=files '*' | 
  while read file; do abook --add-email $file; done

initially. then register current date using date=`$date +%s`

and, in following rounds run

  notmuch search --sort=newest-first --output=files $(($date - 604800)).. | 
  while read file; do abook --add-email $file; done

(604800 == 86400 * 7 -- 7 days -- just analogous what nottoomuch-addresses.sh
does)

Note that this is just untested example (read abook.1 a bit)


An alternative would be to make 'abook' run nottoomuch-addresses.sh for
address completion (then get it's output order for matches (email addresses
from recent messages first)) -- or even just run

  grep -aiF $string ${XDG_CONFIG_HOME:-$HOME/.config}/nottoomuch/addresses

(this is what nottoomuch-addresses.sh does when finding matches for given
search string. One can imagine how fast this approach is...)

 Regards,
 Philipp

Tomi
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


ANNOUNCE: nottoomuch-addresses.pl version 1.4

2011-12-14 Thread Tomi Ollila

notmuch-addresses.sh -- email address substring matcher -- completion
helper version 1.4 is available.

This version uses 'notmuch search --sort=newest-first --output=files ...'
(instead of notmuch show ...) to retrieve message information from notmuch
... and now scans headers from mail files itself.

* This is now somewhat faster as the whole emails are not read.
* The sort order is better guaranteed.
* Current memory consumption of 'notmuch show --format=text' does not
  hit users.

Addresses file header format is same as in 1.3 so upgrading from that
version does not cause addresses file rebuild.

Location: http://www.iki.fi/too/nottoomuch/nottoomuch-addresses.sh

Sha1sum: 871f481a229a6e3295c02fa80270a7a318d226c

Web page: http://www.iki.fi/too/nottoomuch/nottoomuch-addresses/


Note to upgraders: this version may not find as many addreses as older
ones -- those also scanned From:, To: and Cc: in message bodies. 
Current version seldom leaks to the body of the message...
So, don't get alarmed if --update --rebuild finds less addresses.


Enjoy!
Tomi


ANNOUNCE: nottoomuch-addresses.pl version 1.4

2011-12-14 Thread Tomi Ollila

notmuch-addresses.sh -- email address substring matcher -- completion
helper version 1.4 is available.

This version uses 'notmuch search --sort=newest-first --output=files ...'
(instead of notmuch show ...) to retrieve message information from notmuch
... and now scans headers from mail files itself.

* This is now somewhat faster as the whole emails are not read.
* The sort order is better guaranteed.
* Current memory consumption of 'notmuch show --format=text' does not
  hit users.

Addresses file header format is same as in 1.3 so upgrading from that
version does not cause addresses file rebuild.

Location: http://www.iki.fi/too/nottoomuch/nottoomuch-addresses.sh

Sha1sum: 871f481a229a6e3295c02fa80270a7a318d226c

Web page: http://www.iki.fi/too/nottoomuch/nottoomuch-addresses/


Note to upgraders: this version may not find as many addreses as older
ones -- those also scanned From:, To: and Cc: in message bodies. 
Current version seldom leaks to the body of the message...
So, don't get alarmed if --update --rebuild finds less addresses.


Enjoy!
Tomi
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


ANNOUNCE: nottoomuch-addresses.pl version 1.3

2011-12-12 Thread Tomi Ollila
On Wed, 07 Dec 2011 00:03:19 +0200, Tomi Ollila  wrote:
> On Tue, 06 Dec 2011 08:45:49 +1100, Bart Bunting  wrote:
> > Hi,

... 

> 
> > The only other idea I have, which is only half formed, is that it would
> > be nice to prioritize emails that are more important than others.
> > 
> > I'm not sure exactly how this would work but something like:
> > - Addresses I have actualy sent email to rather than jjust received from
> > get a high priority in the result.
> > - Addresses that have sent me email directly rather than just to a list
> > get next priority.
> > - All other emails after that.
> > 
> > Also some sort of weighting within the groups to do with frequency of
> > emails sent or something.
> > 
> > Does that make sense?  Would it be hard to implement?
> 
> Neat idea. To implement the feature into program is not too hard. 
> Somehow determine weight for each email address, store that into 
> hash (key address, value weight). 
> Then, when writing addresses file, sort first by weight and then 
> ascii order. The hash is also stored to disk (using tie()) and used 
> when address file updated.
> 
> Now, how to determine good (generic) rules for weights (and maybe
> some user-defined rules as well) is the question.

The latest version (1.3) now stores addresses in 'newest-first'
order to the "address file" -- the fgrep printing matches will
therefore also output the lines in this order.

For me this seems to work pretty nicely.

This version (1.3) relies notmuch show ... to output emails in
this order (which it seems to do now). If this changes I'll 
have to check how to "fix" my implementation...

The program is located at the same address:

http://www.iki.fi/too/nottoomuch/nottoomuch-addresses.sh

sha1sum is f9289ed4bf9034d99e390aaf3d5fcac3d815ea20 and doc page is at

http://www.iki.fi/too/nottoomuch/nottoomuch-addresses/


> > Cheers
> > 
> > Bart
> 
> Thanks,
> 
> Tomi

Tomi


ANNOUNCE: nottoomuch-addresses.pl version 1.3

2011-12-12 Thread Tomi Ollila
On Wed, 07 Dec 2011 00:03:19 +0200, Tomi Ollila tomi.oll...@iki.fi wrote:
 On Tue, 06 Dec 2011 08:45:49 +1100, Bart Bunting b...@ursys.com.au wrote:
  Hi,

... 

 
  The only other idea I have, which is only half formed, is that it would
  be nice to prioritize emails that are more important than others.
  
  I'm not sure exactly how this would work but something like:
  - Addresses I have actualy sent email to rather than jjust received from
  get a high priority in the result.
  - Addresses that have sent me email directly rather than just to a list
  get next priority.
  - All other emails after that.
  
  Also some sort of weighting within the groups to do with frequency of
  emails sent or something.
  
  Does that make sense?  Would it be hard to implement?
 
 Neat idea. To implement the feature into program is not too hard. 
 Somehow determine weight for each email address, store that into 
 hash (key address, value weight). 
 Then, when writing addresses file, sort first by weight and then 
 ascii order. The hash is also stored to disk (using tie()) and used 
 when address file updated.
 
 Now, how to determine good (generic) rules for weights (and maybe
 some user-defined rules as well) is the question.

The latest version (1.3) now stores addresses in 'newest-first'
order to the address file -- the fgrep printing matches will
therefore also output the lines in this order.

For me this seems to work pretty nicely.

This version (1.3) relies notmuch show ... to output emails in
this order (which it seems to do now). If this changes I'll 
have to check how to fix my implementation...

The program is located at the same address:

http://www.iki.fi/too/nottoomuch/nottoomuch-addresses.sh

sha1sum is f9289ed4bf9034d99e390aaf3d5fcac3d815ea20 and doc page is at
 
http://www.iki.fi/too/nottoomuch/nottoomuch-addresses/


  Cheers
  
  Bart
 
 Thanks,
 
 Tomi

Tomi
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


ANNOUNCE: nottoomuch-addresses.pl

2011-12-07 Thread Tomi Ollila
On Tue, 06 Dec 2011 08:45:49 +1100, Bart Bunting  wrote:
> Hi,
> 
> I agree with Jamie on this one.
> 
> The case sensitivity appears to get in the way of searching.  I also
> think that enabling the regular expressionsearching is a good idea.
> 
> All in all though this is great.

I did version 1.2 of nottoomuch-addresses.sh which does case insensitive
searches. Note the renaming to .sh -- it is now shell script wrapper
which runs 'exec grep -aiF "$*"  -- grep is locale-aware
which makes case insensitivity work outside of ASCII range. The perl code
to create/update addresses file is exactly the same as in version 1.1

So, the current version (1.2) is available at

http://www.iki.fi/too/nottoomuch/nottoomuch-addresses.sh

sha1sum is 03aa8bcf4e32d47e453fc081376843ef03a427ad and doc page is at

http://www.iki.fi/too/nottoomuch/nottoomuch-addresses/

> The only other idea I have, which is only half formed, is that it would
> be nice to prioritize emails that are more important than others.
> 
> I'm not sure exactly how this would work but something like:
> - Addresses I have actualy sent email to rather than jjust received from
> get a high priority in the result.
> - Addresses that have sent me email directly rather than just to a list
> get next priority.
> - All other emails after that.
> 
> Also some sort of weighting within the groups to do with frequency of
> emails sent or something.
> 
> Does that make sense?  Would it be hard to implement?

Neat idea. To implement the feature into program is not too hard. 
Somehow determine weight for each email address, store that into 
hash (key address, value weight). 
Then, when writing addresses file, sort first by weight and then 
ascii order. The hash is also stored to disk (using tie()) and used 
when address file updated.

Now, how to determine good (generic) rules for weights (and maybe
some user-defined rules as well) is the question.

> 
> Cheers
> 
> Bart

Thanks,

Tomi


ANNOUNCE: nottoomuch-addresses.pl

2011-12-06 Thread Bart Bunting
Hi Tomi,

I made the changes for case insensitivity and I much prefer that.

Perhaps it could be an option if you like it the other way around.

Kind regards

Bart


ANNOUNCE: nottoomuch-addresses.pl

2011-12-06 Thread Bart Bunting
Hi,

I agree with Jamie on this one.

The case sensitivity appears to get in the way of searching.  I also
think that enabling the regular expressionsearching is a good idea.

All in all though this is great.

The only other idea I have, which is only half formed, is that it would
be nice to prioritize emails that are more important than others.

I'm not sure exactly how this would work but something like:
- Addresses I have actualy sent email to rather than jjust received from
get a high priority in the result.
- Addresses that have sent me email directly rather than just to a list
get next priority.
- All other emails after that.

Also some sort of weighting within the groups to do with frequency of
emails sent or something.


Does that make sense?  Would it be hard to implement?


Cheers

Bart

> On Mon, 05 Dec 2011 14:35:03 +0200, Tomi Ollila  wrote:
> > Yes, the search is deliberately case sensitive.
> 
> I haven't had a chance to play around with this but I will say that it
> makes more sense to me that this kind of search should deliberately be
> case *in*sensitive.  Case sensitivity seems fairly detrimental here,
> actually, considering there is no consistency in case in names or email
> addresses.
> 
> jamie.


Re: ANNOUNCE: nottoomuch-addresses.pl

2011-12-06 Thread Tomi Ollila
On Tue, 06 Dec 2011 08:45:49 +1100, Bart Bunting b...@ursys.com.au wrote:
 Hi,
 
 I agree with Jamie on this one.
 
 The case sensitivity appears to get in the way of searching.  I also
 think that enabling the regular expressionsearching is a good idea.
 
 All in all though this is great.

I did version 1.2 of nottoomuch-addresses.sh which does case insensitive
searches. Note the renaming to .sh -- it is now shell script wrapper
which runs 'exec grep -aiF $* addresses-file -- grep is locale-aware
which makes case insensitivity work outside of ASCII range. The perl code
to create/update addresses file is exactly the same as in version 1.1

So, the current version (1.2) is available at

http://www.iki.fi/too/nottoomuch/nottoomuch-addresses.sh

sha1sum is 03aa8bcf4e32d47e453fc081376843ef03a427ad and doc page is at

http://www.iki.fi/too/nottoomuch/nottoomuch-addresses/

 The only other idea I have, which is only half formed, is that it would
 be nice to prioritize emails that are more important than others.
 
 I'm not sure exactly how this would work but something like:
 - Addresses I have actualy sent email to rather than jjust received from
 get a high priority in the result.
 - Addresses that have sent me email directly rather than just to a list
 get next priority.
 - All other emails after that.
 
 Also some sort of weighting within the groups to do with frequency of
 emails sent or something.
 
 Does that make sense?  Would it be hard to implement?

Neat idea. To implement the feature into program is not too hard. 
Somehow determine weight for each email address, store that into 
hash (key address, value weight). 
Then, when writing addresses file, sort first by weight and then 
ascii order. The hash is also stored to disk (using tie()) and used 
when address file updated.

Now, how to determine good (generic) rules for weights (and maybe
some user-defined rules as well) is the question.

 
 Cheers
 
 Bart

Thanks,

Tomi
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


ANNOUNCE: nottoomuch-addresses.pl

2011-12-05 Thread Bart Bunting
Hi Tomi,

Another observation.  Not sure if this is a bug or a design decision:
I have the address:
"Zac Hamed" 
a serch like:
./nottoomuch-addresses.pl  zham

shows it up as expected.

However if I search on the name part like:
./nottoomuch-addresses.pl  zac

It doesn't find the match.

Is this expected behaviour?

Kind regards

Bart




 On Mon, 05 Dec 2011 13:51:16 +0200, Tomi Ollila  
wrote:
> Hi
> 
> Thanks to Bart's findings those things are now fixed in
> version 1.1 of nottoomuch-addresses.pl 
> 
> Get it:
> 
> (wget) http://www.iki.fi/too/nottoomuch/nottoomuch-addresses.pl 
> 
> Sha1 digest is now 4ed74ef9eaabb73804e55caa2c29682e643d2b78
> 
> Installation instructions & some other info now available at:
> 
> http://www.iki.fi/too/nottoomuch/nottoomuch-addresses/
> 
> 
> Tomi


ANNOUNCE: nottoomuch-addresses.pl

2011-12-05 Thread Tomi Ollila
On Mon, 05 Dec 2011 23:04:43 +1100, Bart Bunting  wrote:
> Hi Tomi,
> 
> Another observation.  Not sure if this is a bug or a design decision:
> I have the address:
> "Zac Hamed" 
> a serch like:
> ./nottoomuch-addresses.pl  zham
> 
> shows it up as expected.
> 
> However if I search on the name part like:
> ./nottoomuch-addresses.pl  zac
> 
> It doesn't find the match.
> 
> Is this expected behaviour?

Yes, the search is deliberately case sensitive. Note, however, that
email address part is (also deliberately) lowercased before address line
is added to the list... 

This has suited me good so far... (maybe I need to add this to the doc)...

...(or change the behaviour it if is too confusing / more inconvenient
that convenient).

If you want to experiment with case insensitive search you could check the
line 35:

print grep { index($_, $search_str) >= 0 } ;

Change this to

print grep { /\Q$search_str\E/oi } ;

(without \Q and \E you also get regular expression matches)

> 
> Kind regards

Thanks... actually I put the above change into use; let's see if it
work better for me than the other :)

> 
> Bart

Tomi


> 
> 
> 
> 
>  On Mon, 05 Dec 2011 13:51:16 +0200, Tomi Ollila  
> wrote:
> > Hi
> > 
> > Thanks to Bart's findings those things are now fixed in
> > version 1.1 of nottoomuch-addresses.pl 
> > 
> > Get it:
> > 
> > (wget) http://www.iki.fi/too/nottoomuch/nottoomuch-addresses.pl 
> > 
> > Sha1 digest is now 4ed74ef9eaabb73804e55caa2c29682e643d2b78
> > 
> > Installation instructions & some other info now available at:
> > 
> > http://www.iki.fi/too/nottoomuch/nottoomuch-addresses/
> > 
> > 
> > Tomi
> 


ANNOUNCE: nottoomuch-addresses.pl

2011-12-05 Thread Tomi Ollila
Hi

Thanks to Bart's findings those things are now fixed in
version 1.1 of nottoomuch-addresses.pl 

Get it:

(wget) http://www.iki.fi/too/nottoomuch/nottoomuch-addresses.pl 

Sha1 digest is now 4ed74ef9eaabb73804e55caa2c29682e643d2b78

Installation instructions & some other info now available at:

http://www.iki.fi/too/nottoomuch/nottoomuch-addresses/


Tomi


ANNOUNCE: nottoomuch-addresses.pl

2011-12-05 Thread Jameson Graef Rollins
On Mon, 05 Dec 2011 14:35:03 +0200, Tomi Ollila  wrote:
> Yes, the search is deliberately case sensitive.

I haven't had a chance to play around with this but I will say that it
makes more sense to me that this kind of search should deliberately be
case *in*sensitive.  Case sensitivity seems fairly detrimental here,
actually, considering there is no consistency in case in names or email
addresses.

jamie.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 



Re: ANNOUNCE: nottoomuch-addresses.pl

2011-12-05 Thread Tomi Ollila
Hi

Thanks to Bart's findings those things are now fixed in
version 1.1 of nottoomuch-addresses.pl 

Get it:

(wget) http://www.iki.fi/too/nottoomuch/nottoomuch-addresses.pl 

Sha1 digest is now 4ed74ef9eaabb73804e55caa2c29682e643d2b78

Installation instructions  some other info now available at:

http://www.iki.fi/too/nottoomuch/nottoomuch-addresses/


Tomi
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: ANNOUNCE: nottoomuch-addresses.pl

2011-12-05 Thread Bart Bunting
Hi Tomi,

Another observation.  Not sure if this is a bug or a design decision:
I have the address:
Zac Hamed zha...@xx.xxx.au
a serch like:
./nottoomuch-addresses.pl  zham

shows it up as expected.

However if I search on the name part like:
./nottoomuch-addresses.pl  zac

It doesn't find the match.

Is this expected behaviour?

Kind regards

Bart




 On Mon, 05 Dec 2011 13:51:16 +0200, Tomi Ollila tomi.oll...@nixu.com wrote:
 Hi
 
 Thanks to Bart's findings those things are now fixed in
 version 1.1 of nottoomuch-addresses.pl 
 
 Get it:
 
 (wget) http://www.iki.fi/too/nottoomuch/nottoomuch-addresses.pl 
 
 Sha1 digest is now 4ed74ef9eaabb73804e55caa2c29682e643d2b78
 
 Installation instructions  some other info now available at:
 
 http://www.iki.fi/too/nottoomuch/nottoomuch-addresses/
 
 
 Tomi
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: ANNOUNCE: nottoomuch-addresses.pl

2011-12-05 Thread Tomi Ollila
On Mon, 05 Dec 2011 23:04:43 +1100, Bart Bunting b...@ursys.com.au wrote:
 Hi Tomi,
 
 Another observation.  Not sure if this is a bug or a design decision:
 I have the address:
 Zac Hamed zha...@xx.xxx.au
 a serch like:
 ./nottoomuch-addresses.pl  zham
 
 shows it up as expected.
 
 However if I search on the name part like:
 ./nottoomuch-addresses.pl  zac
 
 It doesn't find the match.
 
 Is this expected behaviour?

Yes, the search is deliberately case sensitive. Note, however, that
email address part is (also deliberately) lowercased before address line
is added to the list... 

This has suited me good so far... (maybe I need to add this to the doc)...

...(or change the behaviour it if is too confusing / more inconvenient
that convenient).

If you want to experiment with case insensitive search you could check the
line 35:

print grep { index($_, $search_str) = 0 } I;

Change this to

print grep { /\Q$search_str\E/oi } I;

(without \Q and \E you also get regular expression matches)

 
 Kind regards

Thanks... actually I put the above change into use; let's see if it
work better for me than the other :)

 
 Bart

Tomi


 
 
 
 
  On Mon, 05 Dec 2011 13:51:16 +0200, Tomi Ollila tomi.oll...@nixu.com wrote:
  Hi
  
  Thanks to Bart's findings those things are now fixed in
  version 1.1 of nottoomuch-addresses.pl 
  
  Get it:
  
  (wget) http://www.iki.fi/too/nottoomuch/nottoomuch-addresses.pl 
  
  Sha1 digest is now 4ed74ef9eaabb73804e55caa2c29682e643d2b78
  
  Installation instructions  some other info now available at:
  
  http://www.iki.fi/too/nottoomuch/nottoomuch-addresses/
  
  
  Tomi
 
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: ANNOUNCE: nottoomuch-addresses.pl

2011-12-05 Thread Bart Bunting
Hi,

I agree with Jamie on this one.

The case sensitivity appears to get in the way of searching.  I also
think that enabling the regular expressionsearching is a good idea.

All in all though this is great.

The only other idea I have, which is only half formed, is that it would
be nice to prioritize emails that are more important than others.

I'm not sure exactly how this would work but something like:
- Addresses I have actualy sent email to rather than jjust received from
get a high priority in the result.
- Addresses that have sent me email directly rather than just to a list
get next priority.
- All other emails after that.

Also some sort of weighting within the groups to do with frequency of
emails sent or something.


Does that make sense?  Would it be hard to implement?


Cheers

Bart
  
 On Mon, 05 Dec 2011 14:35:03 +0200, Tomi Ollila tomi.oll...@iki.fi wrote:
  Yes, the search is deliberately case sensitive.
 
 I haven't had a chance to play around with this but I will say that it
 makes more sense to me that this kind of search should deliberately be
 case *in*sensitive.  Case sensitivity seems fairly detrimental here,
 actually, considering there is no consistency in case in names or email
 addresses.
 
 jamie.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: ANNOUNCE: nottoomuch-addresses.pl

2011-12-05 Thread Bart Bunting
Hi Tomi,

I made the changes for case insensitivity and I much prefer that.

Perhaps it could be an option if you like it the other way around.

Kind regards

Bart
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


ANNOUNCE: nottoomuch-addresses.pl

2011-12-02 Thread Tomi Ollila
On Fri, 02 Dec 2011 05:38:01 +1100, Bart Bunting  wrote:
> Hi Tomi,
> 
> I have had a quick try of setting up nottoomuch-addresses addresses.
> 
> Here are a couple of issues I have hit and I think it's still not quite
>  right.
> 
> I attach the shell output from emacs below.
> 
> - firstly it appears that if the term is set to DUMB then the script
> assumes it's being called from emacs and exits if there is no search
> string.  This is problematic for me as I run all my stuff including the
> --update command from a shell.  

Good point. I'll remove that 'optimization' -- mysterious are the ways
users run commands :) (Well, I occasionally run commands from emacs
myself, too).

You could try removing part '''$ENV{TERM} eq 'dumb' or ''' in line 25

> - The instructions don't tell you to create the .config/nottoomuch
> directory.  Perhaps you could check for it's existance and create if
> required?

It does that (in line 91):

mv .config .xconfig
~/mail/nottoomuch/nottoomuch-addresses.pl --update
Creating '/home/too/.config/nottoomuch/addresses'. This may take some time...
Added 3335 addresses in 14 seconds. Total number of addresses: 3335.

It seems your other problems make it seem the directories are not created,
however I check this... 

> - Even when I got this far I had an odd result when running the script
> as shown below.  First time I got a strange error.  Second run it added
> 900 or so addresses.  Subsiquent runs added no more addresses.  I find
> this strange as I have over 180k emails.

Haa, the ls output '0 addresses' tells me something:

rm .config/nottoomuch/addresses
touch .config/nottoomuch/addresses
guru$ ~/mail/nottoomuch/nottoomuch-addresses.pl --update
Updating '/home/too/.config/nottoomuch/addresses', since -604800.
Unrecognized option: -604800..
Added 0 addresses in 0 seconds. Total number of addresses: 0.

> Anyway great work.  Heading in a cool direction.  Hope this somewhat
> rambling report helps.

Thanks a lot for your bug report, it's been very helpful. please retry
doing the following:

TERM=emacs /Users/bart/bin/nottoomuch-addresses.pl --update --rebuild

And report if you get more problems.

> Bart

Tomi

> 
> bart at bit:~$
> bart at bit:~$shasum ~/bin/nottoomuch-addresses.pl 
> 125f3917b3f2dc68bdf30af04ab623d53321e50c  
> /Users/bart/bin/nottoomuch-addresses.pl
> bart at bit:~$chmod 755 ~/bin/nottoomuch-addresses.pl 
> bart at bit:~$~/bin/nottoomuch-addresses.pl  --update
> Cannot open database, maybe not created yet.
> run /Users/bart/bin/nottoomuch-addresses.pl --update from command line first.
> bart at bit:~$cd
> bart at bit:~$cd .config
> bash: cd: .config: No such file or directory
> bart at bit:~$
> bart at bit:~$mkdir .config
> bart at bit:~$nottoomuch --update
> bash: nottoomuch: command not found
> bart at bit:~$~/bin/nottoomuch-addresses.pl  --update
> Cannot open database, maybe not created yet.
> run /Users/bart/bin/nottoomuch-addresses.pl --update from command line first.
> bart at bit:~$
> bart at bit:~$cd
> bart at bit:~$cd .config
> bart at bit:~/.config$mkdir nottoomuch
> bart at bit:~/.config$
> bart at bit:~/.config$~/bin/nottoomuch-addresses.pl  --update
> Cannot open database, maybe not created yet.
> run /Users/bart/bin/nottoomuch-addresses.pl --update from command line first.
> bart at bit:~/.config$cd nottoomuch/
> bart at bit:~/.config/nottoomuch$touch addresses
> bart at bit:~/.config/nottoomuch$~/bin/nottoomuch-addresses.pl  --update
> bart at bit:~/.config/nottoomuch$ls
> addresses
> bart at bit:~/.config/nottoomuch$ls -s addresses 
> 0 addresses
> bart at bit:~/.config/nottoomuch$echo $TERM
> dumb
> bart at bit:~/.config/nottoomuch$export TERM=emacs
> bart at bit:~/.config/nottoomuch$ls -s addresses 
> 0 addresses
> bart at bit:~/.config/nottoomuch$~/bin/nottoomuch-addresses.pl  --update
> Updating '/Users/bart/.config/nottoomuch/addresses', since -604800.
> Unrecognized option: -604800..
> Added 0 addresses in 0 seconds. Total number of addresses: 0.
> bart at bit:~/.config/nottoomuch$~/bin/nottoomuch-addresses.pl  --update
> Updating '/Users/bart/.config/nottoomuch/addresses', since 1322159542.
> Added 993 addresses in 4 seconds. Total number of addresses: 993.
> bart at bit:~/.config/nottoomuch$~/bin/nottoomuch-addresses.pl  --update
> Updating '/Users/bart/.config/nottoomuch/addresses', since 1322159560.
> Added 0 addresses in 1 seconds. Total number of addresses: 993.
> bart at bit:~/.config/nottoomuch$ On Thu, 01 Dec 2011 17:36:24 +0200, Tomi 
> Ollila  wrote:


ANNOUNCE: nottoomuch-addresses.pl

2011-12-02 Thread Bart Bunting
Hi Tomi,

I have had a quick try of setting up nottoomuch-addresses addresses.

Here are a couple of issues I have hit and I think it's still not quite
 right.

I attach the shell output from emacs below.

- firstly it appears that if the term is set to DUMB then the script
assumes it's being called from emacs and exits if there is no search
string.  This is problematic for me as I run all my stuff including the
--update command from a shell.  
- The instructions don't tell you to create the .config/nottoomuch
directory.  Perhaps you could check for it's existance and create if
required?
- Even when I got this far I had an odd result when running the script
as shown below.  First time I got a strange error.  Second run it added
900 or so addresses.  Subsiquent runs added no more addresses.  I find
this strange as I have over 180k emails.

Anyway great work.  Heading in a cool direction.  Hope this somewhat
rambling report helps.

Bart

bart at bit:~$
bart at bit:~$shasum ~/bin/nottoomuch-addresses.pl 
125f3917b3f2dc68bdf30af04ab623d53321e50c  
/Users/bart/bin/nottoomuch-addresses.pl
bart at bit:~$chmod 755 ~/bin/nottoomuch-addresses.pl 
bart at bit:~$~/bin/nottoomuch-addresses.pl  --update
Cannot open database, maybe not created yet.
run /Users/bart/bin/nottoomuch-addresses.pl --update from command line first.
bart at bit:~$cd
bart at bit:~$cd .config
bash: cd: .config: No such file or directory
bart at bit:~$
bart at bit:~$mkdir .config
bart at bit:~$nottoomuch --update
bash: nottoomuch: command not found
bart at bit:~$~/bin/nottoomuch-addresses.pl  --update
Cannot open database, maybe not created yet.
run /Users/bart/bin/nottoomuch-addresses.pl --update from command line first.
bart at bit:~$
bart at bit:~$cd
bart at bit:~$cd .config
bart at bit:~/.config$mkdir nottoomuch
bart at bit:~/.config$
bart at bit:~/.config$~/bin/nottoomuch-addresses.pl  --update
Cannot open database, maybe not created yet.
run /Users/bart/bin/nottoomuch-addresses.pl --update from command line first.
bart at bit:~/.config$cd nottoomuch/
bart at bit:~/.config/nottoomuch$touch addresses
bart at bit:~/.config/nottoomuch$~/bin/nottoomuch-addresses.pl  --update
bart at bit:~/.config/nottoomuch$ls
addresses
bart at bit:~/.config/nottoomuch$ls -s addresses 
0 addresses
bart at bit:~/.config/nottoomuch$echo $TERM
dumb
bart at bit:~/.config/nottoomuch$export TERM=emacs
bart at bit:~/.config/nottoomuch$ls -s addresses 
0 addresses
bart at bit:~/.config/nottoomuch$~/bin/nottoomuch-addresses.pl  --update
Updating '/Users/bart/.config/nottoomuch/addresses', since -604800.
Unrecognized option: -604800..
Added 0 addresses in 0 seconds. Total number of addresses: 0.
bart at bit:~/.config/nottoomuch$~/bin/nottoomuch-addresses.pl  --update
Updating '/Users/bart/.config/nottoomuch/addresses', since 1322159542.
Added 993 addresses in 4 seconds. Total number of addresses: 993.
bart at bit:~/.config/nottoomuch$~/bin/nottoomuch-addresses.pl  --update
Updating '/Users/bart/.config/nottoomuch/addresses', since 1322159560.
Added 0 addresses in 1 seconds. Total number of addresses: 993.
bart at bit:~/.config/nottoomuch$ On Thu, 01 Dec 2011 17:36:24 +0200, Tomi 
Ollila  wrote:


ANNOUNCE: nottoomuch-addresses.pl

2011-12-01 Thread Tomi Ollila

In addition to http://notmuchmail.org/emacstips/#index11h2
and Jani's 'goobook' in id:"87zkfuh3i0.fsf at nikula.org"
you can now also use

http://www.iki.fi/too/nottoomuch/nottoomuch-addresses.pl 

for your address completion needs when composing mail/reply.

This program is 1) easy to install and 2) pretty fast to use
when completing.

How to install

1) Download the program from above url on the machine you're running
   notmuch and find suitable location to it.

2) Verify it's sha1 checksum is 125f3917b3f2dc68bdf30af04ab623d53321e50c

3) chmod 755 /path/to/nottoomuch-addresses.pl

4) Run  /path/to/nottoomuch-addresses.pl --update
   When run first time this gathers email addresses from all of your mail.
   This may take a long while to complete -- depends on the amount of email
   you have. Further --updates are much faster as those just take addresses
   from new mail.

5) Test that it works: Run  /path/to/nottoomuch-addresses.pl notmuchmail

6) In case you're using emacs mua with notmuch, edit your notmuch
   configuration for emacs with the following content:

   (require 'notmuch-address)
   (setq notmuch-address-command "/path/to/nottoomuch-addresses.pl")
   (notmuch-address-message-insinuate)

7) Restart emacs notmuch mua (or eval above lines) and start composing
   new mail. When adding recipient to To: field. press  after 3
   or more characters have been added. In case you get 2 or more address
   matches, use arrow keys in minibuffer to choose desired recipient...

8) Enjoy!

/path/to/nottoomuch-addresses.pl --help  provides more detailed information.

BR,
Tomi


ANNOUNCE: nottoomuch-addresses.pl

2011-12-01 Thread Tomi Ollila

In addition to http://notmuchmail.org/emacstips/#index11h2
and Jani's 'goobook' in id:87zkfuh3i0@nikula.org
you can now also use

http://www.iki.fi/too/nottoomuch/nottoomuch-addresses.pl 

for your address completion needs when composing mail/reply.

This program is 1) easy to install and 2) pretty fast to use
when completing.

How to install

1) Download the program from above url on the machine you're running
   notmuch and find suitable location to it.

2) Verify it's sha1 checksum is 125f3917b3f2dc68bdf30af04ab623d53321e50c

3) chmod 755 /path/to/nottoomuch-addresses.pl

4) Run  /path/to/nottoomuch-addresses.pl --update
   When run first time this gathers email addresses from all of your mail.
   This may take a long while to complete -- depends on the amount of email
   you have. Further --updates are much faster as those just take addresses
   from new mail.

5) Test that it works: Run  /path/to/nottoomuch-addresses.pl notmuchmail

6) In case you're using emacs mua with notmuch, edit your notmuch
   configuration for emacs with the following content:

   (require 'notmuch-address)
   (setq notmuch-address-command /path/to/nottoomuch-addresses.pl)
   (notmuch-address-message-insinuate)

7) Restart emacs notmuch mua (or eval above lines) and start composing
   new mail. When adding recipient to To: field. press TAB after 3
   or more characters have been added. In case you get 2 or more address
   matches, use arrow keys in minibuffer to choose desired recipient...

8) Enjoy!

/path/to/nottoomuch-addresses.pl --help  provides more detailed information.

BR,
Tomi
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: ANNOUNCE: nottoomuch-addresses.pl

2011-12-01 Thread Bart Bunting
Hi Tomi,

I have had a quick try of setting up nottoomuch-addresses addresses.

Here are a couple of issues I have hit and I think it's still not quite
 right.

I attach the shell output from emacs below.

- firstly it appears that if the term is set to DUMB then the script
assumes it's being called from emacs and exits if there is no search
string.  This is problematic for me as I run all my stuff including the
--update command from a shell.  
- The instructions don't tell you to create the .config/nottoomuch
directory.  Perhaps you could check for it's existance and create if
required?
- Even when I got this far I had an odd result when running the script
as shown below.  First time I got a strange error.  Second run it added
900 or so addresses.  Subsiquent runs added no more addresses.  I find
this strange as I have over 180k emails.

Anyway great work.  Heading in a cool direction.  Hope this somewhat
rambling report helps.

Bart

bart@bit:~$
bart@bit:~$shasum ~/bin/nottoomuch-addresses.pl 
125f3917b3f2dc68bdf30af04ab623d53321e50c  
/Users/bart/bin/nottoomuch-addresses.pl
bart@bit:~$chmod 755 ~/bin/nottoomuch-addresses.pl 
bart@bit:~$~/bin/nottoomuch-addresses.pl  --update
Cannot open database, maybe not created yet.
run /Users/bart/bin/nottoomuch-addresses.pl --update from command line first.
bart@bit:~$cd
bart@bit:~$cd .config
bash: cd: .config: No such file or directory
bart@bit:~$
bart@bit:~$mkdir .config
bart@bit:~$nottoomuch --update
bash: nottoomuch: command not found
bart@bit:~$~/bin/nottoomuch-addresses.pl  --update
Cannot open database, maybe not created yet.
run /Users/bart/bin/nottoomuch-addresses.pl --update from command line first.
bart@bit:~$
bart@bit:~$cd
bart@bit:~$cd .config
bart@bit:~/.config$mkdir nottoomuch
bart@bit:~/.config$
bart@bit:~/.config$~/bin/nottoomuch-addresses.pl  --update
Cannot open database, maybe not created yet.
run /Users/bart/bin/nottoomuch-addresses.pl --update from command line first.
bart@bit:~/.config$cd nottoomuch/
bart@bit:~/.config/nottoomuch$touch addresses
bart@bit:~/.config/nottoomuch$~/bin/nottoomuch-addresses.pl  --update
bart@bit:~/.config/nottoomuch$ls
addresses
bart@bit:~/.config/nottoomuch$ls -s addresses 
0 addresses
bart@bit:~/.config/nottoomuch$echo $TERM
dumb
bart@bit:~/.config/nottoomuch$export TERM=emacs
bart@bit:~/.config/nottoomuch$ls -s addresses 
0 addresses
bart@bit:~/.config/nottoomuch$~/bin/nottoomuch-addresses.pl  --update
Updating '/Users/bart/.config/nottoomuch/addresses', since -604800.
Unrecognized option: -604800..
Added 0 addresses in 0 seconds. Total number of addresses: 0.
bart@bit:~/.config/nottoomuch$~/bin/nottoomuch-addresses.pl  --update
Updating '/Users/bart/.config/nottoomuch/addresses', since 1322159542.
Added 993 addresses in 4 seconds. Total number of addresses: 993.
bart@bit:~/.config/nottoomuch$~/bin/nottoomuch-addresses.pl  --update
Updating '/Users/bart/.config/nottoomuch/addresses', since 1322159560.
Added 0 addresses in 1 seconds. Total number of addresses: 993.
bart@bit:~/.config/nottoomuch$ On Thu, 01 Dec 2011 17:36:24 +0200, Tomi Ollila 
tomi.oll...@iki.fi wrote:
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: ANNOUNCE: nottoomuch-addresses.pl

2011-12-01 Thread Tomi Ollila
On Fri, 02 Dec 2011 05:38:01 +1100, Bart Bunting b...@ursys.com.au wrote:
 Hi Tomi,
 
 I have had a quick try of setting up nottoomuch-addresses addresses.
 
 Here are a couple of issues I have hit and I think it's still not quite
  right.
 
 I attach the shell output from emacs below.
 
 - firstly it appears that if the term is set to DUMB then the script
 assumes it's being called from emacs and exits if there is no search
 string.  This is problematic for me as I run all my stuff including the
 --update command from a shell.  

Good point. I'll remove that 'optimization' -- mysterious are the ways
users run commands :) (Well, I occasionally run commands from emacs
myself, too).

You could try removing part '''$ENV{TERM} eq 'dumb' or ''' in line 25

 - The instructions don't tell you to create the .config/nottoomuch
 directory.  Perhaps you could check for it's existance and create if
 required?

It does that (in line 91):

mv .config .xconfig
~/mail/nottoomuch/nottoomuch-addresses.pl --update
Creating '/home/too/.config/nottoomuch/addresses'. This may take some time...
Added 3335 addresses in 14 seconds. Total number of addresses: 3335.

It seems your other problems make it seem the directories are not created,
however I check this... 

 - Even when I got this far I had an odd result when running the script
 as shown below.  First time I got a strange error.  Second run it added
 900 or so addresses.  Subsiquent runs added no more addresses.  I find
 this strange as I have over 180k emails.

Haa, the ls output '0 addresses' tells me something:

rm .config/nottoomuch/addresses
touch .config/nottoomuch/addresses
guru$ ~/mail/nottoomuch/nottoomuch-addresses.pl --update
Updating '/home/too/.config/nottoomuch/addresses', since -604800.
Unrecognized option: -604800..
Added 0 addresses in 0 seconds. Total number of addresses: 0.

 Anyway great work.  Heading in a cool direction.  Hope this somewhat
 rambling report helps.

Thanks a lot for your bug report, it's been very helpful. please retry
doing the following:

TERM=emacs /Users/bart/bin/nottoomuch-addresses.pl --update --rebuild

And report if you get more problems.

 Bart

Tomi

 
 bart@bit:~$
 bart@bit:~$shasum ~/bin/nottoomuch-addresses.pl 
 125f3917b3f2dc68bdf30af04ab623d53321e50c  
 /Users/bart/bin/nottoomuch-addresses.pl
 bart@bit:~$chmod 755 ~/bin/nottoomuch-addresses.pl 
 bart@bit:~$~/bin/nottoomuch-addresses.pl  --update
 Cannot open database, maybe not created yet.
 run /Users/bart/bin/nottoomuch-addresses.pl --update from command line first.
 bart@bit:~$cd
 bart@bit:~$cd .config
 bash: cd: .config: No such file or directory
 bart@bit:~$
 bart@bit:~$mkdir .config
 bart@bit:~$nottoomuch --update
 bash: nottoomuch: command not found
 bart@bit:~$~/bin/nottoomuch-addresses.pl  --update
 Cannot open database, maybe not created yet.
 run /Users/bart/bin/nottoomuch-addresses.pl --update from command line first.
 bart@bit:~$
 bart@bit:~$cd
 bart@bit:~$cd .config
 bart@bit:~/.config$mkdir nottoomuch
 bart@bit:~/.config$
 bart@bit:~/.config$~/bin/nottoomuch-addresses.pl  --update
 Cannot open database, maybe not created yet.
 run /Users/bart/bin/nottoomuch-addresses.pl --update from command line first.
 bart@bit:~/.config$cd nottoomuch/
 bart@bit:~/.config/nottoomuch$touch addresses
 bart@bit:~/.config/nottoomuch$~/bin/nottoomuch-addresses.pl  --update
 bart@bit:~/.config/nottoomuch$ls
 addresses
 bart@bit:~/.config/nottoomuch$ls -s addresses 
 0 addresses
 bart@bit:~/.config/nottoomuch$echo $TERM
 dumb
 bart@bit:~/.config/nottoomuch$export TERM=emacs
 bart@bit:~/.config/nottoomuch$ls -s addresses 
 0 addresses
 bart@bit:~/.config/nottoomuch$~/bin/nottoomuch-addresses.pl  --update
 Updating '/Users/bart/.config/nottoomuch/addresses', since -604800.
 Unrecognized option: -604800..
 Added 0 addresses in 0 seconds. Total number of addresses: 0.
 bart@bit:~/.config/nottoomuch$~/bin/nottoomuch-addresses.pl  --update
 Updating '/Users/bart/.config/nottoomuch/addresses', since 1322159542.
 Added 993 addresses in 4 seconds. Total number of addresses: 993.
 bart@bit:~/.config/nottoomuch$~/bin/nottoomuch-addresses.pl  --update
 Updating '/Users/bart/.config/nottoomuch/addresses', since 1322159560.
 Added 0 addresses in 1 seconds. Total number of addresses: 993.
 bart@bit:~/.config/nottoomuch$ On Thu, 01 Dec 2011 17:36:24 +0200, Tomi 
 Ollila tomi.oll...@iki.fi wrote:
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch