[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb 4a4735a 1/2: Don't use eieio-oset-default
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb 4a4735a 1/2: Don't use eieio-oset-default |
Date: |
Mon, 14 Aug 2017 19:58:50 -0400 (EDT) |
branch: externals/ebdb
commit 4a4735ab0051ba1135214421231c9c5fc379269c
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Don't use eieio-oset-default
* ebdb.el (ebdb-db, ebdb-field-image): Turns out I was told this for a
reason.
* ebdb-format.el (ebdb-formatter): Here too.
---
ebdb-format.el | 5 ++---
ebdb.el | 14 +++++---------
2 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/ebdb-format.el b/ebdb-format.el
index cd8ccc5..46726e1 100644
--- a/ebdb-format.el
+++ b/ebdb-format.el
@@ -40,7 +40,8 @@
(coding-system
:type symbol
:initarg :coding-system
- :initform nil
+ ;; "`," is used to trick EIEIO into evaluating the form.
+ :initform `,buffer-file-coding-system
:documentation "The coding system for the formatted
file/buffer/stream.")
;; TODO: Provide for "psuedo field classes" like 'primary-mail and
@@ -93,8 +94,6 @@
:documentation "Abstract base class for EBDB formatters.
Subclass this to produce real formatters.")
-(eieio-oset-default 'ebdb-formatter 'coding-system buffer-file-coding-system)
-
(cl-defmethod ebdb-string ((fmt ebdb-formatter))
(slot-value fmt 'object-name))
diff --git a/ebdb.el b/ebdb.el
index 16af674..1daaf86 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -2056,11 +2056,11 @@ Eventually this method will go away."
(defclass ebdb-field-image (ebdb-field)
((image
:type (or null string symbol)
- :initarg :image))
+ :initarg :image
+ ;; "`," is used to trick EIEIO into evaluating the form.
+ :initform `,ebdb-image))
:human-readable "image")
-(eieio-oset-default 'ebdb-field-image 'image ebdb-image)
-
(cl-defmethod ebdb-read ((image (subclass ebdb-field-image)) &optional slots
obj)
(let ((existing (when obj (slot-value obj 'image)))
value)
@@ -3378,7 +3378,8 @@ executable. When a symbol, assume an Elisp function."
;; I don't think I can actually set this to `ebdb-record': the
;; type needs to be a class, not an instance. Can I do that?
:type symbol
- :initform nil
+ ;; "`," is used to trick EIEIO into evaluating the form.
+ :initform `,ebdb-default-record-class
:custom symbol
:documentation
"The default EIEIO class for records in this database. Must
@@ -3389,11 +3390,6 @@ not be instantiated directly, subclass it instead."
:allow-nil-initform t
:abstract t)
-;; I was told not to use this in Gnus, but I don't remember why. I
-;; suspect it was backward compatibility, and that's obviously already
-;; out the window.
-(oset-default 'ebdb-db record-class ebdb-default-record-class)
-
(cl-defmethod initialize-instance ((db ebdb-db) &optional slots)
"Make sure DB has a uuid."
(unless (and (slot-boundp db 'uuid)