[notmuch] Using notmuch as an address book for tab-completion

2010-03-23 Thread Sebastian Spaeth
On Sat, 20 Mar 2010 22:35:42 -0400, Jesse Rosenthal  
wrote:
> There was some talk on IRC ages ago about using notmuch as an
> address-book for tab-completion in emacs message mode. Thanks to some
> great recent work (Ingmar Vanhassel's shared lib and Sebastians's
> cnotmuch python lib) I have been able to take a first step in that
> direction. I've written a python script (with some help and suggestions
> from spaetz) which can perform the address-book functionality, and a
> backend for emacs's EUDC address-lookup functionality to access the
> script.

Just testing the integration. First comment:
When I search for "Seb", the first 2 hits, I get are:

Sebastian Spaeth 
Sebastian Spaeth 

I think the version I sent you, lower-cased all email addresses. Is it
intentional to have these as 2 separate email addresses?

Sebastian


Re: [notmuch] Using notmuch as an address book for tab-completion

2010-03-23 Thread Sebastian Spaeth
On Sat, 20 Mar 2010 22:35:42 -0400, Jesse Rosenthal  wrote:
> There was some talk on IRC ages ago about using notmuch as an
> address-book for tab-completion in emacs message mode. Thanks to some
> great recent work (Ingmar Vanhassel's shared lib and Sebastians's
> cnotmuch python lib) I have been able to take a first step in that
> direction. I've written a python script (with some help and suggestions
> from spaetz) which can perform the address-book functionality, and a
> backend for emacs's EUDC address-lookup functionality to access the
> script.

Just testing the integration. First comment:
When I search for "Seb", the first 2 hits, I get are:

Sebastian Spaeth 
Sebastian Spaeth 

I think the version I sent you, lower-cased all email addresses. Is it
intentional to have these as 2 separate email addresses?

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


[notmuch] Using notmuch as an address book for tab-completion

2010-03-22 Thread Sebastian Spaeth
On Mon, 22 Mar 2010 11:14:22 +0100, Ruben Pollan  
wrote:
> Nice feature. I think it should be implemented in the library. There is 
> already
> a function notmuch_database_get_all_tags, will be nice to have a function
> notmuch_database_get_all_addresses.

Actually, i don't think it's necessary to extend the library to get all
addresses, it is really trivial to get them, using the current API. As
to whether to extend the notmuch binary as to output all addresses, I
think this will be taken care of the output filtering once
implemented. e.g. get all addresses with:

notmuch show --format=json --output:to,cc,bcc ''

Sebastian


[notmuch] Using notmuch as an address book for tab-completion

2010-03-22 Thread Ruben Pollan
On 22:35, Sat 20 Mar 10, Jesse Rosenthal wrote:
> There was some talk on IRC ages ago about using notmuch as an
> address-book for tab-completion in emacs message mode. Thanks to some
> great recent work (Ingmar Vanhassel's shared lib and Sebastians's
> cnotmuch python lib) I have been able to take a first step in that
> direction. I've written a python script (with some help and suggestions
> from spaetz) which can perform the address-book functionality, and a
> backend for emacs's EUDC address-lookup functionality to access the
> script.

Nice feature. I think it should be implemented in the library. There is already
a function notmuch_database_get_all_tags, will be nice to have a function
notmuch_database_get_all_addresses. And make it somehow accessible from the
notmuch cli.

-- 
Rub?n Poll?n  | jabber:meskio at jabber.org
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Sed realistas, exigid lo imposible.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: 



[notmuch] Using notmuch as an address book for tab-completion

2010-03-22 Thread Sebastian Spaeth
On Mon, 22 Mar 2010 00:13:57 +0100, Michal Sojka  wrote:
> On Sun, 21 Mar 2010, Sebastian Spaeth wrote:
> > That reminds me that there is still no installation tool for cnotmuch at
> > all. I'll have to have a look into that.
> 
> Hi, I have also a silly question :) Why did you call it cnotmuch? I'd
> expect such a thing to be called pynotmuch or similar. When I saw
> cnotmuch here I had to search other emails to find what it really is.
> Fortunately, with notmuch, I found it very quickly :-D.

Hi Michal,

no silly question at all ;). I found pynotmuch a bit predictive and
boring, and as this is the notmuch bindings to the C-library notmuch, I
just called it 'cnotmuch'. A "pynotmuch" would be a pure python
re-implementation in my mindset...

Just like the c-version of the StringIO module is called cStringIO. etc,
so I am not completely off the track here.

Having that said, I am not particularly attached to that name and can
easily change it. I am in the process of uploading it to pypi.python.org
though, so it will soon be available for a simple local install with
"easy_install cnotmuch".

