• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/

Lines Matching +defs:lpr +defs:region

0 ;;; lpr.el --- print Emacs buffer on line printer
28 ;; Commands to send the region or a buffer to your printer. Entry points
29 ;; are `lpr-buffer', `print-buffer', `lpr-region', or `print-region'; option
30 ;; variables include `printer-name', `lpr-switches' and `lpr-command'.
35 (defvar lpr-windows-system
39 (defvar lpr-lp-system
43 (defgroup lpr nil
50 (and lpr-windows-system "PRN")
55 lpr's -P option; otherwise the value should be nil.
58 a printer device or port, provided `lpr-command' is set to \"\".
69 :group 'lpr)
72 (defcustom lpr-switches nil
76 See `lpr-command'."
78 :group 'lpr)
80 (defcustom lpr-add-switches (memq system-type '(berkeley-unix gnu/linux))
82 These are made assuming that the program is `lpr';
86 :group 'lpr)
88 (defcustom lpr-printer-switch
89 (if lpr-lp-system
98 :group 'lpr)
101 (defcustom lpr-command
103 (lpr-windows-system
105 (lpr-lp-system
108 "lpr"))
116 treated like `lpr' except that an explicit filename is given as the last
119 :group 'lpr)
122 ;; which is more reliable than pr with no args, which is what lpr -p does.
123 (defcustom lpr-headers-switches nil
125 If nil, we run `lpr-page-header-program' to make page headings
128 :group 'lpr)
130 (defcustom print-region-function nil
131 "Function to call to print the region on a printer.
132 See definition of `print-region-1' for calling conventions."
134 :group 'lpr)
136 (defcustom lpr-page-header-program "pr"
139 :group 'lpr)
143 (defcustom lpr-page-header-switches '("-h %s" "-F")
146 The variable `lpr-page-header-program' specifies the program to use."
148 :group 'lpr)
151 (defun lpr-buffer ()
153 See the variables `lpr-switches' and `lpr-command'
156 (print-region-1 (point-min) (point-max) lpr-switches nil))
162 The variable `lpr-headers-switches' controls how to paginate.
164 `lpr-page-header-program' specifies) to paginate.
165 `lpr-page-header-switches' specifies the switches for that program.
167 Otherwise, the switches in `lpr-headers-switches' are used
170 See the variables `lpr-switches' and `lpr-command'
173 (print-region-1 (point-min) (point-max) lpr-switches t))
176 (defun lpr-region (start end)
177 "Print region contents without pagination or page headers.
178 See the variables `lpr-switches' and `lpr-command'
181 (print-region-1 start end lpr-switches nil))
184 (defun print-region (start end)
185 "Paginate and print the region contents.
187 The variable `lpr-headers-switches' controls how to paginate.
189 `lpr-page-header-program' specifies) to paginate.
190 `lpr-page-header-switches' specifies the switches for that program.
192 Otherwise, the switches in `lpr-headers-switches' are used
195 See the variables `lpr-switches' and `lpr-command'
198 (print-region-1 start end lpr-switches t))
200 (defun print-region-1 (start end switches page-headers)
216 (and page-headers lpr-headers-switches
217 ;; It's possible to use an lpr option to get page headers.
218 (setq switches (append (if (stringp lpr-headers-switches)
219 (list lpr-headers-switches)
220 lpr-headers-switches)
222 (setq nswitches (lpr-flatten-list
223 (mapcar 'lpr-eval-switch ; Dynamic evaluation
231 (let ((new-coords (print-region-new-buffer start end)))
240 (if lpr-headers-switches
244 (let ((new-coords (print-region-new-buffer start end)))
245 (apply 'call-process-region (car new-coords) (cdr new-coords)
246 lpr-page-header-program t t nil
248 lpr-page-header-switches)))
251 (apply (or print-region-function 'call-process-region)
252 (nconc (list start end lpr-command
254 (and lpr-add-switches
257 (and lpr-add-switches lpr-headers-switches
260 (list (concat lpr-printer-switch
272 (defun print-region-new-buffer (ostart oend)
282 (defun printify-region (begin end)
283 "Replace nonprinting characters in region with printable representations.
289 (narrow-to-region begin end)
303 (defun lpr-eval-switch (arg)
310 ;; `lpr-flatten-list' is defined here (copied from "message.el" and
314 ;; (lpr-flatten-list '((a . b) c (d . e) (f g h) i . j))
317 (defun lpr-flatten-list (&rest list)
318 (lpr-flatten-list-1 list))
320 (defun lpr-flatten-list-1 (list)
324 (append (lpr-flatten-list-1 (car list))
325 (lpr-flatten-list-1 (cdr list))))
328 (provide 'lpr)
331 ;;; lpr.el ends here