[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb 817414a 234/350: Drop object-print for cl-print-ob
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb 817414a 234/350: Drop object-print for cl-print-object |
Date: |
Mon, 14 Aug 2017 11:46:44 -0400 (EDT) |
branch: externals/ebdb
commit 817414a8c523d59303d459f19ca245cf6d3e32b5
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Drop object-print for cl-print-object
* ebdb.el (cl-print-object): If this method is available, use it.
Otherwise, don't bother with `object-print', it's not useful enough
to want to maintain alongside the former. We've defined
`cl-print-object' for records, database, name fields, mail fields,
and phone fields.
---
ebdb.el | 49 +++++++++++++++++++++++++++++++++++++++----------
1 file changed, 39 insertions(+), 10 deletions(-)
diff --git a/ebdb.el b/ebdb.el
index f4cc587..1baaa4d 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -814,6 +814,14 @@ simple or complex name class."
(t
(ebdb-parse 'ebdb-field-name-simple input slots)))))
+(eval-when-compile
+ (when (fboundp 'cl-print-object)
+ (cl-defmethod cl-print-object ((name ebdb-field-name) stream)
+ (princ (format "#<%S %s>"
+ (eieio-object-class-name name)
+ (ebdb-string name))
+ stream))))
+
(defclass ebdb-field-name-simple (ebdb-field-name)
((name
:type string
@@ -1186,6 +1194,14 @@ first one."
(and (eq l-p 'normal)
(eq r-p 'defunct)))))))
+(eval-when-compile
+ (when (fboundp 'cl-print-object)
+ (cl-defmethod cl-print-object ((mail ebdb-field-mail) stream)
+ (princ (format "#<%S %s>"
+ (eieio-object-class-name mail)
+ (slot-value mail 'mail))
+ stream))))
+
;;; Address fields
(defclass ebdb-field-address (ebdb-field-labeled ebdb-field)
@@ -1437,6 +1453,14 @@ first one."
(plist-put slots :number acc))
(cl-call-next-method class string slots)))
+(eval-when-compile
+ (when (fboundp 'cl-print-object)
+ (cl-defmethod cl-print-object ((phone ebdb-field-phone) stream)
+ (princ (format "#<%S %s>"
+ (eieio-object-class-name phone)
+ (ebdb-string phone))
+ stream))))
+
;;; Notes field
(defclass ebdb-field-notes (ebdb-field)
@@ -2055,12 +2079,13 @@ only return fields that are suitable for user editing.")
"Provide a base method that does nothing."
nil)
-(cl-defmethod object-print ((record ebdb-record) &optional strings)
- (cl-call-next-method
- record
- (append strings (format " %s" (if (ebdb-record-cache record)
- (ebdb-record-name record)
- (ebdb-string (slot-value record 'name)))))))
+(eval-when-compile
+ (when (fboundp 'cl-print-object)
+ (cl-defmethod cl-print-object ((record ebdb-record) stream)
+ (princ (format "#<%S %s>"
+ (eieio-object-class-name record)
+ (ebdb-string record))
+ stream))))
;; The following functions are here because they need to come after
;; `ebdb-record' has been defined.
@@ -3214,10 +3239,14 @@ the persistent save, or allow them to propagate."
:documentation "A `ebdb-db' subclass that saves records
directly in its persistence file.")
-(cl-defmethod object-print ((db ebdb-db-file) &optional strings)
- (cl-call-next-method
- db
- (append strings (format " %d records" (length (slot-value db 'records))))))
+(eval-when-compile
+ (when (fboundp 'cl-print-object)
+ (cl-defmethod cl-print-object ((db ebdb-db) stream)
+ (princ (format "#<%S %s %d records>"
+ (eieio-object-class-name db)
+ (slot-value db 'file)
+ (length (slot-value db 'records)))
+ stream))))
;; `ebdb-db-file' doesn't need a `ebdb-db-load' method. Its records
;; are stored in its persistence file, directly in the :records slot,
- [elpa] externals/ebdb 762f027 219/350: Add Makefile, (continued)
- [elpa] externals/ebdb 762f027 219/350: Add Makefile, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 325426e 207/350: Add ebdb-complete.el (#32), Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb ea13778 221/350: Autoload calendar-absolute-from-gregorian, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb af13080 218/350: Support sending text messages via Signal, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 94749fd 224/350: Expand gnus-user-format-function-%s, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb c9f8f33 226/350: Be more when careful migrating timestamps, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb b7a28f3 227/350: Be more forgiving about contents of BBDB file when migrating, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb dd675a6 223/350: Revert changes to pop-up routine., Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 1096c6e 230/350: Search read transform functions needs to work for all methods, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb adfe13f 235/350: Fix stupidity, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 817414a 234/350: Drop object-print for cl-print-object,
Eric Abrahamsen <=
- [elpa] externals/ebdb a629bde 236/350: Last tweak to pop-up buffers, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 444f762 231/350: Fix condition-case catch in ebdb-i18n-* methods, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 2de4f0e 241/350: Apparently I was spelling vCard wrong, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb f9d5af6 243/350: Add close parenthesis to email regexp delimiter, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 4882f66 238/350: Include addresses in vcard output, plus escaping, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 440cb9e 245/350: More search functions can use prefixes: mention in manual, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb c8bdb70 194/350: Don't assume Chinese names have both surname and given-names, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 212a1e1 212/350: Snarfing shouldn't pop up its own window, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb fc813dd 193/350: Yet more fixes to proper name formatting, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 06123d9 217/350: Make sure database files are decoded as utf-8-emacs, Eric Abrahamsen, 2017/08/14