Is there a function for logging to Messages buffer without displaying in the echo-area? Or maybe another build in log mechanism?

I'm after a kind of console.log("string") kind of functionality.

  • Here is a link that demonstrates how I do it: emacs.stackexchange.com/a/6003/2287 Essentially, the function (messages-buffer) is used to obtain the buffer or create one with the proper mode if it doesn't exist. The function -- using (inhibit-read-only t) -- goes to the bottom of the buffer and tests to see if it is at a new line, if not then create a new line, then insert the contents of the message (what ever it is), then test again to see if it is a new line, if not at new line then insert one. This method keeps the echo area available for stuff like interactive prompts.
    – lawlist
    Commented Jun 1, 2015 at 14:12

2 Answers 2


With emacs-snapshot, you can let-bind inhibit-message to t:

Non-nil means calls to `message' are not displayed. They are still logged to the Messages buffer.


One way to do it is to call (message "") immediately after. This will, however, wipe out any existing content in the echo area.

(message "foo")
(message "")

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.