This is BrainLog, a blog by Dan Sanderson. Older entries, from October 1999 through September 2010, are preserved for posterity, but are no longer maintained. See the front page and newer entries.

March 17, 2008

Newbie Emacs tip: In Emacs Lisp, to print a message to the *Messages* buffer, use the message function:

(message "hello")

To print an arbitrary value of a variable to the current buffer as the text of an elisp expression, such as for debugging, use the pp function:

(pp some-var)