girzel / ebdb

An EIEIO port of BBDB, Emacs' contact-management package
67 stars 11 forks source link

Fix insertion of new fields into multiple records #43

Closed girzel closed 7 years ago

girzel commented 7 years ago

It's possible to mark multiple records and then insert the same field into all of them. However, some fields incorporate record-specific information, such as the email address associated with a mail alias. Because the field values are read in their entirety before they are inserted into the records, this can lead to some meaningless results. Find a way to either a) forbid multiple insertion of fields where it doesn't make sense, or b) somehow specify which slots need to be re-read for each record.

B is the right way to go, but it would be significantly more complicated. Probably we'd need a new class-allocated method `ebdb-field-insert-multiple'. Possibly not worth it.

girzel commented 7 years ago

The solution is, make 'ebdb-read' record-agnostic. Ie, only read the values that have no relation to the record itself (and remove the record as one of the arguments). Do all the record-specific work in an :around version of the 'ebdb-record-insert-field' method, that's the logical place to do it.

girzel commented 7 years ago

'ebdb-read' is already record-agnostic, don't know what I was thinking.