I'd like to print into the terminal that started emacs, instead of using Emacs message, whats the most convenient way to do this in emacs that uses the terminal?

(printf "some number %d some string %s" 1 "test")

This macro provides an equivilant to C's printf or Python's print:

(defmacro printf (fmt &rest args)
  `(princ (format ,fmt ,@args) #'external-debugging-output))

Or as a function:

(defun printf (&rest args)
  (princ (apply #'format args) #'external-debugging-output))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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