]> git.eshelyaron.com Git - emacs.git/commit
Speed up `describe-char` when a property has a large value
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 21 Mar 2024 16:28:54 +0000 (12:28 -0400)
committerEshel Yaron <me@eshelyaron.com>
Sun, 24 Mar 2024 14:17:37 +0000 (15:17 +0100)
commit3804a313dc5b88d34bdfa55a030cf9a0eb7f648e
treea8b16a3c4e2aed72811b3ff09b35e7d6262ab8f7
parentfceeffff737c44f69ab3461447d528110701edc7
Speed up `describe-char` when a property has a large value

Doing `C-u C-x =` on a buffer position where the overlay/text
properties hold large values (e.g. inside the profiler report)
can be surprisingly slow because it pretty prints all those properties.
Change the code to do the pretty printing more lazily.
While at it, share that duplicated code between `descr-text.el` and
`wid-browse.el`.

* lisp/emacs-lisp/pp.el (pp-insert-short-sexp): New function.

* lisp/descr-text.el (describe-text-sexp): Delete function.
(describe-property-list): Use `pp-insert-short-sexp` instead.

* lisp/wid-browse.el (widget-browse-sexp): Use `pp-insert-short-sexp`
and `widget--allow-insertion`.

(cherry picked from commit e819413e24d81875abaf81c281115e695ad5cc28)
lisp/descr-text.el
lisp/emacs-lisp/pp.el
lisp/wid-browse.el