[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

special lpr-buffer command

From: Tom Wurgler
Subject: special lpr-buffer command
Date: Tue, 27 Nov 2001 09:12:43 -0500 (EST)

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.

(defun my-lpr-buffer (arg)
  "Print ARG copies of just the region if it is active.
Print ARG copies of text bewteen point-min and point-max is it is not."
  (interactive "p")
  (let* ((sys_type (if (string-match "lpr" lpr-command) "-#" "-n"))
          (if (> arg 1)
              (cons (concat sys_type (int-to-string arg)) lpr-switches)
    (if mark-active
        (lpr-region (mark) (point))
      (lpr-region (point-min) (point-max)))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]