summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/eieio.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2019-06-17 21:40:05 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2019-06-17 21:40:12 +0200
commitf8efeee0e1033ca45885210c44a5f72c47d2d6a6 (patch)
tree89b4a49f36f7e78f7ffd37c6235316fc9d05f9f6 /lisp/emacs-lisp/eieio.el
parent1942f4ccba52896e3e97789dc6b51926ad74c591 (diff)
downloademacs-f8efeee0e1033ca45885210c44a5f72c47d2d6a6.tar.gz
Work around warning from macroexpanding obsolete method
* lisp/emacs-lisp/eieio.el (object-print): Move method definition to before generic definition because the generic definition obsoletes the method, which will then output a warning from when macroexpanding.
Diffstat (limited to 'lisp/emacs-lisp/eieio.el')
-rw-r--r--lisp/emacs-lisp/eieio.el18
1 files changed, 9 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el
index 504133c1e77..3169541e5bf 100644
--- a/lisp/emacs-lisp/eieio.el
+++ b/lisp/emacs-lisp/eieio.el
@@ -827,15 +827,6 @@ first and modify the returned object.")
;; No cleanup... yet.
nil)
-(cl-defgeneric object-print (this &rest _strings)
- "Pretty printer for object THIS.
-
-It is sometimes useful to put a summary of the object into the
-default #<notation> string when using EIEIO browsing tools.
-Implement this method to customize the summary."
- (declare (obsolete cl-print-object "26.1"))
- (format "%S" this))
-
(cl-defmethod object-print ((this eieio-default-superclass) &rest strings)
"Pretty printer for object THIS. Call function `object-name' with STRINGS.
The default method for printing object THIS is to use the
@@ -850,6 +841,14 @@ When passing in extra strings from child classes, always remember
to prepend a space."
(eieio-object-name this (apply #'concat strings)))
+(cl-defgeneric object-print (this &rest _strings)
+ "Pretty printer for object THIS.
+
+It is sometimes useful to put a summary of the object into the
+default #<notation> string when using EIEIO browsing tools.
+Implement this method to customize the summary."
+ (declare (obsolete cl-print-object "26.1"))
+ (format "%S" this))
(with-suppressed-warnings ((obsolete object-print))
(cl-defmethod cl-print-object ((object eieio-default-superclass) stream)
@@ -859,6 +858,7 @@ to prepend a space."
;; out-of-tree.
(princ (object-print object) stream)))
+
(defvar eieio-print-depth 0
"The current indentation depth while printing.
Ignored if `eieio-print-indentation' is nil.")