GNU bug report logs - #25122
24.5; function describe-variable hangs on large variables

Previous Next

Package: emacs;

Reported by: Boruch Baum <boruch_baum <at> gmx.com>

Date: Tue, 6 Dec 2016 02:21:02 UTC

Severity: minor

Tags: fixed, patch

Merged with 13439, 21717

Found in versions 24.4.50, 24.5

Fixed in version 26.1

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
To: 25122 <at> debbugs.gnu.org
Subject: bug#25122: 24.5; function describe-variable hangs on large variables
Date: Tue, 06 Dec 2016 07:41:13 +0100
Boruch Baum <boruch_baum <at> 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))





This bug report was last modified 8 years and 27 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.