summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp/lisp-mnt-tests.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2024-03-23 19:21:26 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2024-03-23 19:21:26 -0400
commitef859d8b1b285fd22b083955a0e878a74d72ff41 (patch)
tree400c7f99cc5c00001c50ad33d0dfc39cea01f267 /test/lisp/emacs-lisp/lisp-mnt-tests.el
parenta46789b56af05e4cd31ab90495c9f2a4492a9b19 (diff)
downloademacs-ef859d8b1b285fd22b083955a0e878a74d72ff41.tar.gz
emacs-ef859d8b1b285fd22b083955a0e878a74d72ff41.tar.bz2
emacs-ef859d8b1b285fd22b083955a0e878a74d72ff41.zip
edebug.el: Better strip instrumentation from backtraces
Rework the code that "cleans" the backtrace for `edebug-pop-to-backtrace`. The main changes are the following: - Strip instrumentation from "everywhere" rather than trying to limit the effect to "code" and leave "data" untouched. This is a worthy goal, but it is quite difficult to do since code contains data (so we ended up touching data anyway) and data can also contain code. The risk of accidentally removing something because it happens to look like instrumentation is very low, whereas it was very common for instrumentation to remain in the backtrace. - Use a global hash-table to remember the work done, instead of using separate hash-table for each element. By using a weak hash-table we avoid the risk of leaks, and save a lot of work since there's often a lot of subexpressions that appear several times in the backtrace. * lisp/emacs-lisp/edebug.el (edebug-make-enter-wrapper): Tweak code layout so the comments are more clear. (edebug-unwrap): Remove redundant patterns for `closure` and `lambda`. Add `:closure-dont-trim-context` to the `edebug-enter` pattern, so it also gets removed (this should have been done in commit 750bc57cbb8d). (edebug--unwrap-cache): New var. (edebug-unwrap*): Use it. (edebug--unwrap1): Delete function. Merged into `edebug-unwrap*`. Also apply unwrapping to the contents of byte-code functions since they can refer to lambda expressions captured by the closure. (edebug--symbol-prefixed-p): Rename from `edebug--symbol-not-prefixed-p` and adjust meaning accordingly. (edebug--strip-instrumentation): Adjust accordingly and simplify a bit by unifying the "lambda" case and the "everything else" case. (edebug--unwrap-frame): Use `cl-callf` and unwrap arguments even if they've already been evaluated.
Diffstat (limited to 'test/lisp/emacs-lisp/lisp-mnt-tests.el')
0 files changed, 0 insertions, 0 deletions