Re: [BBDB] ChangeLog 2015-11-08 Re-sorting records and new snarfing rule

2015-11-09 Thread Marco Wahl
"Roland Winkler"  writes:

> Also, I added a new snarfing rule `eu' following a suggestion by
> Marco Wahl sent to this list.  I am sorry, Marco, my final code
> has turned out rather different from your original suggestion.

This is perfectly fine for me.  Thanks for remembering my attempts!  I
try to activate the new snarfing rule today.

> Yet hopefully the new code will be more robust and it should also be
> useful for yet more people.

Great, thanks for your work!


Very best regards,
-- 
Marco Wahl
GPG: 0x49010A040A3AE6F2


--
Presto, an open source distributed SQL query engine for big data, initially
developed by Facebook, enables you to easily query your data on Hadoop in a 
more interactive manner. Teradata is also now providing full enterprise
support for Presto. Download a free open source copy now.
http://pubads.g.doubleclick.net/gampad/clk?id=250295911=/4140
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


[BBDB] ChangeLog 2015-11-08 Re-sorting records and new snarfing rule

2015-11-08 Thread Roland Winkler
It has been rather quiet on this list.

Recently I discovered that my BBDB file was mis-sorted and I could
well reproduce what had happened.  I realized that I never paid
much attention to how BBDB re-sorts the database after changing a
record.  The old code was rather complicated and error-prone.  The
new code is simpler and hopefully also more robust.

Also, I added a new snarfing rule `eu' following a suggestion by
Marco Wahl sent to this list.  I am sorry, Marco, my final code
has turned out rather different from your original suggestion.  Yet
hopefully the new code will be more robust and it should also be
useful for yet more people.


2015-11-08  Roland Winkler  
Add new snarfing rule eu for many continental European countries.
Improve snarfing algorithm.
* lisp/bbdb-snarf.el (bbdb-snarf-rule-alist): Add new rule eu.
(bbdb-snarf-phone-nanp-regexp, bbdb-snarf-postcode-us-regexp)
(bbdb-snarf-url-regexp): Improve regexp.  Use first subexpression.
(bbdb-snarf-mail-regexp): New variable.
(bbdb-snarf-mail): Use it.
(bbdb-snarf-address-us-country): New variable.
(bbdb-snarf-address-us): Use it.  Check whether we actually
snarfed an address.
(bbdb-snarf-phone-eu-regexp, bbdb-snarf-postcode-eu-regexp)
(bbdb-snarf-address-eu-country): New variables.
(bbdb-snarf-label): Use save-match-data.
(bbdb-snarf-phone-nanp): Use save-match-data.  Reverse order of
snarfed phone numbers.
(bbdb-snarf-phone-eu, bbdb-snarf-address-eu): New functions.

2015-11-08  Roland Winkler  
Simplify re-sorting of records when a record has been changed.
Re-display re-sorted records.
* lisp/bbdb.el (bbdb-need-to-sort): Removed.
(bbdb-record-set-name): Simplify accordingly.
(bbdb-record-set-sortkey): Always evaluate new sortkey.
(bbdb-record-sortkey): Simplify accordingly.
(bbdb-change-record): Sort records if we have a new sort key.
(bbdb-redisplay-record-globally): Rename from
bbdb-maybe-update-display.  New optional arg sort.
(bbdb-delete-record-internal, bbdb-insert-record-internal): Do not
unset sort key.
(bbdb-display-records): Put point at beginning of buffer.
(bbdb-redisplay-record): New optional arg sort.  Throw error if
record was not displayed previously.
(bbdb-sort-records): Clarify status message.  Redisplay sorted
records.
* lisp/bbdb-com.el (bbdb-fix-records): Sort records.
(bbdb-create, bbdb-create-internal, bbdb-merge-records): Use nil
for unused second arg of bbdb-change-record.
(bbdb-edit-field, bbdb-transpose-fields): Do not worry about
re-sorting records.
* lisp/bbdb-mua.el (bbdb-annotate-message): Use nil
for unused second arg of bbdb-change-record.

--
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/