[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 160/287: Fix eieio-object-name-string in emacs 24.4
From: |
Matthew Fidler |
Subject: |
[elpa] 160/287: Fix eieio-object-name-string in emacs 24.4 |
Date: |
Wed, 02 Jul 2014 14:45:35 +0000 |
mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.
commit e465dd174aabe1fc5e2e71767d8e71db5552dfd6
Author: Matthew L. Fidler <address@hidden>
Date: Thu Jun 19 07:04:31 2014 -0500
Fix eieio-object-name-string in emacs 24.4
---
ergoemacs-macros.el | 9 +++++++++
ergoemacs-theme-engine.el | 18 ++++++++----------
2 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/ergoemacs-macros.el b/ergoemacs-macros.el
index 8d7f2bd..2204fa9 100644
--- a/ergoemacs-macros.el
+++ b/ergoemacs-macros.el
@@ -327,6 +327,15 @@ DIFFERENCES are the differences from the layout based on
the functions. These a
(ergoemacs-theme-component ,(intern (concat (symbol-name name) "-theme"))
()
,(format "Generated theme component for %s theme" (symbol-name name))
,@differences)))
+
+(defmacro ergoemacs-object-name-string (obj)
+ "Compatability fixes for `object-name-string' or `eieio-object-name-string'.
+"
+ `(,(cond
+ ((and (<= 24 emacs-major-version)
+ (<= 4 emacs-minor-version))
+ 'eieio-object-name-string)
+ (t 'object-name-string)) ,obj))
(provide 'ergoemacs-macros)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; ergoemacs-macros.el ends here
diff --git a/ergoemacs-theme-engine.el b/ergoemacs-theme-engine.el
index 80ebe23..16d472d 100644
--- a/ergoemacs-theme-engine.el
+++ b/ergoemacs-theme-engine.el
@@ -202,10 +202,8 @@ a set type."
(if (not (stringp new-value))
(signal 'invalid-slot-type
(list obj slot-name 'string new-value)))
- (funcall (if (fboundp 'eieio-object-set-name-string)
- 'eieio-object-set-name-string
- 'object-set-name-string) obj new-value))
- (t (save-match-data (replace-regexp-in-string "::.*$" ""
(object-name-string obj))))))
+ (funcall obj new-value))
+ (t (save-match-data (replace-regexp-in-string "::.*$" ""
(ergoemacs-object-name-string obj))))))
((or (eq slot-name 'object-symbol)
(eq slot-name :object-symbol))
(cond ((eq operation 'oset)
@@ -213,7 +211,7 @@ a set type."
(signal 'invalid-slot-type
(list obj slot-name 'symbol new-value)))
(object-set-name-string obj (symbol-name new-value)))
- (t (intern (save-match-data (replace-regexp-in-string "::.*$" ""
(object-name-string obj)))))))
+ (t (intern (save-match-data (replace-regexp-in-string "::.*$" ""
(ergoemacs-object-name-string obj)))))))
(t
(call-next-method))))
@@ -761,7 +759,7 @@ Optionally use DESC when another description isn't found in
`ergoemacs-function-
(defmethod ergoemacs-composite-map--ini ((obj ergoemacs-composite-map))
(unless (slot-boundp obj 'fixed)
- (let ((fixed (ergoemacs-fixed-map (object-name-string obj)
+ (let ((fixed (ergoemacs-fixed-map (ergoemacs-object-name-string obj)
:global-map-p (oref obj global-map-p)
:modify-map (oref obj modify-map)
:full-map (oref obj full-map)
@@ -771,7 +769,7 @@ Optionally use DESC when another description isn't found in
`ergoemacs-function-
(oset obj fixed fixed)))
(unless (slot-boundp obj 'variable)
(let ((var (ergoemacs-variable-map
- (object-name-string obj)
+ (ergoemacs-object-name-string obj)
:global-map-p (oref obj global-map-p)
:just-first (oref obj just-first)
:layout (oref obj layout)
@@ -877,7 +875,7 @@ Assumes maps are orthogonal."
(oset ret hook (oref obj hook)))
(puthash ilay ret keymap-hash)
(oset obj keymap-hash keymap-hash))
- (setq ret (clone ret (object-name-string obj))) ;; Reset name
+ (setq ret (clone ret (ergoemacs-object-name-string obj))) ;; Reset name
ret)))
(defclass ergoemacs-theme-component-maps (ergoemacs-named)
@@ -944,7 +942,7 @@ Assumes maps are orthogonal."
(defvar ergoemacs-theme-comp-hash)
(defmethod ergoemacs-theme-component-maps--save-hash ((obj
ergoemacs-theme-component-maps))
(with-slots (object-name version) obj
- (puthash (object-name-string obj)
+ (puthash (ergoemacs-object-name-string obj)
obj ergoemacs-theme-comp-hash)))
(defmethod ergoemacs-theme-component-maps--ini ((obj
ergoemacs-theme-component-maps))
@@ -954,7 +952,7 @@ Assumes maps are orthogonal."
(unless (slot-boundp obj 'global)
(oset obj global
(ergoemacs-composite-map
- (object-name-string obj)
+ (ergoemacs-object-name-string obj)
:global-map-p t
:variable-reg variable-reg
:just-first just-first
- [elpa] 153/287: Update expections., (continued)
- [elpa] 153/287: Update expections., Matthew Fidler, 2014/07/02
- [elpa] 154/287: Remove ert dependence. Its in emacs 24, Matthew Fidler, 2014/07/02
- [elpa] 151/287: Try to make this a batch test., Matthew Fidler, 2014/07/02
- [elpa] 156/287: Try to make compatible with 24.4, Matthew Fidler, 2014/07/02
- [elpa] 158/287: Take out `mark-whole-buffer', Matthew Fidler, 2014/07/02
- [elpa] 155/287: Use :initialize #'custom-initialize-default, Matthew Fidler, 2014/07/02
- [elpa] 157/287: Add ergoemacs fixes for 24.4, Matthew Fidler, 2014/07/02
- [elpa] 163/287: Removed more mark-whole-buffer, Matthew Fidler, 2014/07/02
- [elpa] 159/287: Take out mark-whole-buffer, Matthew Fidler, 2014/07/02
- [elpa] 164/287: Removed saved-overriding-map variable changes., Matthew Fidler, 2014/07/02
- [elpa] 160/287: Fix eieio-object-name-string in emacs 24.4,
Matthew Fidler <=
- [elpa] 161/287: Removed check for saved-overriding-map, Matthew Fidler, 2014/07/02
- [elpa] 162/287: Add object-set-name-string compatability with 24.4, Matthew Fidler, 2014/07/02
- [elpa] 166/287: Misc cleanups, Matthew Fidler, 2014/07/02
- [elpa] 167/287: Remove minibuffer hook, Matthew Fidler, 2014/07/02
- [elpa] 168/287: Declare cl-gensym, Matthew Fidler, 2014/07/02
- [elpa] 170/287: Fix declare-function for cl-gensym, Matthew Fidler, 2014/07/02
- [elpa] 169/287: Declare ergoemacs-read-key-default, Matthew Fidler, 2014/07/02
- [elpa] 171/287: Change define-function to autoload, Matthew Fidler, 2014/07/02
- [elpa] 172/287: Make this a emacs 24.4 autoload only, Matthew Fidler, 2014/07/02
- [elpa] 173/287: Non-conditional autoload at the beginning of the file., Matthew Fidler, 2014/07/02