From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Alexander Adolf Newsgroups: gmane.emacs.devel Subject: Re: [Proposal] New EUDC backend for macOS address book Date: Mon, 29 Jun 2020 15:38:15 +0200 Message-ID: <3ca5fc3fc2b5dc202456688383a20a77@condition-alpha.com> 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="46760"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Jean-Christophe Helary , emacs-devel@gnu.org To: Thomas Fitzsimmons Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jun 29 15:39:11 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 1jpu07-000C0T-7g for ged-emacs-devel@m.gmane-mx.org; Mon, 29 Jun 2020 15:39:11 +0200 Original-Received: from localhost ([::1]:36304 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jpu06-0000zH-9Q for ged-emacs-devel@m.gmane-mx.org; Mon, 29 Jun 2020 09:39:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59664) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jptzM-0008JI-FL for emacs-devel@gnu.org; Mon, 29 Jun 2020 09:38:24 -0400 Original-Received: from smtprelay05.ispgateway.de ([80.67.18.28]:64976) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jptzJ-0008KU-JZ for emacs-devel@gnu.org; Mon, 29 Jun 2020 09:38:23 -0400 Original-Received: from [46.244.198.48] (helo=condition-alpha.com) by smtprelay05.ispgateway.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1jptzE-0003ry-5L; Mon, 29 Jun 2020 15:38:16 +0200 In-Reply-To: <866ca4b62cf30015aa28bfb9a2566dff@condition-alpha.com> X-Df-Sender: YWxleGFuZGVyLmFkb2xmQGNvbmRpdGlvbi1hbHBoYS5jb20= Received-SPF: pass client-ip=80.67.18.28; envelope-from=alexander.adolf@condition-alpha.com; helo=smtprelay05.ispgateway.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/29 09:38:17 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-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:252561 Archived-At: ping? 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. > > > Looking forward to your thoughts, > > --alexander > > 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.}. 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). > + > +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. 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). 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. > + > +@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 > + > + > @node Usage > @chapter Usage >=20=20