From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thomas Fitzsimmons Newsgroups: gmane.emacs.devel Subject: Re: Updated eudcb-mab.el Date: Thu, 19 Feb 2015 21:52:09 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1424400753 2794 80.91.229.3 (20 Feb 2015 02:52:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Feb 2015 02:52:33 +0000 (UTC) Cc: John Wiegley , emacs-devel@gnu.org To: Danie Roux Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 20 03:52:24 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YOdhW-0007xo-K8 for ged-emacs-devel@m.gmane.org; Fri, 20 Feb 2015 03:52:22 +0100 Original-Received: from localhost ([::1]:58905 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOdhV-0007ov-Pu for ged-emacs-devel@m.gmane.org; Thu, 19 Feb 2015 21:52:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOdhS-0007ok-LK for emacs-devel@gnu.org; Thu, 19 Feb 2015 21:52:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YOdhN-0001dg-27 for emacs-devel@gnu.org; Thu, 19 Feb 2015 21:52:18 -0500 Original-Received: from mail-ig0-f182.google.com ([209.85.213.182]:39552) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOdhM-0001d5-Uh for emacs-devel@gnu.org; Thu, 19 Feb 2015 21:52:12 -0500 Original-Received: by mail-ig0-f182.google.com with SMTP id h15so263624igd.3 for ; Thu, 19 Feb 2015 18:52:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=+4345kdN7aG9BeYJzNw9EebfelYqgagfPvofXMad2oc=; b=X6JHFS6mTO5CVC4Usr2gwhX1sEZqfMob+qqyT4ObKPuWPbrF8t4/fCWgRcqTVgNR+f QF4YYib7Wtnnu12OiMNF0rdPh/vBawqlAo8oaVrJ+ZdfYIJvl2n7JMybWRgIyXsnW+lR lx1KPmiM4ovUdxDiMHnVU7CFqYYQA5EpuZsrX5+Tn9jhcjbACXU4eijozoT0EvY7sRK8 zYqi+O92TfYVrP+W8QLn0IGNgkvltJGxr5wH4pYi7KmCP+wSkK3Bbj2TzIR7SiAb3ORG 5o84gtzNuiVW1MywuLIi/l33s7aih9VwEiCJtiB/+28RtyHUER16j+ho9N3cP4OROJpb LdGQ== X-Gm-Message-State: ALoCoQlucrtZ4ctZhufVj6yBoPBevywwJ6gJkRGTBLgE6LpEU/S1a7f6nozz09zCvzf9/Lv6aFhO X-Received: by 10.50.79.166 with SMTP id k6mr9097552igx.27.1424400731744; Thu, 19 Feb 2015 18:52:11 -0800 (PST) Original-Received: from hp-dv5t (69-165-165-189.dsl.teksavvy.com. [69.165.165.189]) by mx.google.com with ESMTPSA id f12sm15520419ioi.21.2015.02.19.18.52.10 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 19 Feb 2015 18:52:11 -0800 (PST) In-Reply-To: (Danie Roux's message of "Wed, 18 Feb 2015 21:56:16 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.213.182 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:183314 Archived-At: Danie Roux 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 writes: >> Danie Roux 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