[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFC: Adding BBDB to Emacs core

From: Thomas Fitzsimmons
Subject: Re: RFC: Adding BBDB to Emacs core
Date: Mon, 16 Apr 2018 23:37:17 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

> Before deciding on this, I think we'd need a clear picture of the ways
> in which BBDB is needed/used by EUDC.

OK, I'll try to provide that.

> I see you saying things like "EUDC requiring something not in the tree",
> but I don't see anything in EUDC that really requires BBDB, instead
> I just see glue code that lets you use BBDB when it's available,

When I say "require" there, I mean in the sense that to properly
byte-compile lisp/net/eudcb-bbdb.el and lisp/net/eudc-export.el, which
are part of EUDC, BBDB packages are require'd.

On master there are workarounds in place to stub out or ignore the
missing dependencies.  One aspect of the BBDB inclusion proposal is that
I'm trying to get rid of those workarounds (in EUDC first and eventually
in Org and Gnus).  See for example, these commits on the
scratch/eudc-bbdb-3 branch:

06c3557  EUDC: Require bbdb and bbdb-com without ignoring errors
f1ab95d  EUDC: Require bbdb, bbdb-com without NOERROR
262dce0  EUDC: Remove external BBDB function declarations
e355a65  EUDC: Remove inline requires of bbdb in BBDB backend

And yes, to actually use the BBDB backend of EUDC at runtime, the BBDB
package needs to be loaded.  On the branch, I've enabled the BBDB
backend by default in EUDC, which eliminates a configuration step for
email completion (see below):

193f9d5  EUDC: Enable BBDB backend by default

> just like there's code that lets you use LDAP when it's available (but
> there's clearly no corresponding push to try and add LDAP directly
> into Emacs).

The Elisp part of Emacs's LDAP support, lisp/net/ldap.el, is already in
core.  So EUDC's LDAP backend, lisp/net/eudcb-ldap.el, can just (require
'ldap) directly during byte-compilation.

ldap.el internally requires the ldapsearch command line utility, which
is provided on free operating systems as part of OpenLDAP packages.

I actually would prefer ldap.el to be a pure Elisp LDAP client (and thus
eliminate the OpenLDAP dependency) so that it could run with minimal
configuration even on non-free operating systems, but I haven't looked
at whether that would be practical to implement.

> Could you give us a clear description of how BBDB is used by EUDC?
> I'm thinking of a list of BBDB functions/variables that are used by
> EUDC, along with a description of what they are used for (not what they
> do themselves, but what EUDC uses them for).

The main function used is bbdb-search.  Here's a backtrace of EUDC
expanding a contact:

  eval((bbdb-search records "Examp"))
  eudc-bbdb-query-internal(((firstname . "Examp")) (firstname lastname net))
  eudc-query(((firstname . "Examp")) (firstname lastname net))

eudc-expand-inline uses bbdb-search to search for contacts in the BBDB
database using a search string, and return a list of contact records to
it.  Then from those records, EUDC creates strings in the format
"[first-name] [last-name] <email-address>" (the output format is a
configurable property of EUDC); if there is only one result, it is
inserted at point; if there are multiple results, EUDC allows the user
to interactively select the one to insert at point.

> Also good would be to describe concrete ways in which having BBDB in
> Emacs itself would improve the user's experience (presumably for users
> which don't already use BBDB).

OK, assuming the user wants to use Gnus, and they want to store contact
information they come across in Gnus locally, then BBDB would be the
recommended, "Emacs core endorsed" way of doing that, and the key
bindings, configuration etc. would all default to using BBDB.

Then EUDC would have the BBDB backend enabled by default (as shown on
the branch), and Gnus would have default keybindings for
`eudc-expand-inline' when point is in To: or Cc:.

Then without any setup, the user could snarf an address from within an
email via a keypress, then complete that contact's name and address when
composing a new email by pressing TAB.

If Gnus defaults to using `eudc-expand-inline`, then the user can also
get LDAP completion support just by adding an ldap entry to

I think that level of default integration would be hard to achieve and
maintain without having BBDB available in core.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]