3

I would like to write a function that pretty-prints the current source code block into a PDF. I know I can use ps-print-region-with-faces, but it would require that I first select the source code block.

Is there a function in org to do this selection?

thank you in advance

Edit:

the answer is org-babel-mark-block (answered by bertfred in a comment)

org-mark-element selects the block but also selects the BEGIN_ END_ markers.

  • 2
    org-babel-mark-block ? – bertfred Sep 9 '17 at 14:24
4

org-mark-element should be able to do the right thing. It's bound to M-h by default.

  • Unfortunately this selects also the headers of the block (#BEGIN_SRC, #END_SRC) – dmg Sep 10 '17 at 3:49
  • 1
    Yeah, org-babel-mark-block (from a comment above) selects only the contents, which is also what I came here looking for. – Paul Bissex Mar 26 '18 at 20:38

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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