Next to finding it, the only reference a user will usually only need is
"from cnotmuch import notmuch", the rest is just "notmuch" stuff.

Sebastian


Re: [notmuch] Using notmuch as an address book for tab-completion

2010-03-22 Thread Sebastian Spaeth
On Mon, 22 Mar 2010 11:14:22 +0100, Ruben Pollan  wrote:
> Nice feature. I think it should be implemented in the library. There is 
> already
> a function notmuch_database_get_all_tags, will be nice to have a function
> notmuch_database_get_all_addresses.

Actually, i don't think it's necessary to extend the library to get all
addresses, it is really trivial to get them, using the current API. As
to whether to extend the notmuch binary as to output all addresses, I
think this will be taken care of the output filtering once
implemented. e.g. get all addresses with:

notmuch show --format=json --output:to,cc,bcc ''

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


Re: [notmuch] Using notmuch as an address book for tab-completion

2010-03-22 Thread Ruben Pollan
On 22:35, Sat 20 Mar 10, Jesse Rosenthal wrote:
> There was some talk on IRC ages ago about using notmuch as an
> address-book for tab-completion in emacs message mode. Thanks to some
> great recent work (Ingmar Vanhassel's shared lib and Sebastians's
> cnotmuch python lib) I have been able to take a first step in that
> direction. I've written a python script (with some help and suggestions
> from spaetz) which can perform the address-book functionality, and a
> backend for emacs's EUDC address-lookup functionality to access the
> script.

Nice feature. I think it should be implemented in the library. There is already
a function notmuch_database_get_all_tags, will be nice to have a function
notmuch_database_get_all_addresses. And make it somehow accessible from the
notmuch cli.

-- 
Rubén Pollán  | jabber:mes...@jabber.org
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Sed realistas, exigid lo imposible.


signature.asc
Description: Digital signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [notmuch] Using notmuch as an address book for tab-completion

2010-03-22 Thread Sebastian Spaeth
On Mon, 22 Mar 2010 00:13:57 +0100, Michal Sojka  wrote:
> On Sun, 21 Mar 2010, Sebastian Spaeth wrote:
> > That reminds me that there is still no installation tool for cnotmuch at
> > all. I'll have to have a look into that.
> 
> Hi, I have also a silly question :) Why did you call it cnotmuch? I'd
> expect such a thing to be called pynotmuch or similar. When I saw
> cnotmuch here I had to search other emails to find what it really is.
> Fortunately, with notmuch, I found it very quickly :-D.

Hi Michal,

no silly question at all ;). I found pynotmuch a bit predictive and
boring, and as this is the notmuch bindings to the C-library notmuch, I
just called it 'cnotmuch'. A "pynotmuch" would be a pure python
re-implementation in my mindset...

Just like the c-version of the StringIO module is called cStringIO. etc,
so I am not completely off the track here.

Having that said, I am not particularly attached to that name and can
easily change it. I am in the process of uploading it to pypi.python.org
though, so it will soon be available for a simple local install with
"easy_install cnotmuch".

Next to finding it, the only reference a user will usually only need is
"from cnotmuch import notmuch", the rest is just "notmuch" stuff.

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


[notmuch] Using notmuch as an address book for tab-completion

2010-03-22 Thread Michal Sojka
On Sun, 21 Mar 2010, Sebastian Spaeth wrote:
> That reminds me that there is still no installation tool for cnotmuch at
> all. I'll have to have a look into that.

Hi, I have also a silly question :) Why did you call it cnotmuch? I'd
expect such a thing to be called pynotmuch or similar. When I saw
cnotmuch here I had to search other emails to find what it really is.
Fortunately, with notmuch, I found it very quickly :-D.

M.


[notmuch] Using notmuch as an address book for tab-completion

2010-03-21 Thread Sandra Snan
On Sun, 21 Mar 2010 21:18:12 +0100, "Sebastian Spaeth"  wrote:
> Silly question: How do I byte-compile stuff for emacs? I am a helpless noob 
> when there
> is no make install-emacs command. :-)

Sure, here?s how:

M-x byte-compile-file
type path to file
RET

Good luck!


[notmuch] Using notmuch as an address book for tab-completion

2010-03-21 Thread Sebastian Spaeth
On Sat, 20 Mar 2010 22:35:42 -0400, Jesse Rosenthal  
wrote:
> I've written a python script (with some help and suggestions
> from spaetz) which can perform the address-book functionality, and a
> backend for emacs's EUDC address-lookup functionality to access the
> script.

