emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ebdb 7a7d71b: Get rid of separate ebdb-org-field-tags c


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb 7a7d71b: Get rid of separate ebdb-org-field-tags class
Date: Tue, 28 Jan 2020 17:36:24 -0500 (EST)

branch: externals/ebdb
commit 7a7d71b9540f325aaa93ce13533f7408531327fa
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    Get rid of separate ebdb-org-field-tags class
    
    * ebdb-org.el (make-instance): Have make-instance return an instance
    of ebdb-field-tags, instead.
    (ebdb-read): This method should just work on ebdb-field-tags.
    * ebdb.el (ebdb-separator-alist): Add ebdb-field-tags here.
    (ebdb-record-field-slot-query): Don't offer the ebdb-org-field-tags
    class here.
    * ebdb.org (Tag field): Fix documentation.
---
 ebdb-org.el | 15 ++++++++--
 ebdb.el     |  9 ++++--
 ebdb.info   | 96 ++++++++++++++++++++++++++++++-------------------------------
 ebdb.org    |  7 ++---
 ebdb.texi   |  7 ++---
 5 files changed, 72 insertions(+), 62 deletions(-)

diff --git a/ebdb-org.el b/ebdb-org.el
index 392269b..73eff77 100644
--- a/ebdb-org.el
+++ b/ebdb-org.el
@@ -122,15 +122,26 @@ italicized, in all other cases it is left unchanged."
     (format "<text:span text:style-name=\"Emphasis\">%s</text:span>" desc))
    (t desc)))
 
+;; It was a mistake to make this a separate field class -- this
+;; library should have just provided a new `ebdb-read' method for the
+;; underlying `ebdb-field-tags' class.  I'm overriding `make-instance'
+;; to redirect to `ebdb-field-tags', and will leave this override in
+;; place for a year or so, then remove this class altogether some time
+;; around Feb 2021.
 ;;;###autoload
 (defclass ebdb-org-field-tags (ebdb-field-tags)
   nil
   :human-readable "org tags")
 
