I am trying to debug an Emacs program performance wise. In particular, I suffer an extremely long startup time (~5' compared to ~1' for a bare Emacs) on a remote connection via WLAN, cellphone etc. In this context, any message
written is no help, for the display is not refreshed at all.
What I would like to do is to write onto the "standard output" of the Linux process. I am aware of the --batch
mode but this is no help to me because I want to use Emacs interactively.
So how can I write messages out to the Linux-standard output (as opposed to the Emacs standard output)?
The terminal output functions send output to a text terminal, or keep track of output sent to the terminal. The variable baud-rate tells you what Emacs thinks is the output speed of the terminal. User Option: baud-rate. This variable's value is the output speed of the terminal, as far as Emacs knows.
You can enter the debugger when you call the function by calling debug-on-entry . Now, type d again, eight times, slowly. Each time you type d , Emacs will evaluate another expression in the function definition. By typing d , you were able to step through the function.
You can output to standard error like this:
(print "hello world" #'external-debugging-output)
or
(princ "hello world" #'external-debugging-output)
This can buffer, so be careful.It's not possible to output to standard out at the moment. I'm going to add that, I think!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With