From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#25122: 24.5; function describe-variable hangs on large variables Date: Sun, 12 Mar 2017 12:32:48 -0400 Message-ID: <87r32278wf.fsf@users.sourceforge.net> References: <20161206022112.GF25778@E15-2016.optimum.net> <87twahk19y.fsf@gmail.com> <87d1h4fld5.fsf@users.sourceforge.net> <871sxkyv2m.fsf@gmail.com> <87mvcs8j7w.fsf@users.sourceforge.net> <87lgsbtxwe.fsf@gmail.com> <871su38ogm.fsf@users.sourceforge.net> <87d1dnrq96.fsf@gmail.com> <87wpbu7f9i.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1489336330 29304 195.159.176.226 (12 Mar 2017 16:32:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 12 Mar 2017 16:32:10 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: 25122@debbugs.gnu.org, Stefan Monnier , Boruch Baum To: Thierry Volpiatto Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Mar 12 17:32:06 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cn6Pd-0007At-C6 for geb-bug-gnu-emacs@m.gmane.org; Sun, 12 Mar 2017 17:32:05 +0100 Original-Received: from localhost ([::1]:47607 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cn6Pj-00039V-Ie for geb-bug-gnu-emacs@m.gmane.org; Sun, 12 Mar 2017 12:32:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33893) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cn6Pd-00039D-27 for bug-gnu-emacs@gnu.org; Sun, 12 Mar 2017 12:32:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cn6PZ-0003cv-TZ for bug-gnu-emacs@gnu.org; Sun, 12 Mar 2017 12:32:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54604) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cn6PZ-0003cr-Pg for bug-gnu-emacs@gnu.org; Sun, 12 Mar 2017 12:32:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cn6PZ-0007k8-Jl for bug-gnu-emacs@gnu.org; Sun, 12 Mar 2017 12:32:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Mar 2017 16:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25122 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25122-submit@debbugs.gnu.org id=B25122.148933629829733 (code B ref 25122); Sun, 12 Mar 2017 16:32:01 +0000 Original-Received: (at 25122) by debbugs.gnu.org; 12 Mar 2017 16:31:38 +0000 Original-Received: from localhost ([127.0.0.1]:52803 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cn6PC-0007jV-1K for submit@debbugs.gnu.org; Sun, 12 Mar 2017 12:31:38 -0400 Original-Received: from mail-io0-f193.google.com ([209.85.223.193]:36576) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cn6PA-0007jI-Cc for 25122@debbugs.gnu.org; Sun, 12 Mar 2017 12:31:36 -0400 Original-Received: by mail-io0-f193.google.com with SMTP id 68so11299212ioh.3 for <25122@debbugs.gnu.org>; Sun, 12 Mar 2017 09:31:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=jxkQqfgW2s1qkVZf7U+Oye4rnuvtA5i7B1vTTOx/ok8=; b=a9m23JAbtt0CpfjFjNi7ZqgCF9jvyx94IypkhBhETTJupwZgqc/0p7k5b8Aa/l4tt4 m2kiO6pR6pouJSXdiVGbtwbGCjAsoryGq7hlWWfpfBKoYeCsl9TARg3aA7oLKIAnCmCB PDkBYAi58yxLgNBPEeaVqQQy1McOEriR/EqSO1yrVUaHkOmqE2aSWqXGM/hhOjYaSVd0 tGMaLObThePxkOVr0QPO4Bkts10kMJ+6An8XRofpImnIQSew3f43wwiHNiSCheOWtdzC wju+fcJBA8A7LOHXulNzi2unLj9WPezpFC6LgEfxnTIBV5uIGrqBaa08q5aupKWDGMQ7 xrCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=jxkQqfgW2s1qkVZf7U+Oye4rnuvtA5i7B1vTTOx/ok8=; b=Gi627ZvstZXAiEpbip0u5N6NfaaY1YifOKlGqwJyuQTmq6AlgDy2A6kSeE+xht9qLp fg/CkNKdHjjUBrGNUjYG8n5zJs08SWdIBaSThW7f+mm5lqgIPvE4hEVShVFsfNVNbeOr cmmwwlhNP+53LgQyuRcx8iLU3cqUEP7phegNRFi7PpCjSuuJU9PkIIoSSXc3/Q/If6Vh nfIe9S2pmc90Mdt/BbjR9VImpaYvri+1ZUBDWmGqUfZeMIbBuf0TornWvJWT/hiwPJk2 +itxaeDpWYCCLFEpbk/sq+T4mvcHQ9USywnsymwW7ukQP32uVGJbk9SpixD6m1nil+Ts JBFA== X-Gm-Message-State: AMke39nyG/cNZy7aDe+99aZhB4JgZa8OPVgAzGFMlF8UAB3h/e+G28G11/mqYL28Gev0qg== X-Received: by 10.107.28.73 with SMTP id c70mr26008440ioc.198.1489336290773; Sun, 12 Mar 2017 09:31:30 -0700 (PDT) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id e20sm2727664itc.3.2017.03.12.09.31.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Mar 2017 09:31:30 -0700 (PDT) In-Reply-To: <87wpbu7f9i.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Sun, 12 Mar 2017 10:15:21 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:130522 Archived-At: > We could probably achieve something similar without breaking circular > printing by not calling indent-sexp on the full list The following patch is almost as fast as the mapc 'pp trick, but doesn't get stuck on circular lists. The indentation is a bit off: sublists after the first one incorrectly start in column 0. Also, this doesn't really solve the performance problem, it just makes it much less likely to occur, e.g., (pp (list load-history)) is still slow. --- i/lisp/emacs-lisp/pp.el +++ w/lisp/emacs-lisp/pp.el @@ -76,9 +76,15 @@ pp-buffer (progn (skip-chars-forward " \t\n") (point))) (insert ?\n)) (t (goto-char (point-max))))) (goto-char (point-min)) - (indent-sexp)) + (condition-case () (down-list) + (scan-error nil)) + (while (and (not (eobp)) + (condition-case () (progn (indent-sexp) + (forward-sexp) + t) + (scan-error nil))))) ;;;###autoload (defun pp (object &optional stream) "Output the pretty-printed representation of OBJECT, any Lisp object.