emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r118254: Fix bug #18897 with printing large objects


From: Eli Zaretskii
Subject: [Emacs-diffs] trunk r118254: Fix bug #18897 with printing large objects from eieio.el.
Date: Sun, 02 Nov 2014 15:25:08 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 118254
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/18897
author: Eric Abrahamsen <address@hidden>
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Sun 2014-11-02 17:24:33 +0200
message:
  Fix bug #18897 with printing large objects from eieio.el.
  
   lisp/emacs-lisp/eieio.el (eieio-edebug-prin1-to-string): Adjust
   for use as advice.
   (edebug-setup-hook): Advise `edebug-prin1-to-string'.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/emacs-lisp/eieio.el       eieio.el-20091113204419-o5vbwnq5f7feedwu-10973
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-11-02 05:46:04 +0000
+++ b/lisp/ChangeLog    2014-11-02 15:24:33 +0000
@@ -1,3 +1,9 @@
+2014-11-02  Eric Abrahamsen  <address@hidden>
+
+       * emacs-lisp/eieio.el (eieio-edebug-prin1-to-string): Adjust for
+       use as advice.
+       (edebug-setup-hook): Advise `edebug-prin1-to-string'.  (Bug#18897)
+
 2014-11-02  Stefan Monnier  <address@hidden>
 
        * emacs-lisp/pp.el (pp-macroexpand-expression): Use macroexpand-1

=== modified file 'lisp/emacs-lisp/eieio.el'
--- a/lisp/emacs-lisp/eieio.el  2014-10-19 02:14:58 +0000
+++ b/lisp/emacs-lisp/eieio.el  2014-11-02 15:24:33 +0000
@@ -853,17 +853,19 @@
 
 ;;; Interfacing with edebug
 ;;
-(defun eieio-edebug-prin1-to-string (object &optional noescape)
+(defun eieio-edebug-prin1-to-string (print-function object &optional noescape)
   "Display EIEIO OBJECT in fancy format.
-Overrides the edebug default.
-Optional argument NOESCAPE is passed to `prin1-to-string' when appropriate."
+
+Used as advice around `edebug-prin1-to-string', held in the
+variable PRINT-FUNCTION.  Optional argument NOESCAPE is passed to
+`prin1-to-string' when appropriate."
   (cond ((class-p object) (eieio-class-name object))
        ((eieio-object-p object) (object-print object))
        ((and (listp object) (or (class-p (car object))
                                 (eieio-object-p (car object))))
         (concat "(" (mapconcat #'eieio-edebug-prin1-to-string object " ")
                  ")"))
-       (t (prin1-to-string object noescape))))
+       (t (funcall print-function object noescape))))
 
 (add-hook 'edebug-setup-hook
          (lambda ()
@@ -887,14 +889,8 @@
            (def-edebug-spec class-constructor form)
            (def-edebug-spec generic-p form)
            (def-edebug-spec with-slots (list list def-body))
-           ;; I suspect this isn't the best way to do this, but when
-           ;; cust-print was used on my system all my objects
-           ;; appeared as "#1 =" which was not useful.  This allows
-           ;; edebug to print my objects in the nice way they were
-           ;; meant to with `object-print' and `class-name'
-           ;; (defalias 'edebug-prin1-to-string 'eieio-edebug-prin1-to-string)
-           )
-         )
+           (advice-add 'edebug-prin1-to-string
+                       :around #'eieio-edebug-prin1-to-string)))
 
 
 ;;; Start of automatically extracted autoloads.


reply via email to

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