From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: 25122@debbugs.gnu.org
Subject: bug#25122: 24.5; function describe-variable hangs on large variables
Date: Tue, 06 Dec 2016 07:41:13 +0100 [thread overview]
Message-ID: <87twahk19y.fsf@gmail.com> (raw)
In-Reply-To: <20161206022112.GF25778@E15-2016.optimum.net>
Boruch Baum <boruch_baum@gmx.com> writes:
> Subject: 24.5; function describe-variable hangs on large variables
>
> 1) When evaluating function describe-variable for variable
> package-archive-conteqnts, emacs hangs for minutes before I gave up.
I have already reported this bug.
I use this to workaround it:
(progn
;; Speedup `describe-variable' for variables with huge value description.
(defun tv/describe-variable (old-fn &rest args)
;; `cl-flet' can't be used here because `pp' should
;; appear lexically in its body, which is not the case.
;; Using `flet' is an option, but even better is binding
;; (symbol-function 'pp) with `cl-letf'.
(cl-letf (((symbol-function 'pp)
(lambda (object &optional stream)
(let ((fn (lambda (ob &optional stream)
(princ (pp-to-string ob)
(or stream standard-output))
(terpri)))
(print-circle t))
(if (consp object)
(progn
(insert "\n(")
(mapc fn object)
(cl-letf (((point) (1- (point))))
(insert ")")))
(funcall fn object stream))))))
(apply old-fn args)))
(advice-add 'describe-variable :around #'tv/describe-variable))
next prev parent reply other threads:[~2016-12-06 6:41 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-06 2:21 bug#25122: 24.5; function describe-variable hangs on large variables Boruch Baum
2016-12-06 6:41 ` Thierry Volpiatto [this message]
2016-12-07 3:50 ` npostavs
2016-12-07 8:58 ` Thierry Volpiatto
2017-03-11 5:40 ` npostavs
2017-03-11 15:33 ` Stefan Monnier
2017-03-11 19:29 ` Thierry Volpiatto
2017-03-11 21:59 ` npostavs
2017-03-11 23:55 ` Drew Adams
2017-03-12 5:57 ` Thierry Volpiatto
2017-03-12 14:07 ` Stefan Monnier
2017-03-12 14:15 ` npostavs
2017-03-12 14:59 ` Drew Adams
2017-03-12 16:29 ` Stefan Monnier
2017-03-12 16:32 ` npostavs
2017-03-13 4:47 ` npostavs
2017-03-13 14:01 ` npostavs
2017-03-16 2:54 ` npostavs
2017-04-18 3:53 ` npostavs
2017-04-22 18:25 ` npostavs
2017-04-26 3:57 ` Michael Heerdegen
2017-04-26 10:35 ` Michael Heerdegen
2017-03-11 19:34 ` Thierry Volpiatto
2017-03-12 16:07 ` npostavs
2017-03-11 15:21 ` Stefan Monnier
2017-03-11 15:35 ` npostavs
2017-03-11 19:26 ` Thierry Volpiatto
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87twahk19y.fsf@gmail.com \
--to=thierry.volpiatto@gmail.com \
--cc=25122@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).