From: Alan Mackenzie <acm@muc.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Eli Zaretskii <eliz@gnu.org>, 61847-done@debbugs.gnu.org
Subject: bug#61847: debug-early-backtrace only works some of the time.
Date: Fri, 3 Mar 2023 10:58:52 +0000 [thread overview]
Message-ID: <ZAHS7MPkVXxjJtmE@ACM> (raw)
In-Reply-To: <jwvedq8z902.fsf-monnier+emacs@gnu.org>
Hello, Stefan.
On Wed, Mar 01, 2023 at 12:34:04 -0500, Stefan Monnier wrote:
> > the way it prints (or rather used to print) a compiled function is/was
> > useful. You can see how many arguments it takes.
> Hmm...
> `prin1` will print for example #[256 ...] where 256 is where it tells
> "how many arguments it takes".
> In contrast, `cl-prin1` will print #f(compiled-function (&optional arg) ...)
> So in both cases "you can see how many arguments it takes" (and I'll
> let you guess which one I find more readable).
I find them both equally readable, having practised reading dumped
functions. But I accept most people won't.
> FWIW, I just tried the `condition-case` wrapper and it fixes the problem
> for the test case you showed. So I just pushed my patch to
> `emacs-29` (which additionally checks for the presence of
> `cl-defmethod`, which also fixes the problem: one is never too sure).
One is never too sure, which was one of the points of the original
design.
> I'll let you (plural) decide whether to keep using `cl-prin1` or not,
> but now this is not directly related to fixing this bug any more.
You could have reminded me of the variable cl-print-compiled, which at
least allows you to dump the constant vector.
I propose extending this variable thusly:
diff --git a/lisp/emacs-lisp/cl-print.el b/lisp/emacs-lisp/cl-print.el
index 61586526ca1..74dad303a27 100644
--- a/lisp/emacs-lisp/cl-print.el
+++ b/lisp/emacs-lisp/cl-print.el
@@ -165,6 +165,7 @@ 'help-byte-code
(defvar cl-print-compiled nil
"Control how to print byte-compiled functions.
Acceptable values include:
+- `full' to print out the full contents of the function using `prin1'.
- `static' to print the vector of constants.
- `disassemble' to print the disassembly of the code.
- nil to skip printing any details about the code.")
> Stefan
--
Alan Mackenzie (Nuremberg, Germany).
next prev parent reply other threads:[~2023-03-03 10:58 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-27 17:11 bug#61847: debug-early-backtrace only works some of the time Alan Mackenzie
2023-02-27 19:15 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-28 9:12 ` Alan Mackenzie
2023-02-28 12:16 ` Eli Zaretskii
2023-02-28 13:16 ` Alan Mackenzie
2023-02-28 14:22 ` Eli Zaretskii
2023-02-28 14:45 ` Alan Mackenzie
2023-02-28 17:36 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-28 19:52 ` Alan Mackenzie
2023-02-28 19:58 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-01 12:16 ` Eli Zaretskii
2023-03-01 15:22 ` Alan Mackenzie
2023-03-01 16:01 ` Eli Zaretskii
2023-03-01 16:46 ` Alan Mackenzie
2023-03-01 17:04 ` Eli Zaretskii
2023-03-01 17:31 ` Alan Mackenzie
2023-03-01 18:22 ` Eli Zaretskii
2023-03-01 17:34 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-03 10:58 ` Alan Mackenzie [this message]
2023-03-01 13:32 ` Eli Zaretskii
2023-03-01 16:05 ` Alan Mackenzie
2023-03-01 16:53 ` Eli Zaretskii
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZAHS7MPkVXxjJtmE@ACM \
--to=acm@muc.de \
--cc=61847-done@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.