Thanks for sharing, I am very much looking forward to using that. This
is one more selling point for notmuch :-). Glad the python bindings were
of some use and I am willing to take improvement requests, if you find
some peculiarities in them.

I really look forward to integrate bbdb and notmuch addresses...

> Remember, neither of these will do you much good with the shared lib and
> cnotmuch installed.

That reminds me that there is still no installation tool for cnotmuch at
all. I'll have to have a look into that.

> To get tab completion from emacs, you have to install the script into
> your path, make it executable, and then put my eudcb-notmuch.el file
> into your load path (you should byte-compile it too). DON'T CHANGE THE
> TITLE OF THE .EL FILE! EUDC looks for a specific title based on
> protocol.

Silly question: How do I byte-compile stuff for emacs? I am a helpless noob 
when there
is no make install-emacs command. :-)

Will report back if it works. If yes, this is definitely stuff for the
notmuch help wiki.

Sebastian


Re: [notmuch] Using notmuch as an address book for tab-completion

2010-03-21 Thread Michal Sojka
On Sun, 21 Mar 2010, Sebastian Spaeth wrote:
> That reminds me that there is still no installation tool for cnotmuch at
> all. I'll have to have a look into that.

Hi, I have also a silly question :) Why did you call it cnotmuch? I'd
expect such a thing to be called pynotmuch or similar. When I saw
cnotmuch here I had to search other emails to find what it really is.
Fortunately, with notmuch, I found it very quickly :-D.

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


Re: [notmuch] Using notmuch as an address book for tab-completion

2010-03-21 Thread Sandra Snan
On Sun, 21 Mar 2010 21:18:12 +0100, "Sebastian Spaeth"  
wrote:
> Silly question: How do I byte-compile stuff for emacs? I am a helpless noob 
> when there
> is no make install-emacs command. :-)

Sure, here’s how:

M-x byte-compile-file
type path to file
RET

Good luck!
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [notmuch] Using notmuch as an address book for tab-completion

2010-03-21 Thread Sebastian Spaeth
On Sat, 20 Mar 2010 22:35:42 -0400, Jesse Rosenthal  wrote:
> I've written a python script (with some help and suggestions
> from spaetz) which can perform the address-book functionality, and a
> backend for emacs's EUDC address-lookup functionality to access the
> script.

Thanks for sharing, I am very much looking forward to using that. This
is one more selling point for notmuch :-). Glad the python bindings were
of some use and I am willing to take improvement requests, if you find
some peculiarities in them.

I really look forward to integrate bbdb and notmuch addresses...

> Remember, neither of these will do you much good with the shared lib and
> cnotmuch installed.

That reminds me that there is still no installation tool for cnotmuch at
all. I'll have to have a look into that.
 
> To get tab completion from emacs, you have to install the script into
> your path, make it executable, and then put my eudcb-notmuch.el file
> into your load path (you should byte-compile it too). DON'T CHANGE THE
> TITLE OF THE .EL FILE! EUDC looks for a specific title based on
> protocol.

Silly question: How do I byte-compile stuff for emacs? I am a helpless noob 
when there
is no make install-emacs command. :-)

Will report back if it works. If yes, this is definitely stuff for the
notmuch help wiki.

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


[notmuch] Using notmuch as an address book for tab-completion

2010-03-20 Thread Jesse Rosenthal
Normally, I wouldn't respond to myself to fix a typo, but this seemed
important.

> Remember, neither of these will do you much good with the shared lib and
> cnotmuch installed.

I meant, of course, that neither would do you much good *WITHOUT* the
shared lib and cnotmuch installed.

Apologies,
Jesse


[notmuch] Using notmuch as an address book for tab-completion

2010-03-20 Thread Jesse Rosenthal
Dear All,

There was some talk on IRC ages ago about using notmuch as an
address-book for tab-completion in emacs message mode. Thanks to some
great recent work (Ingmar Vanhassel's shared lib and Sebastians's
cnotmuch python lib) I have been able to take a first step in that
direction. I've written a python script (with some help and suggestions
from spaetz) which can perform the address-book functionality, and a
backend for emacs's EUDC address-lookup functionality to access the
script.

They are available by the following commands:

git clone http://jkr.acm.jhu.edu/git/notmuch_addresses.git
git clone http://jkr.acm.jhu.edu/git/notmuch_eudc.git

Remember, neither of these will do you much good with the shared lib and
cnotmuch installed.

At the moment, the script works by search addresses that you have
written to (or CC'd or BCC'd) in the past. This seems like a good
utility-speed tradeoff, but it would be easy to hack the script to
search a different set of messages. Give three letters (it looks through
first names, last names, and email addresses) it returns results from my
12K messages in well under a second. 

