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: Tue, 05 May 2020 15:30:14 +0200 Message-ID: <5a7d6a706d83d6db910762f5ca0d6380@condition-alpha.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="105374"; mail-complaints-to="usenet@ciao.gmane.io" Cc: EMACS development team To: chad Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 05 15:38:51 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 1jVxmd-000RIJ-LR for ged-emacs-devel@m.gmane-mx.org; Tue, 05 May 2020 15:38:51 +0200 Original-Received: from localhost ([::1]:53076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVxmc-0003Ih-Mh for ged-emacs-devel@m.gmane-mx.org; Tue, 05 May 2020 09:38:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47220) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVxeP-0002yY-5x for emacs-devel@gnu.org; Tue, 05 May 2020 09:30:21 -0400 Original-Received: from smtprelay02.ispgateway.de ([80.67.29.24]:46418) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVxeN-0002uw-HC for emacs-devel@gnu.org; Tue, 05 May 2020 09:30:20 -0400 Original-Received: from [46.244.222.109] (helo=localhost) by smtprelay02.ispgateway.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1jVxeI-0004SS-Ne; Tue, 05 May 2020 15:30:14 +0200 In-Reply-To: X-Df-Sender: YWxleGFuZGVyLmFkb2xmQGNvbmRpdGlvbi1hbHBoYS5jb20= Received-SPF: pass client-ip=80.67.29.24; envelope-from=alexander.adolf@condition-alpha.com; helo=smtprelay02.ispgateway.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/05 09:30:15 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.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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:248982 Archived-At: Hello Chad, Many thanks for your swift response, constructive comments, and apologies for the delay in getting back to you. chad writes: > It's been a while since I tried it myself (my macbook pro finally died > early last year), but when I last tried it, going through applescript was > quite slow. In your experience with shelling out to osascript, did you find > the performance acceptable for interactive work? Either way, via do_applescript(), or via the osascript CLI utility, AppleScript is slow. Hence, the additional burden of spawning the new process for the CLI utility does not introduce a noticeable difference to my experience. In that light, I wouldn't suggest to configure this as part of a completion mechanism that pops up while typing (such as e.g. company mode), but to bind it to some key chord. Ultimately, you will likely only want to use it in very specific contexts (e.g. message header) anyway. > Separately, over my years in (what's now) macOS, I found that Apple would > periodically update its file names, but rarely break file-level > compatability in significant ways, so it might be sufficient for > eudcb-mab.el to look through a short list of paths for the most recent > existant file. I had a (pretty simple) script that used Mail.app's SQLite > files that did this over ~5 versions, and never had any trouble with it. > [...] I had published a plugin for the mail app that ships with macOS [1][2]. This also used an undocumented interface; so I know what you're talking about. The point for going the reverse engineering route was that it was the only way at the time. After each macOS release, there was a gap of a few weeks, since I had to reverse engineer what Apple had changed, fix my code, and then keep using it for a while to be sure the new version would work reliably enough to expose it to the general public. You're right in that Apple, as we all, usually make incremental changes only. But it remains a question of sheer luck, whether the next new version from Apple will break things beyond repair. Hence, my baseline is, if there's a documented interface for the purpose, look no further. [1] https://www.condition-alpha.com/blog/?p=1741 [2] https://www.condition-alpha.com/software/composeit-manual/en.lproj/ComposeIT.html Many thanks and cheers, --alexander