I often use ps-print-buffer to print out files, but I don't want the first few lines of the buffer to be printed. Here's the beginning of the buffer:

# -*- mode: org; -*-
# Last updated: <2017/12/12 18:37>

* First header

Say I want to cut everything up to the line * First header. I set

 (setq ps-begin-cut-regexp "^# -\\*- mode: org; -\\*-$")

and the first line does not appear on the printout. But how to set ps-end-cut-regexp? I tried

  (setq ps-end-cut-regexp "^\\* .*")
  (setq ps-end-cut-regexp "^# Last updated: <.*>$")

But neither works: the second line (# Last updated: <2017/12/12 18:37>) appears on the printout. What regex should I use to cut the first three lines?

  • Dunno, but did you try ^\* or ^$? – Drew Dec 12 '17 at 23:31
  • Yes, I have. They don't work either. – GrB Dec 14 '17 at 9:43

Your Answer

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

Browse other questions tagged or ask your own question.