The responses are sorted by frequency, and each email address is
associated with the most frequently used real name (null real-names are
avoided, unless they're the only option).

The script can be run from the command line by:
$ python notmuch_addresses.py query

To get tab completion from emacs, you have to install the script into
your path, make it executable, and then put my eudcb-notmuch.el file
into your load path (you should byte-compile it too). DON'T CHANGE THE
TITLE OF THE .EL FILE! EUDC looks for a specific title based on
protocol.

Then add the following to your .emacs:

(eudc-set-server "localhost" 'notmuch t)
(setq eudc-server-hotlist '(("localhost" . notmuch)))
(setq eudc-inline-expansion-servers 'hotlist)

if you wish to use BBDB too (likely before you use notmuch), then
you should use something like this:

(eudc-set-server "localhost" 'bbdb t)
(eudc-protocol-set 'eudc-inline-expansion-format 
   '("%s %s <%s>" firstname lastname net)
   'bbdb)
(eudc-set-server "localhost" 'notmuch t)
(setq eudc-server-hotlist '(("localhost" . bbdb)
("localhost" . notmuch)))
(setq eudc-inline-expansion-servers 'hotlist)

That should do it. Please let me know if it works for you.

(For those of you who care, eudcb-notmuch.el has a few hacky bits to
hide the fact that notmuch really isn't an address book. That is, it
doesn't know the difference between names and email addresses. So
everything you enter just goes in as one string, which I call "name."
Back-end stuff, but if you're looking through the code, that might make
a few things clearer.)

Best,
Jesse


Re: [notmuch] Using notmuch as an address book for tab-completion

2010-03-20 Thread Jesse Rosenthal
Normally, I wouldn't respond to myself to fix a typo, but this seemed
important.

> Remember, neither of these will do you much good with the shared lib and
> cnotmuch installed.

I meant, of course, that neither would do you much good *WITHOUT* the
shared lib and cnotmuch installed.

Apologies,
Jesse
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[notmuch] Using notmuch as an address book for tab-completion

2010-03-20 Thread Jesse Rosenthal
Dear All,

There was some talk on IRC ages ago about using notmuch as an
address-book for tab-completion in emacs message mode. Thanks to some
great recent work (Ingmar Vanhassel's shared lib and Sebastians's
cnotmuch python lib) I have been able to take a first step in that
direction. I've written a python script (with some help and suggestions
from spaetz) which can perform the address-book functionality, and a
backend for emacs's EUDC address-lookup functionality to access the
script.

They are available by the following commands:

git clone http://jkr.acm.jhu.edu/git/notmuch_addresses.git
git clone http://jkr.acm.jhu.edu/git/notmuch_eudc.git

Remember, neither of these will do you much good with the shared lib and
cnotmuch installed.

At the moment, the script works by search addresses that you have
written to (or CC'd or BCC'd) in the past. This seems like a good
utility-speed tradeoff, but it would be easy to hack the script to
search a different set of messages. Give three letters (it looks through
first names, last names, and email addresses) it returns results from my
12K messages in well under a second. 

The responses are sorted by frequency, and each email address is
associated with the most frequently used real name (null real-names are
avoided, unless they're the only option).

The script can be run from the command line by:
$ python notmuch_addresses.py query

To get tab completion from emacs, you have to install the script into
your path, make it executable, and then put my eudcb-notmuch.el file
into your load path (you should byte-compile it too). DON'T CHANGE THE
TITLE OF THE .EL FILE! EUDC looks for a specific title based on
protocol.

Then add the following to your .emacs:

(eudc-set-server "localhost" 'notmuch t)
(setq eudc-server-hotlist '(("localhost" . notmuch)))
(setq eudc-inline-expansion-servers 'hotlist)

if you wish to use BBDB too (likely before you use notmuch), then
you should use something like this:

(eudc-set-server "localhost" 'bbdb t)
(eudc-protocol-set 'eudc-inline-expansion-format 
   '("%s %s <%s>" firstname lastname net)
   'bbdb)
(eudc-set-server "localhost" 'notmuch t)
(setq eudc-server-hotlist '(("localhost" . bbdb)
("localhost" . notmuch)))
(setq eudc-inline-expansion-servers 'hotlist)

That should do it. Please let me know if it works for you.

(For those of you who care, eudcb-notmuch.el has a few hacky bits to
hide the fact that notmuch really isn't an address book. That is, it
doesn't know the difference between names and email addresses. So
everything you enter just goes in as one string, which I call "name."
Back-end stuff, but if you're looking through the code, that might make
a few things clearer.)

Best,
Jesse
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch