[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: special lpr-buffer command
From: |
Vinicius Jose Latorre |
Subject: |
Re: special lpr-buffer command |
Date: |
Wed, 28 Nov 2001 11:43:55 -0200 |
> Here some code I find useful, hope others do. I have this bound to my "print
> screen" button. If the region is active, just print that region. If it is
> not active, print the whole buffer.
Here is the code a little optimized:
(defun my-lpr-buffer (arg)
"Print ARG copies of the region if mark is active and transient mark is on.
Otherwise, Print ARG copies of text bewteen point-min and point-max."
(interactive "p")
(let ((lpr-switches
(if (and (integerp arg) (> arg 1))
(cons (concat (if (string-match "lpr" lpr-command) "-#" "-n")
(int-to-string arg))
lpr-switches)
lpr-switches)))
(if (and transient-mark-mode mark-active)
(lpr-region (mark) (point))
(lpr-region (point-min) (point-max)))))