[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#25122: 24.5; function describe-variable hangs on large variables
From: |
npostavs |
Subject: |
bug#25122: 24.5; function describe-variable hangs on large variables |
Date: |
Sun, 12 Mar 2017 12:32:48 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
> 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.
- bug#25122: 24.5; function describe-variable hangs on large variables, npostavs, 2017/03/11
- bug#25122: 24.5; function describe-variable hangs on large variables, Stefan Monnier, 2017/03/11
- bug#25122: 24.5; function describe-variable hangs on large variables, Thierry Volpiatto, 2017/03/11
- bug#25122: 24.5; function describe-variable hangs on large variables, npostavs, 2017/03/11
- bug#25122: 24.5; function describe-variable hangs on large variables, Drew Adams, 2017/03/11
- bug#25122: 24.5; function describe-variable hangs on large variables, Thierry Volpiatto, 2017/03/12
- bug#25122: 24.5; function describe-variable hangs on large variables, Stefan Monnier, 2017/03/12
- bug#25122: 24.5; function describe-variable hangs on large variables, npostavs, 2017/03/12
- bug#25122: 24.5; function describe-variable hangs on large variables, Drew Adams, 2017/03/12
- bug#25122: 24.5; function describe-variable hangs on large variables, Stefan Monnier, 2017/03/12
- bug#25122: 24.5; function describe-variable hangs on large variables,
npostavs <=
- bug#25122: 24.5; function describe-variable hangs on large variables, npostavs, 2017/03/13
- bug#25122: 24.5; function describe-variable hangs on large variables, npostavs, 2017/03/13
- bug#25122: 24.5; function describe-variable hangs on large variables, npostavs, 2017/03/15
bug#25122: 24.5; function describe-variable hangs on large variables, Thierry Volpiatto, 2017/03/11