unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Thomas Fitzsimmons <fitzsim@fitzsim.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: RFC: Adding BBDB to Emacs core
Date: Mon, 16 Apr 2018 23:37:17 -0400	[thread overview]
Message-ID: <m3bmei4i6q.fsf@fitzsim.org> (raw)
In-Reply-To: <jwvwox7huo4.fsf-monnier+gmane.emacs.devel@gnu.org> (Stefan Monnier's message of "Mon, 16 Apr 2018 14:36:06 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> 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()
  funcall-interactively(eudc-expand-inline)

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
`eudc-server-hotlist'.

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

Thomas



  parent reply	other threads:[~2018-04-17  3:37 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-14  5:54 RFC: Adding BBDB to Emacs core Thomas Fitzsimmons
2018-04-14 12:24 ` Joshua Branson
2018-04-14 22:06   ` Eric Abrahamsen
2018-04-14 22:46     ` Joshua Branson
2018-04-15  6:18       ` Bozhidar Batsov
2018-04-16  5:21         ` John Wiegley
2018-04-16 14:53           ` Thomas Fitzsimmons
2018-04-16 18:36             ` Stefan Monnier
2018-04-16 20:30               ` Eric Abrahamsen
2018-04-17  3:37               ` Thomas Fitzsimmons [this message]
2018-04-23 12:53             ` Phillip Lord
2018-04-23 13:21               ` Stefan Monnier
2018-04-23 16:21                 ` Phillip Lord
2018-04-23 17:45                   ` Stefan Monnier
2018-04-24 21:41                     ` Phillip Lord
2018-04-24 22:31                       ` Stefan Monnier
2018-04-25  0:42                         ` Paul Eggert
2018-04-25  1:50                           ` Stefan Monnier
2018-04-25  9:21                             ` Phillip Lord
2018-04-25 12:02                               ` Stefan Monnier
2018-04-25 16:31                                 ` Phillip Lord
2018-04-25 16:57                                   ` Stefan Monnier
2018-04-26 14:59                                     ` Phillip Lord
2018-04-25  9:19                         ` Phillip Lord
2018-04-25 16:04                         ` Radon Rosborough
2018-04-25 16:32                           ` Phillip Lord
2018-04-25 16:55                             ` Stefan Monnier
2018-04-25 20:16                               ` Radon Rosborough
2018-04-26 15:02                               ` Phillip Lord
2018-04-26 16:38                                 ` Stefan Monnier
2018-04-27  9:57                                   ` Phillip Lord
2018-04-27 13:32                                     ` Stefan Monnier
2018-04-17  3:23           ` Roland Winkler
2018-04-17  4:56             ` John Wiegley
2018-04-17 13:07             ` Stefan Monnier
2018-04-17 15:13               ` Roland Winkler
2018-04-18 23:11                 ` Stephen Leake
2018-04-23 12:57             ` Phillip Lord
2018-04-23 13:26             ` Stefan Monnier
2018-04-23 15:29               ` Roland Winkler
2018-04-14 22:13   ` Thomas Fitzsimmons
2018-04-14 13:34 ` Glenn Morris
2018-04-14 17:10   ` Radon Rosborough
2018-04-14 17:38   ` Thomas Fitzsimmons
2018-04-15 21:20   ` Phillip Lord
2018-04-16  3:11     ` Michael Welsh Duggan
2018-04-16 12:30       ` Stefan Monnier
2018-04-16 17:09     ` Achim Gratz
2018-04-16 18:10       ` Eli Zaretskii
2018-04-16 18:14         ` Achim Gratz
2018-04-23 12:45       ` Phillip Lord

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3bmei4i6q.fsf@fitzsim.org \
    --to=fitzsim@fitzsim.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).