From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Thomas Fitzsimmons Newsgroups: gmane.emacs.devel Subject: Re: [Proposal] New EUDC backend for macOS address book Date: Wed, 10 Jun 2020 01:03:57 -0400 Message-ID: References: <8da7df5281e91d8a351f97c0837d79b7@condition-alpha.com> <298df6a619aa45393b0ae9250123faef@condition-alpha.com> <866ca4b62cf30015aa28bfb9a2566dff@condition-alpha.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="13749"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.91 (gnu/linux) Cc: Jean-Christophe Helary , emacs-devel@gnu.org To: Alexander Adolf Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jun 10 07:06:58 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jiswz-0003Q6-7C for ged-emacs-devel@m.gmane-mx.org; Wed, 10 Jun 2020 07:06:57 +0200 Original-Received: from localhost ([::1]:60276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jiswy-00083B-6o for ged-emacs-devel@m.gmane-mx.org; Wed, 10 Jun 2020 01:06:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38684) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jisuD-0003N5-Ef for emacs-devel@gnu.org; Wed, 10 Jun 2020 01:04:05 -0400 Original-Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]:46079) by eggs.gnu.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jisuB-0006pL-Bi for emacs-devel@gnu.org; Wed, 10 Jun 2020 01:04:05 -0400 Original-Received: by mail-qk1-x731.google.com with SMTP id q8so878300qkm.12 for ; Tue, 09 Jun 2020 22:04:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fitzsim-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=DTFVe3xLhYXYnS1z3LLu/FKaetf387f0zrTGZN+nHuc=; b=f5vmgobrWYWbJwxuxvqTT9OolmERDy6Bt42Zh43ipzMUgMbm3Sb34k3aJuwlYdcKZ2 mwfl3dZ7ll9aDAOh5kT39UJgntWiblGb+g00dypZ0CvkdBbg2j5Mxetnb+FZv4dgRkRq +QGC2ynz0pvCEBGcJQpAGNm819mmtNINIG1cSL3B22V8iMFhSqnz636Zi7uxEbvL5mPl SHAzQzAJJIivc2YpPZw8eZxlDThU7zcBjEQG89vXCAS+e1gvGRhISVmJFpYbTAJ77XMH 80cCIH5RTmra3+0/YaRnzRm/uXaYvO2j3lbXVU+4Mbam0dW4V79zcCXfLRjnPxUrWHy8 7Pkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=DTFVe3xLhYXYnS1z3LLu/FKaetf387f0zrTGZN+nHuc=; b=M6ekcX95uSStfIs8FO7fx1Lc7zSAjbA/CMQQCblTbYwmtBoZDqhJ/DzDGE1L762Mw6 vA6nNzUMCts4SrrDND+IhOif3d2fNh/SrO+prctK/GnKo83L27SdQDCbGBrBD3sdYbm0 4UWjv4Y9751XgpRBGWhlHkXOnGlaoteDDd7EwEbfCqzE2sOxLhw1Z01Lwnh3Ag0vHCmW 33NhY8kz4WLDs+AZc75TgOTbjowrVFOILfQA3JoQ6L0Y7ipx1AClssaGcWiXpr5E84qw i+QaSBPLZs10q6Ibyxo5yVqVwVkKuPALoah5ulk47Xnyq7JklcmNZ/MyNSG/LJXyV7BJ QTEw== X-Gm-Message-State: AOAM53209+vmS6+54qFzvALOGJAiNCWOR9ijx897UAw9opQRc7qnDoC6 4/IHnwVof+XMp+aFMf5xeJ1eou5WFyc= X-Google-Smtp-Source: ABdhPJwAMgOU79gO+6fguDO2TU9iQpNmp/fWwYPkd/ZXL9I3EkiY3oGsyVQA7gb+iD13M7Whi5SmdQ== X-Received: by 2002:a37:847:: with SMTP id 68mr1398814qki.102.1591765439700; Tue, 09 Jun 2020 22:03:59 -0700 (PDT) Original-Received: from localhost.localdomain (69-165-165-189.dsl.teksavvy.com. [69.165.165.189]) by smtp.gmail.com with ESMTPSA id j5sm13333399qtc.72.2020.06.09.22.03.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Jun 2020 22:03:58 -0700 (PDT) In-Reply-To: <866ca4b62cf30015aa28bfb9a2566dff@condition-alpha.com> (Alexander Adolf's message of "Mon, 08 Jun 2020 22:41:56 +0200") Received-SPF: none client-ip=2607:f8b0:4864:20::731; envelope-from=fitzsim@fitzsim.org; helo=mail-qk1-x731.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:252067 Archived-At: Hi Alexander, Alexander Adolf writes: > Hello Thomas, Emacs Developers, > > Thomas Fitzsimmons writes: > >>>> [...] >>>> You can make the changes to eudc.texi, create a patch, then reply to >>>> this message with the patch attached. >>>> [...] > > Apologies for the delay! Please kindly find the patch attached. > > What I did: > > =E2=80=A2 Under "Overview", I added a new @section, paralleling what alre= ady > existed for BBDB. > > =E2=80=A2 Since the backend is not enabled by default, I have also added = a new > @section under "Installation". That new section, besides telling how > to enable the macOS Contacts backend, also describes the two available > backends, and how they differ. The text also deprecates the > pre-existing eudcb-mab.el, and recommends the new > eudcb-macos-contacts.el for new configurations. Thanks for writing this. > diff --git a/doc/misc/eudc.texi b/doc/misc/eudc.texi > index 66867cbc58..0cea3126a0 100644 > --- a/doc/misc/eudc.texi > +++ b/doc/misc/eudc.texi > @@ -85,6 +85,8 @@ LDAP, Lightweight Directory Access Protocol > CCSO PH/QI > @item > BBDB, Big Brother's Insidious Database > +@item > +macOS Contacts > @end itemize >=20=20 > The main features of the EUDC interface are: > @@ -110,6 +112,7 @@ Interface to BBDB to let you insert server records in= to your own BBDB database > * LDAP:: What is LDAP ? > * CCSO PH/QI:: What is CCSO, PH, QI ? > * BBDB:: What is BBDB ? > +* macOS Contacts:: What is macOS Contacts ? > @end menu >=20=20 >=20=20 > @@ -186,6 +189,31 @@ performing queries on multiple servers. > EUDC also offers a means to insert results from directory queries into > your own local BBDB (@pxref{Creating BBDB Records}) >=20=20 > + > +@node macOS Contacts > +@section macOS Contacts > + > +@url{https://support.apple.com/guide/contacts/welcome/mac,, macOS > +Contacts} is the rolodex-like application that ships with the macOS > +operating system@footnote{Apple have changed the names of their > +operating system and some applications over time. macOS used to be > +called Mac OS X in the past, and the Contacts application was > +previously called Address Book.}. Probably leave out the links to apple.com throughout. > [...] It is tightly integrated with the > +other Apple applications (Mail, Calendar, etc.), and can synchronise > +contacts information between Apple devices via CardDAV servers (such > +as e.g. iCloud). Can you remove the above sentence, since it's not relevant to the Emacs integration? > +EUDC considers macOS Contacts as a directory server back end just like > +LDAP or PH/QI servers, though the macOS Contacts application always > +resides locally on your machine. Looks good. > [...] The point in this is not to offer an > +alternate way to query your macOS Contacts database (the macOS > +Contacts application itself provides much more flexible ways to do > +that), but rather to offer an interface to your local directory that > +is consistent with the interface to external directories (LDAP, > +PH/QI). I would leave this sentence out. I expect some users will find it useful as an alternate way of querying macOS Contacts, so as not to need to switch to the other application, and for other reasons. I don't want the manual to imply that it's not worth extending your EUDC backend in that direction, e.g., allowing writing complex queries in Elisp. I think the long term goal should be to make EUDC/Emacs better than these external tools at managing contact information. > [...] This is particularly interesting when performing queries on > +multiple servers. > > + > + > @node Installation > @chapter Installation >=20=20 > @@ -214,6 +242,7 @@ email composition buffers (@pxref{Inline Query Expans= ion}) >=20=20 > @menu > * LDAP Configuration:: EUDC needs external support for LDAP > +* macOS Contacts Configuration:: Enable the macOS Contacts backend > @end menu >=20=20 > @node LDAP Configuration > @@ -339,6 +368,42 @@ and the @file{.emacs} expressions become: > (customize-set-variable 'ldap-host-parameters-alist '(("" auth-source t)= )) > @end lisp >=20=20 > + > +@node macOS Contacts Configuration > +@section macOS Contacts Configuration > + > +macOS Contacts support is added by means of @file{eudcb-mab.el}, or > +@file{eudcb-macos-contacts.el} which are part of Emacs. > + > +@file{eudcb-mab.el} reverse engineers the format of the database file > +used by the macOS Contacts app, and accesses its contents directly. > +While this may promise some performance advantages, it comes at the > +cost of using an undocumented interface. Hence, users of > +@file{eudcb-mab.el} are recommended to double check the compatibility > +of @file{eudcb-mab.el} before upgrading to a new version of macOS. > +@file{eudcb-mab.el} is retained for backwards compatibility with > +existing configurations, and may be removed in a future release. Nice summary. > +@file{eudcb-macos-contacts.el} uses the public scripting interfaces > +offered by the Contacts app via the macOS > +@url{https://developer.apple.com/library/archive/documentation/AppleScri= pt/Conceptual/AppleScriptX/Concepts/osa.html,, > +Open Scripting Architecture (OSA)}. To accomplish this, > +@file{eudcb-macos-contacts.el} uses an external command line utility > +named > +@url{https://developer.apple.com/library/archive/documentation/OpenSourc= e/Conceptual/ShellScripting/AdvancedTechniques/AdvancedTechniques.html#//ap= ple_ref/doc/uid/TP40004268-TP40003521-SW44,, > +osascript}, which is included with all macOS versions since 10.0 > +(which was released 2001). @file{eudcb-macos-contacts.el} is hence > +recommended for all new configurations. > + > +To enable a macOS Contacts backend, first `require' the respective > +library to load it, and then set the `eudc-server' to localhost in > +your init file: > +@lisp > +(require 'eudcb-macos-contacts) > +(eudc-macos-contacts-set-server "localhost") > +@end lisp I think you should move this how-to paragraph to just under the one that begins "Contacts support is added [...]". Users interested in the history can read on. You can probably list/describe eudcb-macos-contacts.el before eudcb-mab.el, since it's the more recommended option. Thomas