branch: externals/ebdb commit a25e1eb35d45a6b3c8340cc04c0a2f2d150d2b5e Author: Eric Abrahamsen <e...@ericabrahamsen.net> Commit: Eric Abrahamsen <e...@ericabrahamsen.net>
Use values from "slots" in role field ebdb-read * ebdb.el (ebdb-read): We should be allowing values in "slots" to override the read process. --- ebdb.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ebdb.el b/ebdb.el index eb0d396..cfb2e9f 100644 --- a/ebdb.el +++ b/ebdb.el @@ -1396,11 +1396,14 @@ first one." (cl-call-next-method)) (cl-defmethod ebdb-read ((role (subclass ebdb-field-role)) &optional slots obj) - (let ((org-id (if obj (slot-value obj 'org-uuid) - (ebdb-record-uuid (ebdb-prompt-for-record nil 'ebdb-record-organization)))) - (mail (ebdb-with-exit - (ebdb-read ebdb-default-mail-class nil - (when obj (slot-value obj 'mail)))))) + (let ((org-id (or (plist-get slots 'org-uuid) + (if obj (slot-value obj 'org-uuid) + (ebdb-record-uuid (ebdb-prompt-for-record + nil 'ebdb-record-organization))))) + (mail (or (plist-get slots 'mail) + (ebdb-with-exit + (ebdb-read ebdb-default-mail-class nil + (when obj (slot-value obj 'mail))))))) (when mail (setq slots (plist-put slots :mail mail))) (setq slots (plist-put slots :org-uuid org-id))