unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Updated eudcb-mab.el
@ 2015-02-17 13:50 Danie Roux
  2015-02-17 14:52 ` Thomas Fitzsimmons
  0 siblings, 1 reply; 6+ messages in thread
From: Danie Roux @ 2015-02-17 13:50 UTC (permalink / raw)
  To: emacs-devel; +Cc: John Wiegley

[-- Attachment #1: Type: text/plain, Size: 262 bytes --]

Dear Emacs-devel,

I've updated eudcb-mab.el to directly query the contacts database, instead of using an external application.

Is this useful, what do I need to do to get the official version updated?

Please find the changed version attached.

-- 
Danie Roux

[-- Attachment #2: eudcb-mab.el --]
[-- Type: application/emacs-lisp, Size: 4645 bytes --]

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

* Re: Updated eudcb-mab.el
  2015-02-17 13:50 Updated eudcb-mab.el Danie Roux
@ 2015-02-17 14:52 ` Thomas Fitzsimmons
  2015-02-18 19:56   ` Danie Roux
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Fitzsimmons @ 2015-02-17 14:52 UTC (permalink / raw)
  To: Danie Roux; +Cc: John Wiegley, emacs-devel

Hi Danie,

Danie Roux <lists@danieroux.com> writes:

> Dear Emacs-devel,
>
> I've updated eudcb-mab.el to directly query the contacts database,
> instead of using an external application.

It looks like you're still relying on an external application, sqlite3,
instead of "contacts", right?

> Is this useful, what do I need to do to get the official version
> updated?

It seems like an improvement to depend on a standard executable like
sqlite3, yes.  It probably makes sense to change eudcb-mab in the way
you're suggesting rather than providing a new backend eudcb-mab-sqlite,
right?  Is this patch backward compatible with the "contacts" format?
If not, do you have a sense for how common the "contacts" format is
these days?  Would it make sense to obsolete the contacts format and
support only the sqlite3 format in Emacs 25?

> Please find the changed version attached.

There are formatting issues where some lines are too long.  Please wrap
those.

Are you able to provide a test database file with example data and a
test procedure for using it for completion?  That would be a useful
addition.  I haven't been able to test the MAB backend myself because I
don't have access to a Mac OS or GNUstep system.

Do you have a copyright assignment on file?  This patch may be small
enough that one is not required; maybe someone else could comment on
this?

Thanks,
Thomas



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

* Re: Updated eudcb-mab.el
  2015-02-17 14:52 ` Thomas Fitzsimmons
@ 2015-02-18 19:56   ` Danie Roux
  2015-02-20  2:52     ` Thomas Fitzsimmons
  0 siblings, 1 reply; 6+ messages in thread
From: Danie Roux @ 2015-02-18 19:56 UTC (permalink / raw)
  To: Thomas Fitzsimmons; +Cc: John Wiegley, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1889 bytes --]

Hi Thomas,

Please find attached a new version and a sql file.

Thomas Fitzsimmons <fitzsim@fitzsim.org> writes:
> Danie Roux <lists@danieroux.com> writes:
>> I've updated eudcb-mab.el to directly query the contacts database,
>> instead of using an external application.
>
> It looks like you're still relying on an external application, sqlite3,
> instead of "contacts", right?

Yes, thank you for picking that up. By external I meant "no additional
software".

> It probably makes sense to change eudcb-mab in the way you're
> suggesting rather than providing a new backend eudcb-mab-sqlite,
> right?

Yes.

> Is this patch backward compatible with the "contacts" format?  If not,
> do you have a sense for how common the "contacts" format is these
> days?  Would it make sense to obsolete the contacts format and support
> only the sqlite3 format in Emacs 25?

That would be my suggestion. I have no feel for how many people use the
"contacts" external application. This should be a seamless change
because it was never possible to set the location or the format to the
"contacts" application

>> Please find the changed version attached.
>
> Are you able to provide a test database file with example data and a
> test procedure for using it for completion?  That would be a useful
> addition.  I haven't been able to test the MAB backend myself because I
> don't have access to a Mac OS or GNUstep system.

Please find attached an anonymized and stripped contacts.sql file to be
used:

$ sqlite3 /tmp/test-contacts.db < contacts.sql

