1

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")
1
  • Note that this will not be possible on Windows or macOS as the app does not start from a terminal and so has no stdout etc
    – mmmmmm
    Jun 10 at 8:54
1

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.