From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#18897: waiting Date: Sat, 01 Nov 2014 11:51:58 -0700 Message-ID: <87oasqycs1.fsf@ericabrahamsen.net> References: <8738a6v4hs.fsf@ericabrahamsen.net> <87vbmyygnb.fsf@ericabrahamsen.net> <83fve2yfyg.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1414867642 5493 80.91.229.3 (1 Nov 2014 18:47:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 1 Nov 2014 18:47:22 +0000 (UTC) Cc: 18897@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 01 19:47:16 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Xkdhj-0002DB-N7 for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Nov 2014 19:47:15 +0100 Original-Received: from localhost ([::1]:53489 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xkdhj-0002Gi-CE for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Nov 2014 14:47:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53948) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xkdhc-0002GQ-4l for bug-gnu-emacs@gnu.org; Sat, 01 Nov 2014 14:47:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XkdhW-0003mU-6w for bug-gnu-emacs@gnu.org; Sat, 01 Nov 2014 14:47:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47611) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkdhW-0003mK-3X for bug-gnu-emacs@gnu.org; Sat, 01 Nov 2014 14:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XkdhV-0000w2-NS for bug-gnu-emacs@gnu.org; Sat, 01 Nov 2014 14:47:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 01 Nov 2014 18:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18897 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18897-submit@debbugs.gnu.org id=B18897.14148676163582 (code B ref 18897); Sat, 01 Nov 2014 18:47:01 +0000 Original-Received: (at 18897) by debbugs.gnu.org; 1 Nov 2014 18:46:56 +0000 Original-Received: from localhost ([127.0.0.1]:44824 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XkdhP-0000vh-F2 for submit@debbugs.gnu.org; Sat, 01 Nov 2014 14:46:55 -0400 Original-Received: from mail-pa0-f53.google.com ([209.85.220.53]:57841) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XkdhN-0000vV-Sk for 18897@debbugs.gnu.org; Sat, 01 Nov 2014 14:46:54 -0400 Original-Received: by mail-pa0-f53.google.com with SMTP id kx10so9700420pab.40 for <18897@debbugs.gnu.org>; Sat, 01 Nov 2014 11:46:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=2qYSCITp9BCi7rDLdH0Xot6uRlirrhVhj5T3TAGiclc=; b=FWr4VEZAkjus3vUBoOb+a2qezT0I+Y5BU1624u2KUyhUbn7KpctHQBUgzIo82uvg1P oMDRHhbP2W6vthfHkZOzphbzOr6iFJEyYUgbfgb5mPDrWa0hwdENa7ip/EyGK1zYyzg4 0kkL3SiXCjE+pk/Wo/5WeYRqKg6JRQqJBb00sj3wF8RD2XD3A9mt75jSkrbZGBVvdGbF akCT1zVH+B3YCEBoZmuLKFzlxILgNdx1yPFzF7dnYFA/D7ZBonAZLOzbqSkQvYGzYLT0 X6XHSCECxBCKnFf/IUt7PESGeXtjuxhcb8QPGfqflGDKh4jLXAHYBtlPCV0L30mLb42k s/hw== X-Gm-Message-State: ALoCoQl7hZGEHVifJPx/H8ssGHXW1VD0nqA7dEqfyoeM/q8JcgC4uWcFRRLi3yi/o+uLrWSKfVkc X-Received: by 10.70.7.130 with SMTP id j2mr2628814pda.75.1414867607542; Sat, 01 Nov 2014 11:46:47 -0700 (PDT) Original-Received: from localhost ([2601:8:b280:6b4:226:82ff:fe96:715a]) by mx.google.com with ESMTPSA id zw1sm13045768pbb.82.2014.11.01.11.46.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 01 Nov 2014 11:46:46 -0700 (PDT) In-Reply-To: <83fve2yfyg.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 01 Nov 2014 19:43:19 +0200") User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:95357 --=-=-= Content-Type: text/plain Would you, please? --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Print-EIEIO-objects-correctly-when-edebugging.patch >From 4bde49372005e648031f0fe5de672d867ca4e5ea Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Thu, 30 Oct 2014 11:08:25 -0700 Subject: [PATCH] Print EIEIO objects correctly when edebugging * lisp/emacs-lisp/eieio.el (eieio-edebug-prin1-to-string): Adjust for use as advice. (edebug-setup-hook): Advise `edebug-prin1-to-string'. This will prevent objects containing large data structures from hammering Emacs during pretty-printing. eieio.el came with controls for printing EIEIO objects during edebugging sessions, but the controls weren't hooked up all the way. --- lisp/emacs-lisp/eieio.el | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el index d7c60dc..df2ce0f 100644 --- a/lisp/emacs-lisp/eieio.el +++ b/lisp/emacs-lisp/eieio.el @@ -853,17 +853,19 @@ of `eq'." ;;; 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 @@ Optional argument NOESCAPE is passed to `prin1-to-string' when appropriate." (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. -- 2.1.3 --=-=-=--