branch: externals/ebdb
commit aae57ffba49cef6497a8c30e905cc2900cc06b7b
Author: Eric Abrahamsen <[email protected]>
Commit: Eric Abrahamsen <[email protected]>
Ensure that extra name field instances go in 'aka slot
* ebdb.el (ebdb-field-name): This should subclass ebdb-field, not
ebdb-field-user, or else instances will go in the 'fields slot.
(ebdb-record-field-slot-query): Must explicitly list the types of
name class, and the fact they both go in the 'aka slot.
There's actually no reason to have a separate 'aka slot --
initialization and caching does everything that needs doing with name
instances.
---
ebdb.el | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/ebdb.el b/ebdb.el
index b6b01f0..109dc54 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -747,7 +747,7 @@ process."
;;; The name fields. One abstract base class, and two instantiable
;;; subclasses.
-(defclass ebdb-field-name (ebdb-field-user)
+(defclass ebdb-field-name (ebdb-field)
nil
:abstract t
:documentation "Abstract base class for creating record
@@ -2157,13 +2157,9 @@ priority."
;; TODO: There's no reason why the aka slot can't belong to
;; `ebdb-record-entity'. In fact, what we ought to do is put both the
;; 'name and the 'aka slots on `ebdb-record-entity', and have both
-;; slot types set to `ebdb-field-name'. Then provide a fairly simple
-;; mechanism for letting the user choose whether a name/aka should be
-;; simple or complex. Or, when creating or parsing name fields, we
-;; could always start out with the `ebdb-parse' and `ebdb-read'
-;; methods of `ebdb-field-name', which could then dispatch to the
-;; simple/complex methods depending on the initial string values. Or
-;; something like that.
+;; slot types set to `ebdb-field-name'. Or why not just get rid of
+;; the 'aka slot altogether, and put extra name instances in 'fields?
+;; What's the point of keeping them in an extra slot?
(defclass ebdb-record-person (ebdb-record-entity)
((name
@@ -2258,6 +2254,7 @@ priority."
query
(append
'((aka . ebdb-field-name-complex)
+ (aka . ebdb-field-name-simple)
(relations . ebdb-field-relation)
(organizations . ebdb-field-role))
alist)))