(Yes, this bug/request is over a year old!)

On February 13, [EMAIL PROTECTED] said:
> I am having a problem with one aspect of bbdb-dial.  I have everyting
> working except for bbdb-dial-long-distance-prefix.  bbdb-dial distinguishes
> between local and long distance nubers, dialing the area code in the latter
> case, but it fails to dial the 1 before long distance numbers.  I have tried
> setting bbdb-dial-long-distance-prefix to the number 1 as well as the string
> "1", but neither works (the commentary is unclear to me here, stating that
> this variable should be set to a "string of digits").
> 
> For testing purposes I tried setting the bbdb-dial-local-prefix, but that
> number is not dialed for local numbers either.
> 
> Any suggestions would be appreciated.

The bbdb-dial logic, which I've been kicking around for bits and
pieces of the last month, turns out to be highly Americanized (there's
a surprise!) and rather convoluted. The various variables interact as
follows:

* bbdb-dial-local-prefix-alist is the first to be applied. This list
  is treated as a collection of (SEXPR REPLACEMENT) pairs; SEXPR
  is evaluated to produce a regular expression which is then applied
  to the number. If it matches, whatever it matches is replaced by
  REPLACEMENT. Using a prefix arg to bbdb-dial disables this.

* if there's an xNNN suffix on the number, it's removed (since we
  don't dial extensions)

* if the first step produces a transformed number (this is pretty dumb
  - it doesn't check if the number is actually shorter/different, just
  that one or more of the transforms applied) then no further changes
  are made before dialing.

OTHERWISE
  - if the number (the original number) starts with a '0', it's deemed
    to be a local number, and bbdb-dial-local-prefix is prepended.

  - if the number starts with a '+', it's deemed to be long distance,
    and bbdb-dial-long-distance-prefix is applied.

The key to making this do what you mean, at present, is in
bbdb-dial-local-prefix, since that allows you to apply arbitrary
transformations to numbers. The current default is to identify numbers
within bbdb-default-area-code and remove the area code from them. I'm
redoing the documentation section on dialing to explain how this stuff
works until such time as I can think of a way of safely replacing it
with something a little more intuitive (and a little less
parochial...)

Cheers,
Waider.
-- 
[EMAIL PROTECTED] / Yes, it /is/ very personal of me.

"Look at the XFE makefile, can you understand what's going on ? No, not you
 Brian." - Ramiro Estrugo

_______________________________________________
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/

Reply via email to