bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#36566: 27.0.50; debug is sometimes horribly slow


From: Stefan Monnier
Subject: bug#36566: 27.0.50; debug is sometimes horribly slow
Date: Sat, 14 May 2022 12:05:42 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

> The only issue is "oh no, not yet another printing variable" (that
> people will be setting to 14 in ~/.emacs and then everything that does
> `prin1' to write out data will fail).

As someone requested long ago, we should have some way to "reset" the
printing config context in a single step without having to mention
individually each and every var.

But maybe for this specific issue we could make it so
`print-char-length` is only obeyed by `cl-print` (and only when
`cl-print-readably` is nil) and not `prin1` (which is the function that
prints in a machine-readable way and should hence arguably never
truncate).

> I did suggest (in conjunction with another bug report in this area) that
> we should just extend `prin1{,-to-string}' with a parameter that would
> set (on the C level) an equivalent variable.  So we'd have
> (prin1 object fun `((char-length . ,edebug-print-char-length)))
> etc.  (And `t' would be "all defaults".)

Some kind of "print context" object would be good, indeed.
Being able to set/modify this context "at a distance" via dynamic
scoping is quite handy, tho, so we probably want to still support that
as well.

Here's an idea: a print context could include an `inherit` setting which
says whether to "keep looking for more settings from the context".
Then we printing we use settings from:
- the explicit context passed as arg (if present).
- the currently existing `print-<foo>` vars (if there isn't an explicit
  context arg whose `inherit` says not to do that).
We could even go crazy and add an intermediate step to check
a `print-context` var which contains such an object.


        Stefan






reply via email to

[Prev in Thread] Current Thread [Next in Thread]