Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I write to standard output in Emacs

Tags:

emacs

messages

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)?

like image 977
false Avatar asked Mar 17 '14 13:03

false


People also ask

What is terminal 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.

How do I debug Emacs?

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.


1 Answers

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!

like image 179
Phil Lord Avatar answered Oct 06 '22 09:10

Phil Lord