I have done an emacs config with literate programming and I have been searching for while now. I need a simple tool with which I can just pretty print my code in my org file.

  • Pretty print to what/where? Only the code or also the text? Commented Jan 2 at 0:46
  • What do you mean by "pretty print"? That normally refers to formatting code which is currently unformatted. Surely your init file code is already "pretty" wrt formatting, so I can't tell what you're asking.
    – phils
    Commented Jan 2 at 1:23
  • @dalanicolai I want to format the code, which is in an org file.
    – David
    Commented Jan 2 at 10:20
  • 1
    The best way to format the code, is by formatting it while writing it. You can do this by opening the code block in a 'special edit buffer'. With the cursor on the code block, press C-c C-' to open it in the special edit buffer, press it again to update and jump back to the src-block. This answer gives a few more tricks. Of course, it should not be too difficult to fully automate this if you know some lisp, but I am not aware of an existing solution yet. Commented Jan 2 at 10:35
  • So it sounds like you want to take your Org config file as input and spit out just a lisp file with just the code as output? Or are you looking to turn it into something like HTML with code blocks that you can publish somewhere? Or what?
    – mtraceur
    Commented Jan 2 at 22:37


Your Answer

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

Browse other questions tagged or ask your own question.