From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thomas Fitzsimmons Newsgroups: gmane.emacs.bugs Subject: bug#21971: 25.1.50; EUDC conversion to BBDB 3 incompatibility Date: Sat, 21 Nov 2015 21:44:05 -0500 Message-ID: References: <82egfjs9v1.fsf@jobim-via-gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1448160332 20667 80.91.229.3 (22 Nov 2015 02:45:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 22 Nov 2015 02:45:32 +0000 (UTC) Cc: 21971@debbugs.gnu.org To: George McNinch Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Nov 22 03:45:19 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1a0KeT-0001Dj-RM for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Nov 2015 03:45:18 +0100 Original-Received: from localhost ([::1]:54550 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0KeO-0006Np-6Q for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Nov 2015 21:45:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44544) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0KeK-0006Ky-FV for bug-gnu-emacs@gnu.org; Sat, 21 Nov 2015 21:45:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0KeF-0005BX-FD for bug-gnu-emacs@gnu.org; Sat, 21 Nov 2015 21:45:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57821) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0KeF-0005BT-5h for bug-gnu-emacs@gnu.org; Sat, 21 Nov 2015 21:45:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1a0KeF-0005lN-0a for bug-gnu-emacs@gnu.org; Sat, 21 Nov 2015 21:45:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Thomas Fitzsimmons Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Nov 2015 02:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21971 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21971-submit@debbugs.gnu.org id=B21971.144816025122057 (code B ref 21971); Sun, 22 Nov 2015 02:45:02 +0000 Original-Received: (at 21971) by debbugs.gnu.org; 22 Nov 2015 02:44:11 +0000 Original-Received: from localhost ([127.0.0.1]:47529 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a0KdO-0005jg-Hy for submit@debbugs.gnu.org; Sat, 21 Nov 2015 21:44:11 -0500 Original-Received: from mail-io0-f173.google.com ([209.85.223.173]:35263) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a0KdM-0005jY-8x for 21971@debbugs.gnu.org; Sat, 21 Nov 2015 21:44:09 -0500 Original-Received: by ioc74 with SMTP id 74so158445194ioc.2 for <21971@debbugs.gnu.org>; Sat, 21 Nov 2015 18:44:07 -0800 (PST) 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-type; bh=CrOlG7AVzRmEuczMkaSVCBxqRa7GsSDNW7Ye5t+sFEE=; b=Q2dxvOjGnFn3Ud82XsKjlX/Nn4ARkPmMMIU9NFds32/YwNQezPhBnwi+QuxfIMi+BG ZC0ESPuRqiD90xID9G4txmbJsIsz5oOevp+izZo2wxsekOJzY2ZXm+EJvM/lX5EpSP4Y ba/r96k9kyAjB7feBHXpqegeufHY5rK1IlJW5S4MGifzFO+xvaS5wsyEbwGVpG1Xoc5K ErJsa5ib4hKP/vPez+5oNhGQdf1yvj9raCj8VZ79ag6V7xyC2m7LbGdDiavTS8yHIgdg wzSspRocLtSDWv9VwReAx811+9J5qqnVO2RgkNdrwvOyUVAufFSaLcESM7rlbmE1iPhg 5Ysg== 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=CrOlG7AVzRmEuczMkaSVCBxqRa7GsSDNW7Ye5t+sFEE=; b=YvMnYgu3jwqq+/oHKJrAwSF/3ukKUbCj5P4HCoHmQAL3czqxvTNkcGTFxJNcRgfc1I ZOwUI+JZJ6J3s7uENThwwxpcz5NxJL23GsNgvqkWgXb9+CRxvkHxf/TRsqee8z0/iRxc zCJdCRdf/4xxbiTO4KtFItZ2mxsON80/LeIN31YKwGKZeXnwaXMA2dllhz8K/carrvHD C4Y5Ec7+AQIum6jbKX688FjDXdcoOH0yd2mbXevIVTFzNjqlfLe78OdJ0YLLskhScxVm luB9eO8u/JPKWsqRUHgoE1caXxwze6GP5AoQPMgQ52BtfINOY5GAxfi/Xv3AvnbVu0zi fliQ== X-Gm-Message-State: ALoCoQnRU4fU0uxEBCIyWxt/FHfKcSq7luXr9LDxtufHn6VxSgEWZy7VoewnW4HSBk7mBscsxoD0 X-Received: by 10.107.30.80 with SMTP id e77mr20225602ioe.180.1448160247683; Sat, 21 Nov 2015 18:44:07 -0800 (PST) Original-Received: from hp-dv5t (69-165-165-189.dsl.teksavvy.com. [69.165.165.189]) by smtp.gmail.com with ESMTPSA id l5sm2812437ioa.17.2015.11.21.18.44.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Nov 2015 18:44:07 -0800 (PST) In-Reply-To: <82egfjs9v1.fsf@jobim-via-gmail.com> (George McNinch's message of "Sat, 21 Nov 2015 09:30:42 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:109045 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi George, George McNinch writes: [...] > In fact, a record *has* been inserted into the bbdb; in this case it > looks like > > ["George" "McNinch" nil "George.McNinch@tufts.edu" nil nil nil nil ((crea= tion-date . "2015-11-21 14:13:29 +0000") (timestamp . "2015-11-21 14:13:29 = +0000")) nil] > > (assuming McNinch was not already in the bbdb, of course). > > This record seems "mangled" from the point-of-view of BBDB3 - the email > address should be "in a list" inside this record-vector. Perhaps other > things are amiss, as well. Thank you for the detailed description of how to replicate the issue. > Note also that the setting of eudc-ldap-bbdb-conversion-alist I made > above isn't quite the original value. If I instead use the original > value, e.g. by instead using the original value > > [which amounts to: > > (setq eudc-ldap-bbdb-conversion-alist > `((name . cn) > (net . mail) > (address eudc-bbdbify-address postaladdress "Address") > (phone > (eudc-bbdbify-phone telephonenumber "Phone"))) > > > in the initialization of EUDC], > > then when I press "b" on a record > in the *Directory Query Results* buffer, I get the error > > eudc-bbdbify-phone: Symbol=E2=80=99s function definition is void: > bbdb-parse-phone-number OK, this seems like a separate issue. I haven't investigated it yet. With your eudc-ldap-bbdb-conversion-alist workaround still enabled, can you try the attached patch to see if it fixes exporting for you? Thanks, Thomas --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-BBDB-3-support-for-EUDC-export.patch >From 3a4870a3076467c8465df9ba5dd0646acf1d6fd0 Mon Sep 17 00:00:00 2001 From: Thomas Fitzsimmons Date: Sat, 21 Nov 2015 21:24:27 -0500 Subject: [PATCH] Add BBDB 3 support for EUDC export * eudc.el: Add bbdb-version defvar. (eudc--using-bbdb-3-or-newer-p): New function. * eudc-export.el (eudc-create-bbdb-record): Add support for bbdb-create-internal argument list changes introduced in BBDB 3. * eudcb-bbdb.el: Remove bbdb-version defvar. (eudc-bbdb-field): Call eudc--using-bbdb-3-or-newer-p. --- lisp/net/eudc-export.el | 19 +++++++++++++------ lisp/net/eudc.el | 12 ++++++++++++ lisp/net/eudcb-bbdb.el | 10 +--------- 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/lisp/net/eudc-export.el b/lisp/net/eudc-export.el index c60911f..a65f555 100644 --- a/lisp/net/eudc-export.el +++ b/lisp/net/eudc-export.el @@ -86,12 +86,19 @@ eudc-create-bbdb-record (cons (car mapping) value)))) conversion-alist))) (setq bbdb-notes (delq nil bbdb-notes)) - (setq bbdb-record (bbdb-create-internal bbdb-name - bbdb-company - bbdb-net - bbdb-address - bbdb-phones - bbdb-notes)) + (setq bbdb-record (bbdb-create-internal + bbdb-name + ,@(when (eudc--using-bbdb-3-or-newer-p) + '(nil + nil)) + bbdb-company + bbdb-net + ,@(if (eudc--using-bbdb-3-or-newer-p) + '(bbdb-phones + bbdb-address) + '(bbdb-address + bbdb-phones)) + bbdb-notes)) (or silent (bbdb-display-records (list bbdb-record)))))) diff --git a/lisp/net/eudc.el b/lisp/net/eudc.el index 7280d9d..25a26bd 100644 --- a/lisp/net/eudc.el +++ b/lisp/net/eudc.el @@ -107,6 +107,18 @@ eudc-switch-from-server-hook ;; attribute name (defvar eudc-protocol-has-default-query-attributes nil) +(defvar bbdb-version) + +(defun eudc--using-bbdb-3-or-newer-p () + "Return non-nil if BBDB version is 3 or greater." + (or + ;; MELPA versions of BBDB may have a bad package version, but + ;; they're all version 3 or later. + (equal bbdb-version "@PACKAGE_VERSION@") + ;; Development versions of BBDB can have the format "X.YZ devo". + ;; Split the string just in case. + (version<= "3" (car (split-string bbdb-version))))) + (defun eudc-plist-member (plist prop) "Return t if PROP has a value specified in PLIST." (if (not (= 0 (% (length plist) 2))) diff --git a/lisp/net/eudcb-bbdb.el b/lisp/net/eudcb-bbdb.el index 0545304..1972fc1 100644 --- a/lisp/net/eudcb-bbdb.el +++ b/lisp/net/eudcb-bbdb.el @@ -42,21 +42,13 @@ (defvar eudc-bbdb-current-query nil) (defvar eudc-bbdb-current-return-attributes nil) -(defvar bbdb-version) - (defun eudc-bbdb-field (field-symbol) "Convert FIELD-SYMBOL so that it is recognized by the current BBDB version. BBDB < 3 used `net'; BBDB >= 3 uses `mail'." ;; This just-in-time translation permits upgrading from BBDB 2 to ;; BBDB 3 without restarting Emacs. (if (and (eq field-symbol 'net) - (or - ;; MELPA versions of BBDB may have a bad package version, - ;; but they're all version 3 or later. - (equal bbdb-version "@PACKAGE_VERSION@") - ;; Development versions of BBDB can have the format "X.YZ - ;; devo". Split the string just in case. - (version<= "3" (car (split-string bbdb-version))))) + (eudc--using-bbdb-3-or-newer-p)) 'mail field-symbol)) -- 1.8.3.1 --=-=-=--