branch: externals/ebdb
commit 9169c1e5313ae238a1f9d139fa2dce5b977e8656
Author: Eric Abrahamsen <[email protected]>
Commit: Eric Abrahamsen <[email protected]>
When inserting fields, read the field but insert a clone
Fixes #43
* ebdb-com.el (ebdb-insert-field): Read field, then insert clone. This
ensures that, when inserting a field into multiple records, each
record gets its own copy that it can manipulate itself, if it needs
to.
---
ebdb-com.el | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/ebdb-com.el b/ebdb-com.el
index b29e399..f651368 100644
--- a/ebdb-com.el
+++ b/ebdb-com.el
@@ -1615,10 +1615,12 @@ in `ebdb-db-list', using its default record class. Use
(let
((field (ebdb-read class
(when (equal class 'ebdb-field-user-simple)
- `(:object-name ,label)))))
+ `(:object-name ,label))))
+ clone)
(ebdb-with-record-edits (r records)
+ (setq clone (clone field))
(condition-case nil
- (ebdb-record-insert-field r field)
+ (ebdb-record-insert-field r clone)
(ebdb-unacceptable-field
(message "Record %s cannot accept field %s" (ebdb-string r) field)
(sit-for 2)))))))