And:

(setq eudc-contacts-file "/tmp/test-contacts.db")
(eudc-set-server "dummy" 'mab t)

In a scratch buffer: (eudc-mab-sqlite3-dump-mac-addressbook)

Searching for "Richard" or "Anton" should be interesting:

(eudc-query-form)

> Do you have a copyright assignment on file?

No. I'm not in the US. Do I just email copyright-clerk@ ?

-- 
Danie Roux

[-- Attachment #2: eudcb-mab.el --]
[-- Type: application/emacs-lisp, Size: 5199 bytes --]

[-- Attachment #3: contacts.sql --]
[-- Type: application/octet-stream, Size: 10820 bytes --]

PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE ZABCDRECORD ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZCREATIONDATEYEAR INTEGER, ZDISPLAYFLAGS INTEGER, ZMODIFICATIONDATEYEAR INTEGER, ZADDRESSBOOKSOURCE INTEGER, ZISALL INTEGER, ZINFO INTEGER, ZME INTEGER, Z21_ME INTEGER, ZBIRTHDAYYEAR INTEGER, ZPREFERREDFORLINKNAME INTEGER, ZPREFERREDFORLINKPHOTO INTEGER, ZPRIVACYFLAGS INTEGER, ZADDRESSBOOKSOURCE1 INTEGER, ZCONTACTINDEX INTEGER, ZLUNARBIRTHDAYCOMPONENTS INTEGER, ZNOTE INTEGER, ZSOURCEWHERECONTACTISME INTEGER, ZASSISTANTSYNCANCHOR INTEGER, ZSHARECOUNT INTEGER, ZSYNCCOUNT INTEGER, ZVERSION INTEGER, ZADDRESSBOOKSOURCE2 INTEGER, ZCREATIONDATE TIMESTAMP, ZCREATIONDATEYEARLESS FLOAT, ZMODIFICATIONDATE TIMESTAMP, ZMODIFICATIONDATEYEARLESS FLOAT, ZBIRTHDAY TIMESTAMP, ZBIRTHDAYYEARLESS FLOAT, ZUNIQUEID VARCHAR, ZNAME VARCHAR, ZNAMENORMALIZED VARCHAR, ZTMPREMOTELOCATION VARCHAR, ZNAME1 VARCHAR, ZREMOTELOCATION VARCHAR, ZSERIALNUMBER VARCHAR, ZDEPARTMENT VARCHAR, ZFIRSTNAME VARCHAR, ZIDENTITYUNIQUEID VARCHAR, ZIMAGEREFERENCE VARCHAR, ZJOBTITLE VARCHAR, ZLASTNAME VARCHAR, ZLINKID VARCHAR, ZMAIDENNAME VARCHAR, ZMIDDLENAME VARCHAR, ZNICKNAME VARCHAR, ZORGANIZATION VARCHAR, ZPHONEMEDATA VARCHAR, ZPHONETICFIRSTNAME VARCHAR, ZPHONETICLASTNAME VARCHAR, ZPHONETICMIDDLENAME VARCHAR, ZSORTINGFIRSTNAME VARCHAR, ZSORTINGLASTNAME VARCHAR, ZSUFFIX VARCHAR, ZTITLE VARCHAR, ZTMPHOMEPAGE VARCHAR, ZASSISTANTVALIDITY VARCHAR, ZCREATEDVERSION VARCHAR, ZLASTDOTMACACCOUNT VARCHAR, ZLASTSAVEDVERSION VARCHAR, ZSYNCANCHOR VARCHAR, ZMODIFIEDUNIQUEIDSDATA BLOB, ZSEARCHELEMENTDATA BLOB );
INSERT INTO ZABCDRECORD VALUES(1,21,36,2011,0,2013,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,NULL,1,NULL,NULL,3,NULL,NULL,NULL,NULL,NULL,345373485.904313,29840685.904313,406059020.315689,27367820.315689,NULL,NULL,'00000000-0000-0000-0000-000000000000:ABPerson',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Danie',NULL,NULL,NULL,'Roux',00000000-0000-0000-0000-000000000000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO ZABCDRECORD VALUES(20,21,4,2011,0,2013,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,NULL,428,NULL,30,NULL,NULL,NULL,NULL,NULL,NULL,345415361.631351,29882561.631351,406059026.557472,27367826.557472,NULL,NULL,'00000000-0000-0000-0000-000000000000:ABPerson',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Cheryl',NULL,NULL,NULL,'van der Merwe',00000000-0000-0000-0000-000000000000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO ZABCDRECORD VALUES(21,21,6,2011,0,2013,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,NULL,197,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,345415361.633945,29882561.633945,406059017.105404,27367817.105404,NULL,NULL,'00000000-0000-0000-0000-000000000000:ABPerson',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Anton',NULL,NULL,'CTO','Smit',00000000-0000-0000-0000-000000000000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO ZABCDRECORD VALUES(32,21,8,2011,0,2013,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,NULL,473,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,345415361.666141,29882561.666141,406059026.557472,27367826.557472,NULL,NULL,'00000000-0000-0000-0000-000000000000:ABPerson',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Richard',NULL,NULL,'Founding Member','Loots',00000000-0000-0000-0000-000000000000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO ZABCDRECORD VALUES(42,21,13,2011,0,2013,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,NULL,175,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,345415361.692974,29882561.692974,406059026.557472,27367826.557472,NULL,NULL,'00000000-0000-0000-0000-000000000000:ABPerson',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Nicole',NULL,NULL,NULL,'Kidman',00000000-0000-0000-0000-000000000000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO ZABCDRECORD VALUES(43,21,6,2011,0,2013,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,NULL,446,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,345415361.69717,29882561.69717,406059015.318355,27367815.318355,NULL,NULL,'00000000-0000-0000-0000-000000000000:ABPerson',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Rudi',NULL,NULL,'Owner','Brisco',00000000-0000-0000-0000-000000000000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO ZABCDRECORD VALUES(100,21,10,2011,0,2013,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,NULL,122,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,345415361.849586,29882561.849586,406059015.318355,27367815.318355,NULL,NULL,'00000000-0000-0000-0000-000000000000:ABPerson',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Marius',NULL,NULL,NULL,'Ludikke',00000000-0000-0000-0000-000000000000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
INSERT INTO ZABCDRECORD VALUES(102,21,4,2011,0,2013,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,NULL,513,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,345415361.854852,29882561.854852,406059017.105404,27367817.105404,NULL,NULL,'00000000-0000-0000-0000-000000000000:ABPerson',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'Martin',NULL,NULL,NULL,'Nel',00000000-0000-0000-0000-000000000000,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
CREATE TABLE ZABCDEMAILADDRESS ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZISPRIMARY INTEGER, ZISPRIVATE INTEGER, ZORDERINGINDEX INTEGER, ZOWNER INTEGER, Z21_OWNER INTEGER, ZADDRESS VARCHAR, ZADDRESSNORMALIZED VARCHAR, ZLABEL VARCHAR, ZUNIQUEID VARCHAR );
INSERT INTO ZABCDEMAILADDRESS VALUES(735,10,1,1,NULL,0,42,21,'nicole.kidman@example.com','nicole.kidman@example.com','_$!<Other>!$_',00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDEMAILADDRESS VALUES(755,10,1,1,NULL,0,43,21,'rudi@example.com','rudi@example.com','_$!<Other>!$_',00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDEMAILADDRESS VALUES(858,10,1,0,NULL,1,43,21,'rudi.brisco@example.com','rudi.brisco@example.com','_$!<Other>!$_',00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDEMAILADDRESS VALUES(972,10,1,0,NULL,2,43,21,'rudi@example.net','rudi@example.net','_$!<Other>!$_',00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDEMAILADDRESS VALUES(1004,10,1,1,NULL,0,32,21,'richard@example.com','richard@example.com','_$!<Other>!$_',00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDEMAILADDRESS VALUES(1021,10,1,1,NULL,0,20,21,'cheryl@example.com','cheryl@example.com','_$!<Other>!$_',00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDEMAILADDRESS VALUES(1057,10,1,0,NULL,1,102,21,'mn@example.com','mn@example.com','_$!<Home>!$_',00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDEMAILADDRESS VALUES(1155,10,1,1,NULL,0,102,21,'martin@example.com','martin@example.com','_$!<Other>!$_',00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDEMAILADDRESS VALUES(1369,10,1,1,NULL,0,100,21,'marius@example.com','marius@example.com','_$!<Other>!$_',00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDEMAILADDRESS VALUES(1379,10,1,0,NULL,2,1,21,'danie@example.net','danie@example.net','_$!<Other>!$_',00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDEMAILADDRESS VALUES(1381,10,1,0,NULL,1,1,21,'accounts+gnu@example.com','accounts+gnu@example.com','_$!<Other>!$_',00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDEMAILADDRESS VALUES(1382,10,1,0,NULL,3,1,21,'accounts+savannah@example.com','accounts+savannah@example.com','_$!<Other>!$_',00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDEMAILADDRESS VALUES(1383,10,1,1,NULL,0,1,21,'danie@example.com','danie@example.com','_$!<Home>!$_',00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDEMAILADDRESS VALUES(1545,10,1,0,NULL,2,21,21,'anton@example.com','anton@example.com','_$!<Other>!$_',00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDEMAILADDRESS VALUES(1547,10,1,1,NULL,0,21,21,'as@example.net','as@example.net','_$!<Other>!$_',00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDEMAILADDRESS VALUES(1548,10,1,0,NULL,3,21,21,'anton.smit@example.com','anton.smit@example.com','_$!<Other>!$_',00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDEMAILADDRESS VALUES(1560,10,1,0,NULL,1,21,21,'anton@example.net','anton@example.net','_$!<Other>!$_',00000000-0000-0000-0000-000000000000);
CREATE TABLE ZABCDPHONENUMBER ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZISPRIMARY INTEGER, ZISPRIVATE INTEGER, ZORDERINGINDEX INTEGER, ZOWNER INTEGER, Z21_OWNER INTEGER, ZAREACODE VARCHAR, ZCOUNTRYCODE VARCHAR, ZEXTENSION VARCHAR, ZFULLNUMBER VARCHAR, ZLABEL VARCHAR, ZLOCALNUMBER VARCHAR, ZUNIQUEID VARCHAR );
INSERT INTO ZABCDPHONENUMBER VALUES(525,13,1,0,NULL,1,20,21,NULL,NULL,NULL,'011 123 4560','_$!<Mobile>!$_',NULL,00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDPHONENUMBER VALUES(543,13,1,1,NULL,0,20,21,NULL,NULL,NULL,'011 123 4561','_$!<Home>!$_',NULL,00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDPHONENUMBER VALUES(552,13,1,1,NULL,0,21,21,NULL,NULL,NULL,'011 321 9876','_$!<Mobile>!$_',NULL,00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDPHONENUMBER VALUES(560,13,1,0,NULL,1,1,21,NULL,NULL,NULL,'011 123 4562','_$!<Mobile>!$_',NULL,00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDPHONENUMBER VALUES(567,13,1,1,NULL,0,100,21,NULL,NULL,NULL,'011 123 4563','_$!<Mobile>!$_',NULL,00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDPHONENUMBER VALUES(593,13,1,1,NULL,0,43,21,NULL,NULL,NULL,'011 123 4564','_$!<Mobile>!$_',NULL,00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDPHONENUMBER VALUES(594,13,1,0,NULL,2,20,21,NULL,NULL,NULL,'011 123 4565','_$!<HomeFAX>!$_',NULL,00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDPHONENUMBER VALUES(604,13,1,1,NULL,0,1,21,NULL,NULL,NULL,'011 123 4566','_$!<Home>!$_',NULL,00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDPHONENUMBER VALUES(613,13,1,1,NULL,0,42,21,NULL,NULL,NULL,'011 123 4567','_$!<Mobile>!$_',NULL,00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDPHONENUMBER VALUES(619,13,1,0,NULL,1,102,21,NULL,NULL,NULL,'011 123 4568','_$!<Work>!$_',NULL,00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDPHONENUMBER VALUES(643,13,1,1,NULL,0,32,21,NULL,NULL,NULL,'011 123 4569','_$!<Mobile>!$_',NULL,00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDPHONENUMBER VALUES(745,13,1,1,NULL,0,102,21,NULL,NULL,NULL,'011 123 4570','_$!<Mobile>!$_',NULL,00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDPHONENUMBER VALUES(761,13,1,0,NULL,1,42,21,NULL,NULL,NULL,'011 123 4571','_$!<Work>!$_',NULL,00000000-0000-0000-0000-000000000000);
INSERT INTO ZABCDPHONENUMBER VALUES(964,13,1,NULL,NULL,2,1,21,NULL,NULL,NULL,'011 123 4572','_$!<HomeFAX>!$_',NULL,00000000-0000-0000-0000-000000000000);
COMMIT;

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

* Re: Updated eudcb-mab.el
  2015-02-18 19:56   ` Danie Roux
@ 2015-02-20  2:52     ` Thomas Fitzsimmons
  2015-02-21 15:57       ` Danie Roux
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Fitzsimmons @ 2015-02-20  2:52 UTC (permalink / raw)
  To: Danie Roux; +Cc: John Wiegley, emacs-devel

Danie Roux <lists@danieroux.com> writes:

[...]

> Please find attached a new version and a sql file.

Thanks.  A few more comments:

- `eudc-mab-sqlite3-dump-mac-addressbook' should not be interactive: in
  general I'd like to reduce, or at least not grow, the number of
  interactive entry points into EUDC

- there are some blank line additions that don't need to be there

- eventually I think we'll want `eudc-contacts-file' to become a
  defcustom and be renamed/aliased to `eudc-mab-contacts-file', but for
  now your patch does the right thing.  The name change can be part of a
  bigger EUDC settings migration I'm planning

> Thomas Fitzsimmons <fitzsim@fitzsim.org> writes:
>> Danie Roux <lists@danieroux.com> writes:
>>> I've updated eudcb-mab.el to directly query the contacts database,
>>> instead of using an external application.
>>
>> It looks like you're still relying on an external application, sqlite3,
>> instead of "contacts", right?
>
> Yes, thank you for picking that up. By external I meant "no additional
> software".

OK, I was thinking in terms of "external to Emacs".

It's probably best not to mention OS X in the commentary, just leave it
at:

;;    This library provides an interface to use the Mac's AddressBook,
;;    by querying a database file using the external program `sqlite3'.

People could be migrating from OS X to GNU/Linux and bringing their
contacts database with them.

>> It probably makes sense to change eudcb-mab in the way you're
>> suggesting rather than providing a new backend eudcb-mab-sqlite,
>> right?
>
> Yes.

OK.

>> Is this patch backward compatible with the "contacts" format?  If not,
>> do you have a sense for how common the "contacts" format is these
>> days?  Would it make sense to obsolete the contacts format and support
>> only the sqlite3 format in Emacs 25?
>
> That would be my suggestion. I have no feel for how many people use the
> "contacts" external application. This should be a seamless change
> because it was never possible to set the location or the format to the
> "contacts" application

OK, sounds good.

>>> Please find the changed version attached.
>>
>> Are you able to provide a test database file with example data and a
>> test procedure for using it for completion?  That would be a useful
>> addition.  I haven't been able to test the MAB backend myself because I
>> don't have access to a Mac OS or GNUstep system.
>
> Please find attached an anonymized and stripped contacts.sql file to be
> used:
>
> $ sqlite3 /tmp/test-contacts.db < contacts.sql
>
> And:
>
> (setq eudc-contacts-file "/tmp/test-contacts.db")
> (eudc-set-server "dummy" 'mab t)
>
> In a scratch buffer: (eudc-mab-sqlite3-dump-mac-addressbook)
>
> Searching for "Richard" or "Anton" should be interesting:
>
> (eudc-query-form)

I tested it out.  That's useful, thanks.

Thomas



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

* Re: Updated eudcb-mab.el
  2015-02-20  2:52     ` Thomas Fitzsimmons
@ 2015-02-21 15:57       ` Danie Roux
  2015-02-22  0:40         ` Thomas Fitzsimmons
  0 siblings, 1 reply; 6+ messages in thread
From: Danie Roux @ 2015-02-21 15:57 UTC (permalink / raw)
  To: Thomas Fitzsimmons; +Cc: John Wiegley, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

Thomas Fitzsimmons <fitzsim@fitzsim.org> writes:

> Danie Roux <lists@danieroux.com> writes:
>
> [...]
>
>> Please find attached a new version and a sql file.
>
> Thanks.  A few more comments:
>
> - `eudc-mab-sqlite3-dump-mac-addressbook' should not be interactive: in
>   general I'd like to reduce, or at least not grow, the number of
>   interactive entry points into EUDC

Removed.

> - there are some blank line additions that don't need to be there

I'm unsure what you are referring to?

>> Thomas Fitzsimmons <fitzsim@fitzsim.org> writes:
>>> Danie Roux <lists@danieroux.com> writes:
>>>> I've updated eudcb-mab.el to directly query the contacts database,
>>>> instead of using an external application.
>>>
>>> It looks like you're still relying on an external application, sqlite3,
>>> instead of "contacts", right?
>>
>> Yes, thank you for picking that up. By external I meant "no additional
>> software".
>
> OK, I was thinking in terms of "external to Emacs".
>
> It's probably best not to mention OS X in the commentary, just leave it
> at:
>
> ;;    This library provides an interface to use the Mac's AddressBook,
> ;;    by querying a database file using the external program `sqlite3'.

Changed it, thank you for the suggestion.

-- 
Danie Roux

[-- Attachment #2: eudcb-mab.el --]
[-- Type: application/emacs-lisp, Size: 5083 bytes --]

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

* Re: Updated eudcb-mab.el
  2015-02-21 15:57       ` Danie Roux
@ 2015-02-22  0:40         ` Thomas Fitzsimmons
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Fitzsimmons @ 2015-02-22  0:40 UTC (permalink / raw)
  To: Danie Roux; +Cc: John Wiegley, emacs-devel

Danie Roux <lists@danieroux.com> writes:

> Thomas Fitzsimmons <fitzsim@fitzsim.org> writes:
>
>> Danie Roux <lists@danieroux.com> writes:
>>
>> [...]
>>
>>> Please find attached a new version and a sql file.
>>
>> Thanks.  A few more comments:
>>
>> - `eudc-mab-sqlite3-dump-mac-addressbook' should not be interactive: in
>>   general I'd like to reduce, or at least not grow, the number of
>>   interactive entry points into EUDC
>
> Removed.
>
>> - there are some blank line additions that don't need to be there
>
> I'm unsure what you are referring to?

When I diff the file you provided with eudcb-mab.el from Emacs master
(1cb34285463d2b9050a031a7f9a53d376de5b489), I see these unnecessary
whitespace changes:

[...]
 ;;; Code:
 
 (require 'eudc)
+
 (require 'executable)
[...]
@@ -124,9 +150,7 @@
 
 ;;}}}
 
-
 (eudc-register-protocol 'mab)
 
 (provide 'eudcb-mab)
-
 ;;; eudcb-mab.el ends here

>>> Thomas Fitzsimmons <fitzsim@fitzsim.org> writes:
>>>> Danie Roux <lists@danieroux.com> writes:
>>>>> I've updated eudcb-mab.el to directly query the contacts database,
>>>>> instead of using an external application.
>>>>
>>>> It looks like you're still relying on an external application, sqlite3,
>>>> instead of "contacts", right?
>>>
>>> Yes, thank you for picking that up. By external I meant "no additional
>>> software".
>>
>> OK, I was thinking in terms of "external to Emacs".
>>
>> It's probably best not to mention OS X in the commentary, just leave it
>> at:
>>
>> ;;    This library provides an interface to use the Mac's AddressBook,
>> ;;    by querying a database file using the external program `sqlite3'.
>
> Changed it, thank you for the suggestion.

OK, this is good to go in.

After your copyright assignment is done, there are a few more steps:

- rebase the patch onto Emacs master

- write a ChangeLog entry

- commit locally

- send the new patch, formatted by git format-patch

Thanks,
Thomas



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

end of thread, other threads:[~2015-02-22  0:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-17 13:50 Updated eudcb-mab.el Danie Roux
2015-02-17 14:52 ` Thomas Fitzsimmons
2015-02-18 19:56   ` Danie Roux
2015-02-20  2:52     ` Thomas Fitzsimmons
2015-02-21 15:57       ` Danie Roux
2015-02-22  0:40         ` Thomas Fitzsimmons

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).