I would like to use NSTRACE to see its built-in messages, and create new ones, at various locations within nsterm.m. I imagine/guess that enabling NSTRACE needs to be done when configuring Emacs and it probably requires launching Emacs from the terminal and perhaps an interactive call such as M-x trace-...

Q:  How can I configure Emacs to enable NSTRACE and what other steps are needed to see the messages inside the terminal window?

For example, here is what I would use if I wanted to see the glyph debugging message inside xdisp.c:   I would use --enable-checking='glyphs' when configuring Emacs; then I would launch Emacs from the command line in a terminal; then I would type M-x trace-redisplay and I could see glyph debugging messages inside the terminal that are created inside xdisp.c like this:

  debug_method_add (w, "This is my custom message.");

1 Answer 1


Look at src/nsterm.h (http://git.savannah.gnu.org/cgit/emacs.git/tree/src/nsterm.h?id=3f938e1#n41):

/* ==========================================================================

   Trace support

   ========================================================================== */

/* Uncomment the following line to enable trace.

   Uncomment suitable NSTRACE_GROUP_xxx lines to trace more.

   Hint: keep the trailing whitespace -- the version control system
   will reject accidental commits. */

/* #define NSTRACE_ENABLED 1          */

And IMO, questions about development are best asked on emacs-devel.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.