-(cl-defmethod ebdb-read ((field (subclass ebdb-org-field-tags)) &optional 
slots obj)
+(cl-defmethod make-instance :around ((cls (subclass ebdb-org-field-tags))
+                                    &rest slots)
+  "Return an instance of `ebdb-field-tags' instead."
+  (apply #'cl-call-next-method 'ebdb-field-tags slots))
+
+(cl-defmethod ebdb-read ((field (subclass ebdb-field-tags)) &optional slots 
obj)
   (let* ((crm-separator (cadr (assq 'ebdb-field-tags ebdb-separator-alist)))
         (val (completing-read-multiple
-              "Tags: "
+              (format "Tags (separate with \"%s\"): " crm-separator)
               (org--tag-add-to-alist
                (org--tag-add-to-alist
                 (org--tag-add-to-alist
diff --git a/ebdb.el b/ebdb.el
index b674b31..74f5c31 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -543,6 +543,7 @@ This is used for fields which do not have an entry in 
`ebdb-separator-alist'."
     (affix "[,;]"  ", ")
     (aka "[,;]" ", ")
     (mail "[,;]" ", ")
+    (ebdb-field-tags ":" ":")
     (mail-alias "[,;]" ", ")
     (vm-folder "[,;]" ", ")
     (birthday "\n" "\n")
@@ -2334,8 +2335,6 @@ See `ebdb-url-valid-schemes' for a list of acceptable 
schemes."
 (defvar ebdb-tags nil
   "Variable holding tags defined for EBDB records.")
 
-(push '(ebdb-field-tags ":" ":") ebdb-separator-alist)
-
 (defclass ebdb-field-tags (ebdb-field-user ebdb-field-singleton)
   ((tags
     :initarg :tags
@@ -2829,7 +2828,11 @@ OLD-FIELD's values as defaults.")
     ;; Pick up all externally-defined user fields.
     (dolist (f (eieio-build-class-alist 'ebdb-field-user t))
       (setq user-class (intern (car f)))
-      (unless (rassq user-class alist)
+      (unless (or (rassq user-class alist)
+                 ;; Temporary hack, see comment on
+                 ;; `ebdb-org-field-tags' class definition in
+                 ;; ebdb-org.el.
+                 (eql user-class 'ebdb-org-field-tags))
        (push (cons 'fields user-class) alist)))
     ;; Look, Ma, I used pcase!
     (pcase query
diff --git a/ebdb.info b/ebdb.info
index 9fe7db7..089d3ed 100644
--- a/ebdb.info
+++ b/ebdb.info
@@ -561,15 +561,13 @@ File: ebdb.info,  Node: Tag field,  Next: Mail folder 
field,  Prev: Role fields,
 ---------------
 
 EBDB comes with a field holding arbitrary tags for records.  When
-searching on the tags field (using ‘/ x’ and selecting “tags”), EBDB
+searching on the tags field (using ‘/ t’ and selecting “tags”), EBDB
 provides the same tag search syntax as Org does, eg.
 “work|laptop+night”.  *Note (org)Matching tags and properties:: for more
 information.
 
-   The ‘ebdb-org’ library comes with another tagging class,
-‘ebdb-org-field-tags’, that behaves just like the standard class, except
-the user’s Org-file tags are offered for completion.  *note Org
-Integration::.
+   The ‘ebdb-org’ library alters the behavior of this class, offering
+all the user’s Org-file tags for completion.  *note Org Integration::.
 
 
 File: ebdb.info,  Node: Mail folder field,  Prev: Tag field,  Up: Field Types
@@ -2658,50 +2656,50 @@ Node: Deleting Records and Fields14850
 Node: Field Types15246
 Node: Role fields17532
 Node: Tag field19513
-Node: Mail folder field20157
-Node: MUA Interaction20485
-Node: Loading MUA Code21038
-Node: Display and Updating21751
-Node: Pop-up Buffers22517
-Node: Auto-Updating Records24515
-Node: Noticing and Automatic Rules28921
-Node: Interactive Commands30254
-Node: EBDB and MUA summary buffers32728
-Node: Sender name display33246
-Node: Summary buffer marks34473
-Node: Mail Address Completion35652
-Node: A Note on Completion38161
-Node: Specific MUAs38784
-Node: Gnus38932
-Node: Posting Styles39154
-Node: EBDB Buffers40729
-Node: Searching41940
-Node: Changing Search Behavior43654
-Node: The Basics of ebdb-mode44901
-Node: Customizing Record Display49249
-Node: Marking53569
-Node: Exporting/Formatting53996
-Node: Completion54931
-Node: Snarfing55727
-Node: Internationalization57744
-Node: Diary Integration60445
-Node: Mail Aliases61310
-Node: vCard Support62024
-Node: Org Integration62523
-Node: Citing Records64421
-Node: Hacking EBDB65179
-Node: Field Classes67772
-Node: Init and Delete Methods70908
-Node: The Labeled Field Class72415
-Node: The Singleton Field Class73269
-Node: Actions73707
-Node: Custom Field Searching74379
-Node: Fast Lookups77246
-Node: Formatting in the EBDB Buffer79056
-Node: Writing Internationalization Libraries81132
-Node: Writing Integration For New MUAs85548
-Node: Article snarfing88996
-Node: Index89714
+Node: Mail folder field20082
+Node: MUA Interaction20410
+Node: Loading MUA Code20963
+Node: Display and Updating21676
+Node: Pop-up Buffers22442
+Node: Auto-Updating Records24440
+Node: Noticing and Automatic Rules28846
+Node: Interactive Commands30179
+Node: EBDB and MUA summary buffers32653
+Node: Sender name display33171
+Node: Summary buffer marks34398
+Node: Mail Address Completion35577
+Node: A Note on Completion38086
+Node: Specific MUAs38709
+Node: Gnus38857
+Node: Posting Styles39079
+Node: EBDB Buffers40654
+Node: Searching41865
+Node: Changing Search Behavior43579
+Node: The Basics of ebdb-mode44826
+Node: Customizing Record Display49174
+Node: Marking53494
+Node: Exporting/Formatting53921
+Node: Completion54856
+Node: Snarfing55652
+Node: Internationalization57669
+Node: Diary Integration60370
+Node: Mail Aliases61235
+Node: vCard Support61949
+Node: Org Integration62448
+Node: Citing Records64346
+Node: Hacking EBDB65104
+Node: Field Classes67697
+Node: Init and Delete Methods70833
+Node: The Labeled Field Class72340
+Node: The Singleton Field Class73194
+Node: Actions73632
+Node: Custom Field Searching74304
+Node: Fast Lookups77171
+Node: Formatting in the EBDB Buffer78981
+Node: Writing Internationalization Libraries81057
+Node: Writing Integration For New MUAs85473
+Node: Article snarfing88921
+Node: Index89639
 
 End Tag Table
 
diff --git a/ebdb.org b/ebdb.org
index babb9e5..eaa26c6 100644
--- a/ebdb.org
+++ b/ebdb.org
@@ -401,14 +401,13 @@ person record, or a new person if point is on an 
organization.
 :ID:       d9073bc7-8731-4919-9fc0-7d1dcf98426e
 :END:
 EBDB comes with a field holding arbitrary tags for records.  When
-searching on the tags field (using {{{kbd(/ x)}}} and selecting
+searching on the tags field (using {{{kbd(/ t)}}} and selecting
 "tags"), EBDB provides the same tag search syntax as Org does,
 eg.@@texinfo:@:@@ "work|laptop+night".  @@texinfo:@xref{Matching
 tags and properties,,,org}@@ for more information.
 
-The @@texinfo:@file{@@ebdb-org@@texinfo:}@@ library comes with another
-tagging class, ~ebdb-org-field-tags~, that behaves just like the
-standard class, except the user's Org-file tags are offered for
+The @@texinfo:@file{@@ebdb-org@@texinfo:}@@ library alters the
+behavior of this class, offering all the user's Org-file tags for
 completion.  [[id:ee6b5ccb-a7a6-4c42-84a5-9eb0bbdc040f][Org Integration]].
 *** Mail folder field
 The "mail folder" field is used to indicate which folder or group
diff --git a/ebdb.texi b/ebdb.texi
index a2bcc72..5735ae1 100644
--- a/ebdb.texi
+++ b/ebdb.texi
@@ -591,14 +591,13 @@ person record, or a new person if point is on an 
organization.
 @subsection Tag field
 
 EBDB comes with a field holding arbitrary tags for records.  When
-searching on the tags field (using @kbd{/ x} and selecting
+searching on the tags field (using @kbd{/ t} and selecting
 ``tags''), EBDB provides the same tag search syntax as Org does,
 eg.@: ``work|laptop+night''.  @xref{Matching
 tags and properties,,,org} for more information.
 
-The @file{ebdb-org} library comes with another
-tagging class, @code{ebdb-org-field-tags}, that behaves just like the
-standard class, except the user's Org-file tags are offered for
+The @file{ebdb-org} library alters the
+behavior of this class, offering all the user's Org-file tags for
 completion.  @ref{Org Integration}.
 
 @node Mail folder field



reply via email to

[Prev in Thread] Current Thread [Next in Thread]