annotate lisp/printer.el @ 776:79940b592197

[xemacs-hg @ 2002-03-15 07:43:14 by ben] .cvsignore: ignore .tmp files that are getting auto-created by VC. Makefile.in.in: Use -no-packages to avoid problems with package files shadowing core files (e.g. unicode.el in mule-ucs). alloc.c, emacs.c, lisp.h: add new -no-packages. make sure list of args for sorting is actually correct. clean up arg parsing code. xemacs.mak: Use -no-packages to avoid problems with package files shadowing core files (e.g. unicode.el in mule-ucs). Makefile: Use -no-packages to avoid problems with package files shadowing core files (e.g. unicode.el in mule-ucs). mule\chinese.el, mule\japan-util.el: fix warnings. behavior-defs.el: fix errors with require. bytecomp-runtime.el: add new funs {when,and}-{f}boundp, clean up docs. cus-edit.el: pretty-print values. dump-paths.el, find-paths.el, startup.el, setup-paths.el: fix problems/inconsistencies parsing options. support new -no-packages option. merge code duplication in dump-paths and startup. lisp-mode.el: indent macrolet and labels correctly. update comments about lisp-indent-function. flet already handled in cl. apropos.el, auto-save.el, buff-menu.el, cl-extra.el, dragdrop.el, faces.el, files.el, fill.el, font-lock.el, font.el, gtk-faces.el, gui.el, help.el, hyper-apropos.el, info.el, isearch-mode.el, keymap.el, lisp-mnt.el, mouse.el, package-admin.el, package-get.el, printer.el, process.el, resize-minibuffer.el, simple.el, toolbar-items.el, wid-edit.el, win32-native.el: fix warnings. very-early-lisp.el: update docs. mule\chinese.el, mule\japan-util.el: fix warnings. mule\chinese.el, mule\japan-util.el: fix warnings. behavior-defs.el: fix errors with require. bytecomp-runtime.el: add new funs {when,and}-{f}boundp, clean up docs. cus-edit.el: pretty-print values. dump-paths.el, find-paths.el, startup.el, setup-paths.el: fix problems/inconsistencies parsing options. support new -no-packages option. merge code duplication in dump-paths and startup. lisp-mode.el: indent macrolet and labels correctly. update comments about lisp-indent-function. flet already handled in cl. apropos.el, auto-save.el, buff-menu.el, cl-extra.el, dragdrop.el, faces.el, files.el, fill.el, font-lock.el, font.el, gtk-faces.el, gui.el, help.el, hyper-apropos.el, info.el, isearch-mode.el, keymap.el, lisp-mnt.el, mouse.el, package-admin.el, package-get.el, printer.el, process.el, resize-minibuffer.el, simple.el, toolbar-items.el, wid-edit.el, win32-native.el: fix warnings. very-early-lisp.el: update docs. mule\chinese.el, mule\japan-util.el: fix warnings. Makefile.in.in: Use -no-packages to avoid problems with package files shadowing core files (e.g. unicode.el in mule-ucs). Makefile.in.in: Use -no-packages to avoid problems with package files shadowing core files (e.g. unicode.el in mule-ucs).
author ben
date Fri, 15 Mar 2002 07:43:43 +0000
parents 68d3b87a6754
children 2923009caf47
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
1 ;;; printer.el --- support for hard-copy printing in XEmacs
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
2
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
3 ;; Copyright (C) 2000 Ben Wing.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
4 ;; Copyright (C) 2000 Kirill Katsnelson.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
5
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
6 ;; Maintainer: XEmacs Development Team
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
7 ;; Keywords: printer, printing, internal, dumped
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
8
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
9 ;; This file is part of XEmacs.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
10
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
11 ;; XEmacs is free software; you can redistribute it and/or modify it
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
12 ;; under the terms of the GNU General Public License as published by
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
14 ;; any later version.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
15
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
16 ;; XEmacs is distributed in the hope that it will be useful, but
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
19 ;; General Public License for more details.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
20
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
22 ;; along with XEmacs; see the file COPYING. If not, write to the Free
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
23 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
24 ;; 02111-1307, USA.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
25
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
26 ;;; Synched up with: Not in FSF.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
27
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
28 ;;; Authorship:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
29
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
30 ;; Created 2000 by Ben Wing, to provide the high-level interface onto the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
31 ;; print support implemented by Kirill Katsnelson.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
32
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
33 ;;; Commentary:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
34
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
35 ;; This file is dumped with XEmacs.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
36
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
37
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
38 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
39 ;; generic printing code ;;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
40 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
41
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
42 ;; #### should be named print-buffer, but that's currently in
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
43 ;; lpr-buffer with some horrible definition: print-buffer == "print with
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
44 ;; headings", lpr-buffer == "print without headings", and the headings are
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
45 ;; generated by calling the external program "pr"! This is major stone-age
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
46 ;; here!
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
47 ;;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
48 ;; I propose junking that package entirely and creating a unified,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
49 ;; modern API here that will work well with modern GUI's on top of it,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
50 ;; and with various different actual implementations (e.g. lpr or the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
51 ;; pretty-print package on Unix, built-in msprinter support on
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
52 ;; Windows), where the workings of a particular implementation is
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
53 ;; hidden from the user and there is a consistent set of options to
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
54 ;; control how to print, which works across all implementations.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
55 ;;
506
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
56 ;; The code here currently only really supports Windows.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
57
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
58 (defgroup printing nil
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
59 "Generic printing support."
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
60 :group 'wp)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
61
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
62 (defcustom printer-name nil
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
63 "*Name of printer to print to.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
64 If nil, use default.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
65 Under Windows, use `mswindows-printer-list' to get names of installed
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
66 printers."
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
67 :type 'string
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
68 :group 'printing)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
69
491
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
70 (defstruct Print-context pageno window start-time printer-name)
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
71
506
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
72 (defvar printer-current-device nil)
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
73
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
74 (defun Printer-get-device ()
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
75 (or printer-current-device (setq printer-current-device
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
76 (make-device 'msprinter printer-name))))
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
77
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
78 (defun Printer-clear-device ()
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
79 (setq printer-current-device nil))
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
80
491
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
81 (defcustom printer-page-header '((face bold date) nil (face bold buffer-name))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
82 "*Controls printed page header.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
83
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
84 This can be:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
85 - nil. Header is not printed.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
86 - An fbound symbol or lambda expression. The function is called with
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
87 one parameter, a print-context object, every time the headers need
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
88 to be set up. It can use the function `print-context-property' to
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
89 query the properties of this object. The return value is treated as
491
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
90 if it was literally specified: i.e. it will be reprocessed.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
91 - A list of up to three elements, for left, center and right portions
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
92 of the header. Each of these can be
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
93 - nil, not to print the portion
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
94 - A string, which will be printed literally.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
95 - A predefined symbol, on of the following:
491
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
96 printer-name Name of printer being printed to
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
97 short-file-name File name only, no path
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
98 long-file-name File name with its path
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
99 buffer-name Buffer name
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
100 date Date current when printing started
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
101 time Time current when printing started
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
102 page Current printout page number, 1-based
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
103 user-id User logon id
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
104 user-name User full name
491
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
105 - A list of three elements: (face FACE-NAME EXPR). EXPR is any of the
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
106 items given here. The item will be displayed in the given face.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
107 - A cons of an extent and any of the items given here. The item will
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
108 be displayed using the extent's face, begin-glyph and end-glyph
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
109 properties.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
110 - A list, each element of which is any of the items given here.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
111 Each element of the list is rendered in sequence. For example,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
112 '(\"Page \" page) is rendered as \"Page 5\" on the fifth page.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
113 - An fbound symbol or lambda expression, called with one parameter,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
114 a print-context object, as above. The return value is treated as
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
115 if it was literally specified: i.e. it will be reprocessed."
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
116 :type 'sexp
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
117 :group 'printing)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
118
491
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
119 (defcustom printer-page-footer '(nil (face bold ("Page " page)))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
120 "*Controls printed page footer.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
121
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
122 Format is the same as `printer-page-header'."
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
123 :type 'sexp
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
124 :group 'printing)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
125
491
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
126 (defun generate-header-element (element context)
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
127 (cond ((null element) nil)
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
128 ((stringp element) (insert element))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
129 ((memq element '(printer-name
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
130 short-file-name long-file-name buffer-name
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
131 date time page user-id user-name))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
132 (insert (print-context-property context element)))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
133 ((and (consp element) (eq 'face (car element)))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
134 (let ((p (point)))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
135 (generate-header-element (third element) context)
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
136 (let ((x (make-extent p (point))))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
137 (set-extent-face x (second element)))))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
138 ((and (consp element) (extentp (car element)))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
139 (let ((p (point)))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
140 (generate-header-element (cdr element) context)
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
141 (let ((x (make-extent p (point))))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
142 (set-extent-face x (extent-face (car element)))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
143 (set-extent-begin-glyph x (extent-begin-glyph (car element)))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
144 (set-extent-end-glyph x (extent-end-glyph (car element))))))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
145 ((listp element)
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
146 (mapcar #'(lambda (el) (generate-header-element el context))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
147 element))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
148 ((functionp element)
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
149 (generate-header-element (funcall element context) context))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
150 (t (error 'invalid-argument "Unknown header element" element))))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
151
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
152 (defun generate-header-line (spec context)
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
153 (let* ((left (first spec))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
154 (middle (second spec))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
155 (right (third spec))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
156 (left-start (point))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
157 (middle-start (progn (generate-header-element left context)
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
158 (point)))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
159 (right-start (progn (generate-header-element middle context)
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
160 (point)))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
161 (right-end (progn (generate-header-element right context)
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
162 (point)))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
163 (left-width (- middle-start left-start))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
164 (middle-width (- right-start middle-start))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
165 (right-width (- right-end right-start))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
166 (winwidth (- (window-width (Print-context-window context)) 1))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
167 (spaces1 (max (- (/ (- winwidth middle-width) 2) left-width) 0))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
168 (spaces2 (max (- (- winwidth right-width)
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
169 (+ left-width spaces1 middle-width))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
170 0)))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
171 (goto-char right-start)
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
172 (insert-char ?\ spaces2)
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
173 (goto-char middle-start)
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
174 (insert-char ?\ spaces1)))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
175
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
176 (defun print-context-property (print-context prop)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
177 "Return property PROP of PRINT-CONTEXT.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
178
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
179 Valid properties are
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
180
491
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
181 print-buffer Buffer being printed
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
182 print-window Window on printer device containing print buffer
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
183 print-frame Frame on printer device corresponding to current page
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
184 print-device Device referring to printer
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
185 print-start-time Time current when printing started (`current-time' format)
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
186 print-page Current printout page number, 1-based
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
187 printer-name Name of printer being printed to
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
188 short-file-name File name only, no path
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
189 long-file-name File name with its path
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
190 buffer-name Buffer name
491
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
191 date Date current when printing started (as a string)
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
192 time Time current when printing started (as a string)
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
193 page Current printout page number, 1-based (as a string)
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
194 user-id User logon id (as a string)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
195 user-name User full name"
491
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
196 (let* ((window (Print-context-window print-context))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
197 (pageno (Print-context-pageno print-context))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
198 (start-time (Print-context-start-time print-context))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
199 (printer-name (Print-context-printer-name print-context))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
200 (buffer (window-buffer window)))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
201 (case prop
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
202 (print-buffer buffer)
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
203 (print-window window)
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
204 (print-frame (window-frame window))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
205 (print-device (frame-device (window-frame window)))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
206 (print-start-time start-time)
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
207 (print-page pageno)
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
208 (printer-name printer-name)
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
209 (short-file-name (let ((name (buffer-file-name buffer)))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
210 (if name (file-name-nondirectory name) "")))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
211 (long-file-name (let ((name (buffer-file-name buffer)))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
212 (or name "")))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
213 (buffer-name (buffer-name buffer))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
214 (date (format-time-string "%x" start-time))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
215 (time (format-time-string "%X" start-time))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
216 (page (format "%d" pageno))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
217 (user-id (format "%d" (user-uid)))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
218 (user-name (format "%d" (user-login-name)))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
219 (t (error 'invalid-argument "Unrecognized print-context property"
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
220 prop)))))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
221
506
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
222 (defun generic-page-setup ()
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
223 "Display the Page Setup dialog box.
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
224 Changes made are recorded internally."
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
225 (interactive)
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
226 (let* ((d (Printer-get-device))
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
227 (props
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
228 (condition-case err
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
229 (make-dialog-box 'page-setup :device d
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
230 :properties default-msprinter-frame-plist)
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
231 (error
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
232 (Printer-clear-device)
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
233 (signal (car err) (cdr err))))))
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
234 (while props
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
235 (setq default-msprinter-frame-plist
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
236 (plist-put default-msprinter-frame-plist (car props) (cadr props)))
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
237 (setq props (cddr props)))))
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 503
diff changeset
238
491
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
239 (defun generic-print-buffer (&optional buffer display-print-dialog)
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
240 "Print buffer BUFFER using a printing method appropriate to the O.S. being run.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
241 Under Unix, `lpr' is normally used to spool out a no-frills version of the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
242 buffer, or the `ps-print' package is used to pretty-print the buffer to a
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
243 PostScript printer. Under MS Windows, the built-in printing support is used.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
244
491
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
245 If DISPLAY-PRINT-DIALOG is t, the print dialog will first be
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
246 displayed, allowing the user to select various printing settings
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
247 \(e.g. which printer to print to, the range of pages, number of copies,
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
248 modes such landscape/portrait/2-up/4-up [2 or 4 (small!) logical pages
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
249 per physical page], etc.). At this point the user can cancel the printing
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
250 operation using the dialog box, and `generic-print-buffer' will not print
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
251 anything. When called interactively, use a prefix arg to suppress the
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
252 display of the print dialog box.
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
253
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
254 If BUFFER is nil or omitted, the current buffer is used."
503
98fb34b6fbe9 [xemacs-hg @ 2001-05-04 23:31:31 by ben]
ben
parents: 491
diff changeset
255 (interactive (list nil (not current-prefix-arg)))
510
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
256 (let* ((print-region (and (interactive-p) (region-active-p)))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
257 (start (if print-region (region-beginning) (point-min buffer)))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
258 (end (if print-region (region-end) (point-max buffer))))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
259 (if (or (not (valid-specifier-tag-p 'msprinter))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
260 (not display-print-dialog))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
261 (generic-print-region start end buffer)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
262 (let* ((d (Printer-get-device))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
263 (props (condition-case err
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
264 (make-dialog-box 'print :device d
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
265 :allow-selection print-region
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
266 :selected-page-button
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
267 (if print-region 'selection 'all))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
268 (error
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
269 (Printer-clear-device)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
270 (signal (car err) (cdr err))))))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
271 (and props
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
272 (let ((really-print-region
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
273 (eq (plist-get props 'selected-page-button) 'selection)))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
274 (generic-print-region (if really-print-region start
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
275 (point-min buffer))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
276 (if really-print-region end
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
277 (point-max buffer))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
278 buffer d props)))))))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
279
491
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
280 (defun generic-print-region (start end &optional buffer print-device props)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
281 "Print region using a printing method appropriate to the O.S. being run.
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
282 The region between START and END of BUFFER (defaults to the current
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
283 buffer) is printed.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
284
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
285 Under Unix, `lpr' is normally used to spool out a no-frills version of the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
286 buffer, or the `ps-print' package is used to pretty-print the buffer to a
491
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
287 PostScript printer. Under MS Windows, the built-in printing support is used.
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
288
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
289 Optional PRINT-DEVICE is a device, already created, to use to do the
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
290 printing. This is typically used when this function was invoked from
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
291 `generic-print-buffer' and it displayed a dialog box. That function created
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
292 the device, and then the dialog box stuffed it with the user's selections
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
293 of how the buffer should be printed.
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
294
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
295 PROPS, if given, is typically the plist returned from the call to
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
296 `make-dialog-box' that displayed the Print box. It contains properties
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
297 relevant to us when we print.
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
298
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
299 Recognized properties are the same as those in `make-dialog-box':
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
300
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
301 name Printer device name. If omitted, the current system-selected
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
302 printer will be used.
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
303 from-page First page to print, 1-based. If omitted, printing starts from
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
304 the beginning.
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
305 to-page Last page to print, inclusive, If omitted, printing ends at
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
306 the end.
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
307 copies Number of copies to print. If omitted, one copy is printed."
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
308 (cond ((valid-specifier-tag-p 'msprinter)
510
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
309 ;; loop, printing one copy of document per loop. kill and
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
310 ;; re-create the frame each time so that we eject the piece
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
311 ;; of paper at the end even if we're printing more than one
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
312 ;; page per sheet of paper.
707
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 546
diff changeset
313 (let ((copies (plist-get props 'copies 1))
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 546
diff changeset
314 ;; This is not relevant to printing and can mess up
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 546
diff changeset
315 ;; msprinter frame sizing
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 546
diff changeset
316 default-frame-plist)
510
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
317 (while (> copies 0)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
318 (let (d f header-buffer footer-buffer)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
319 (setq buffer (decode-buffer buffer))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
320 (unwind-protect
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
321 (with-current-buffer buffer
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
322 (save-restriction
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
323 (narrow-to-region start end)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
324 (setq d (or print-device (Printer-get-device)))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
325 (setq f (make-frame
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
326 (list* 'name
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
327 (concat
491
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
328 (substitute ?_ ?. (buffer-name buffer))
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
329 " - XEmacs")
510
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
330 '(menubar-visible-p
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
331 nil
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
332 has-modeline-p nil
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
333 default-toolbar-visible-p nil
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
334 default-gutter-visible-p nil
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
335 minibuffer none
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
336 modeline-shadow-thickness 0
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
337 vertical-scrollbar-visible-p nil
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
338 horizontal-scrollbar-visible-p nil))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
339 d))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
340 (let* ((w (frame-root-window f))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
341 (vertdpi
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
342 (cdr (device-system-metric d 'device-dpi)))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
343 (pixel-vertical-clip-threshold (/ vertdpi 2))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
344 (from-page (plist-get props 'from-page 1))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
345 (to-page (plist-get props 'to-page))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
346 (context (make-Print-context
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
347 :start-time (current-time)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
348 ;; #### bogus! we need accessors for
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
349 ;; print-settings objects.
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
350 :printer-name
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
351 (or (plist-get props 'name)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
352 printer-name
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
353 (mswindows-get-default-printer))))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
354 header-window
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
355 footer-window)
491
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
356
510
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
357 (when printer-page-header
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
358 (let ((window-min-height 2))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
359 (setq header-window w)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
360 (setq w (split-window w 2)))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
361 (setq header-buffer
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
362 (generate-new-buffer " *header*"))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
363 (set-window-buffer header-window header-buffer))
491
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
364
510
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
365 (when printer-page-footer
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
366 (let ((window-min-height 2))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
367 (setq footer-window
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
368 (split-window w (- (window-height w) 2))))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
369 (setq footer-buffer
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
370 (generate-new-buffer " *footer*"))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
371 (set-window-buffer footer-window footer-buffer))
491
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
372
510
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
373 (setf (Print-context-window context) w)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
374
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
375 (let ((last-end 0) ; bufpos at end of previous page
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
376 reached-end ; t if we've reached the end of the
491
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
377 ; text we're printing
510
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
378 (pageno 1))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
379 (set-window-buffer w buffer)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
380 (set-window-start w start)
491
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
381
510
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
382 ;; loop, printing one page per loop
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
383 (while (and (not reached-end)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
384 ;; stop at end of region of text or
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
385 ;; outside of ranges of pages given
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
386 (or (not to-page) (<= pageno to-page)))
491
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
387
510
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
388 (setf (Print-context-pageno context) pageno)
491
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
389
510
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
390 ;; only actually print the page if it's in the
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
391 ;; range.
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
392 (when (>= pageno from-page)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
393 (when printer-page-header
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
394 (with-current-buffer header-buffer
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
395 (erase-buffer)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
396 (generate-header-line printer-page-header
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
397 context)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
398 (goto-char (point-min))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
399 (set-window-start header-window
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
400 (point-min))))
491
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
401
510
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
402 (when printer-page-footer
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
403 (with-current-buffer footer-buffer
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
404 (erase-buffer)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
405 (insert "\n")
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
406 (generate-header-line printer-page-footer
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
407 context)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
408 (goto-char (point-min))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
409 (set-window-start footer-window
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
410 (point-min))))
491
b3bbdc4058d7 [xemacs-hg @ 2001-04-30 09:26:20 by ben]
ben
parents: 444
diff changeset
411
510
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
412 (redisplay-frame f t)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
413 (print-job-eject-page f)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
414 )
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
415 ;; but use the GUARANTEE argument to `window-end'
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
416 ;; so that we get the right value even if we
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
417 ;; didn't do a redisplay.
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
418 (let ((this-end (window-end w t))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
419 (pixvis
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
420 (window-last-line-visible-height w)))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
421 ;; in case we get stuck somewhere, bow out
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
422 ;; rather than printing an infinite number of
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
423 ;; pages. #### this will fail with an image
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
424 ;; bigger than an entire page. but we really
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
425 ;; need this check here. we should be more
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
426 ;; clever in our check, to deal with this case.
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
427 (if (or (= this-end last-end)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
428 ;; #### fuckme! window-end returns a
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
429 ;; value outside of the valid range of
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
430 ;; buffer positions!!!
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
431 (>= this-end end))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
432 (setq reached-end t)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
433 (setq last-end this-end)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
434 (set-window-start w this-end)
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
435 (if pixvis
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
436 (with-selected-window w
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
437 ;; #### scroll-down should take a
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
438 ;; window arg.
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
439 (let ((window-pixel-scroll-increment
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
440 pixvis))
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
441 (scroll-down 1))))))
546
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 510
diff changeset
442 (setq pageno (1+ pageno)))))))
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 510
diff changeset
443 (and f (delete-frame f))
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 510
diff changeset
444 (and header-buffer (kill-buffer header-buffer))
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 510
diff changeset
445 (and footer-buffer (kill-buffer footer-buffer))))
510
5bdbc721d46a [xemacs-hg @ 2001-05-06 08:33:35 by ben]
ben
parents: 506
diff changeset
446 (setq copies (1- copies)))))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
447 ((and (not (eq system-type 'windows-nt))
503
98fb34b6fbe9 [xemacs-hg @ 2001-05-04 23:31:31 by ben]
ben
parents: 491
diff changeset
448 (fboundp 'lpr-region))
776
79940b592197 [xemacs-hg @ 2002-03-15 07:43:14 by ben]
ben
parents: 740
diff changeset
449 (declare-fboundp (lpr-region start end)))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
450 (t (error "No print support available"))))