8

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
  • 3
    org-babel-mark-block ?
    – bertfred
    Sep 9, 2017 at 14:24
  • @bertfred can you post an answer?
    – user12563
    Jul 29, 2019 at 4:21

2 Answers 2

7

Unlike org-mark-element, the function org-babel-mark-block only selects the contents of a block.

5

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

2
  • Unfortunately this selects also the headers of the block (#BEGIN_SRC, #END_SRC)
    – dmg
    Sep 10, 2017 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. Mar 26, 2018 at 20:38

Your Answer

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

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