comparison lisp/ps-print.el @ 54233:4da084c4e7a7

Doc fix.
author Vinicius Jose Latorre <viniciusjl@ig.com.br>
date Tue, 02 Mar 2004 04:54:04 +0000
parents 695cf19ef79e
children 8f69fa8038cb
comparison
equal deleted inserted replaced
54232:e9a21f90fd82 54233:4da084c4e7a7
1 ;;; ps-print.el --- print text from the buffer as PostScript 1 ;;; ps-print.el --- print text from the buffer as PostScript
2 2
3 ;; Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 3 ;; Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 ;; 2003 Free Software Foundation, Inc. 4 ;; 2003, 2004 Free Software Foundation, Inc.
5 5
6 ;; Author: Jim Thompson (was <thompson@wg2.waii.com>) 6 ;; Author: Jim Thompson (was <thompson@wg2.waii.com>)
7 ;; Jacques Duthen (was <duthen@cegelec-red.fr>) 7 ;; Jacques Duthen (was <duthen@cegelec-red.fr>)
8 ;; Vinicius Jose Latorre <viniciusjl@ig.com.br> 8 ;; Vinicius Jose Latorre <viniciusjl@ig.com.br>
9 ;; Kenichi Handa <handa@etl.go.jp> (multi-byte characters) 9 ;; Kenichi Handa <handa@etl.go.jp> (multi-byte characters)
10 ;; Maintainer: Kenichi Handa <handa@etl.go.jp> (multi-byte characters) 10 ;; Maintainer: Kenichi Handa <handa@etl.go.jp> (multi-byte characters)
11 ;; Vinicius Jose Latorre <viniciusjl@ig.com.br> 11 ;; Vinicius Jose Latorre <viniciusjl@ig.com.br>
12 ;; Keywords: wp, print, PostScript 12 ;; Keywords: wp, print, PostScript
13 ;; Time-stamp: <2003/07/10 19:19:12 vinicius> 13 ;; Time-stamp: <2004/02/29 00:07:55 vinicius>
14 ;; Version: 6.6.2 14 ;; Version: 6.6.3
15 ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/ 15 ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/
16 16
17 (defconst ps-print-version "6.6.2" 17 (defconst ps-print-version "6.6.3"
18 "ps-print.el, v 6.6.2 <2003/07/10 vinicius> 18 "ps-print.el, v 6.6.3 <2004/02/29 vinicius>
19 19
20 Vinicius's last change version -- this file may have been edited as part of 20 Vinicius's last change version -- this file may have been edited as part of
21 Emacs without changes to the version number. When reporting bugs, please also 21 Emacs without changes to the version number. When reporting bugs, please also
22 report the version of Emacs, if any, that ps-print was distributed with. 22 report the version of Emacs, if any, that ps-print was distributed with.
23 23
1211 ;; New since version 2.8 1211 ;; New since version 2.8
1212 ;; --------------------- 1212 ;; ---------------------
1213 ;; 1213 ;;
1214 ;; [vinicius] Vinicius Jose Latorre <viniciusjl@ig.com.br> 1214 ;; [vinicius] Vinicius Jose Latorre <viniciusjl@ig.com.br>
1215 ;; 1215 ;;
1216 ;; 20040229
1217 ;; `ps-time-stamp-yyyy-mm-dd', `ps-time-stamp-iso8601'
1218 ;;
1216 ;; 20010619 1219 ;; 20010619
1217 ;; `ps-time-stamp-locale-default' 1220 ;; `ps-time-stamp-locale-default'
1218 ;; 1221 ;;
1219 ;; 20010530 1222 ;; 20010530
1220 ;; Handle before-string and after-string overlay properties. 1223 ;; Handle before-string and after-string overlay properties.
1259 ;; N-up printing. 1262 ;; N-up printing.
1260 ;; Hook: `ps-print-begin-sheet-hook'. 1263 ;; Hook: `ps-print-begin-sheet-hook'.
1261 ;; 1264 ;;
1262 ;; [keinichi] 19990509 Kein'ichi Handa <handa@etl.go.jp> 1265 ;; [keinichi] 19990509 Kein'ichi Handa <handa@etl.go.jp>
1263 ;; 1266 ;;
1264 ;; `ps-print-region-function' 1267 ;; `ps-print-region-function'
1265 ;; 1268 ;;
1266 ;; [vinicius] Vinicius Jose Latorre <viniciusjl@ig.com.br> 1269 ;; [vinicius] Vinicius Jose Latorre <viniciusjl@ig.com.br>
1267 ;; 1270 ;;
1268 ;; 19990301 1271 ;; 19990301
1269 ;; PostScript tumble and setpagedevice. 1272 ;; PostScript tumble and setpagedevice.
1272 ;; PostScript prologue header comment insertion. 1275 ;; PostScript prologue header comment insertion.
1273 ;; Skip invisible text better. 1276 ;; Skip invisible text better.
1274 ;; 1277 ;;
1275 ;; [keinichi] 19980819 Kein'ichi Handa <handa@etl.go.jp> 1278 ;; [keinichi] 19980819 Kein'ichi Handa <handa@etl.go.jp>
1276 ;; 1279 ;;
1277 ;; Multi-byte buffer handling. 1280 ;; Multi-byte buffer handling.
1278 ;; 1281 ;;
1279 ;; [vinicius] Vinicius Jose Latorre <viniciusjl@ig.com.br> 1282 ;; [vinicius] Vinicius Jose Latorre <viniciusjl@ig.com.br>
1280 ;; 1283 ;;
1281 ;; 19980306 1284 ;; 19980306
1282 ;; Skip invisible text. 1285 ;; Skip invisible text.
1368 ;; suggestion for `ps-postscript-code-directory' variable. 1371 ;; suggestion for `ps-postscript-code-directory' variable.
1369 ;; 1372 ;;
1370 ;; Thanks to David X Callaway <dxc@xprt.net> for helping debugging PostScript 1373 ;; Thanks to David X Callaway <dxc@xprt.net> for helping debugging PostScript
1371 ;; level 1 compatibility. 1374 ;; level 1 compatibility.
1372 ;; 1375 ;;
1373 ;; Thanks to Colin Marquardt <colin.marquardt@usa.alcatel.com> for upside-down, 1376 ;; Thanks to Colin Marquardt <colin.marquardt@usa.alcatel.com> for:
1374 ;; line number step, line number start and zebra stripe follow suggestions, and 1377 ;; - upside-down, line number step, line number start and zebra stripe
1375 ;; for XEmacs beta-tests. 1378 ;; follow suggestions.
1379 ;; - `ps-time-stamp-yyyy-mm-dd' and `ps-time-stamp-iso8601' suggestion.
1380 ;; - and for XEmacs beta-tests.
1376 ;; 1381 ;;
1377 ;; Thanks to Klaus Berndl <klaus.berndl@sdm.de> for user defined PostScript 1382 ;; Thanks to Klaus Berndl <klaus.berndl@sdm.de> for user defined PostScript
1378 ;; prologue code suggestion, for odd/even printing suggestion and for 1383 ;; prologue code suggestion, for odd/even printing suggestion and for
1379 ;; `ps-prologue-file' enhancement. 1384 ;; `ps-prologue-file' enhancement.
1380 ;; 1385 ;;
3109 delimiters '(' and ')'. 3114 delimiters '(' and ')'.
3110 3115
3111 For symbols with bound functions, the function is called and should return a 3116 For symbols with bound functions, the function is called and should return a
3112 string to be inserted into the array. For symbols with bound values, the value 3117 string to be inserted into the array. For symbols with bound values, the value
3113 should be a string to be inserted into the array. In either case, function or 3118 should be a string to be inserted into the array. In either case, function or
3114 variable, the string value has PostScript string delimiters added to it." 3119 variable, the string value has PostScript string delimiters added to it.
3120
3121 If symbols are unbounded, they are silently ignored."
3115 :type '(repeat (choice :menu-tag "Left Header" 3122 :type '(repeat (choice :menu-tag "Left Header"
3116 :tag "Left Header" 3123 :tag "Left Header"
3117 string symbol)) 3124 string symbol))
3118 :group 'ps-print-headers) 3125 :group 'ps-print-headers)
3119 3126
3132 as, for example, \"06/18/01\". 3139 as, for example, \"06/18/01\".
3133 3140
3134 `ps-time-stamp-hh:mm:ss' Return time as \"17:28:31\". 3141 `ps-time-stamp-hh:mm:ss' Return time as \"17:28:31\".
3135 3142
3136 `ps-time-stamp-mon-dd-yyyy' Return date as \"Jun 18 2001\". 3143 `ps-time-stamp-mon-dd-yyyy' Return date as \"Jun 18 2001\".
3144
3145 `ps-time-stamp-yyyy-mm-dd' Return date as \"2001-06-18\" (ISO
3146 date).
3147
3148 `ps-time-stamp-iso8601' Alias for `ps-time-stamp-yyyy-mm-dd'.
3137 3149
3138 You can also create your own time stamp function by using `format-time-string' 3150 You can also create your own time stamp function by using `format-time-string'
3139 \(which see)." 3151 \(which see)."
3140 :type '(repeat (choice :menu-tag "Right Header" 3152 :type '(repeat (choice :menu-tag "Right Header"
3141 :tag "Right Header" 3153 :tag "Right Header"
3155 ')'. 3167 ')'.
3156 3168
3157 For symbols with bound functions, the function is called and should return a 3169 For symbols with bound functions, the function is called and should return a
3158 string to be inserted into the array. For symbols with bound values, the value 3170 string to be inserted into the array. For symbols with bound values, the value
3159 should be a string to be inserted into the array. In either case, function or 3171 should be a string to be inserted into the array. In either case, function or
3160 variable, the string value has PostScript string delimiters added to it." 3172 variable, the string value has PostScript string delimiters added to it.
3173
3174 If symbols are unbounded, they are silently ignored."
3161 :version "21.1" 3175 :version "21.1"
3162 :type '(repeat (choice :menu-tag "Left Footer" 3176 :type '(repeat (choice :menu-tag "Left Footer"
3163 :tag "Left Footer" 3177 :tag "Left Footer"
3164 string symbol)) 3178 string symbol))
3165 :group 'ps-print-headers) 3179 :group 'ps-print-headers)
3179 as, for example, \"06/18/01\". 3193 as, for example, \"06/18/01\".
3180 3194
3181 `ps-time-stamp-hh:mm:ss' Return time as \"17:28:31\". 3195 `ps-time-stamp-hh:mm:ss' Return time as \"17:28:31\".
3182 3196
3183 `ps-time-stamp-mon-dd-yyyy' Return date as \"Jun 18 2001\". 3197 `ps-time-stamp-mon-dd-yyyy' Return date as \"Jun 18 2001\".
3198
3199 `ps-time-stamp-yyyy-mm-dd' Return date as \"2001-06-18\" (ISO
3200 date).
3201
3202 `ps-time-stamp-iso8601' Alias for `ps-time-stamp-yyyy-mm-dd'.
3184 3203
3185 You can also create your own time stamp function by using `format-time-string' 3204 You can also create your own time stamp function by using `format-time-string'
3186 \(which see)." 3205 \(which see)."
3187 :version "21.1" 3206 :version "21.1"
3188 :type '(repeat (choice :menu-tag "Right Footer" 3207 :type '(repeat (choice :menu-tag "Right Footer"
3690 3709
3691 3710
3692 (defun ps-time-stamp-mon-dd-yyyy () 3711 (defun ps-time-stamp-mon-dd-yyyy ()
3693 "Return date as \"Jun 18 2001\"." 3712 "Return date as \"Jun 18 2001\"."
3694 (format-time-string "%b %d %Y")) 3713 (format-time-string "%b %d %Y"))
3714
3715
3716 (defun ps-time-stamp-yyyy-mm-dd ()
3717 "Return date as \"2001-06-18\" (ISO date)."
3718 (format-time-string "%Y-%m-%d"))
3719
3720
3721 (defalias 'ps-time-stamp-iso8601 'ps-time-stamp-yyyy-mm-dd
3722 "Alias for `ps-time-stamp-yyyy-mm-dd' (which see).")
3695 3723
3696 3724
3697 (defun ps-time-stamp-hh:mm:ss () 3725 (defun ps-time-stamp-hh:mm:ss ()
3698 "Return time as \"17:28:31\"." 3726 "Return time as \"17:28:31\"."
3699 (format-time-string "%T")) 3727 (format-time-string "%T"))
6606 (t (list list)))) 6634 (t (list list))))
6607 6635
6608 (defun ps-kill-emacs-check () 6636 (defun ps-kill-emacs-check ()
6609 (let (ps-buffer) 6637 (let (ps-buffer)
6610 (and (setq ps-buffer (get-buffer ps-spool-buffer-name)) 6638 (and (setq ps-buffer (get-buffer ps-spool-buffer-name))
6639 (buffer-name ps-buffer) ; check if it's not killed
6611 (buffer-modified-p ps-buffer) 6640 (buffer-modified-p ps-buffer)
6612 (y-or-n-p "Unprinted PostScript waiting; print now? ") 6641 (y-or-n-p "Unprinted PostScript waiting; print now? ")
6613 (ps-despool)) 6642 (ps-despool))
6614 (and (setq ps-buffer (get-buffer ps-spool-buffer-name)) 6643 (and (setq ps-buffer (get-buffer ps-spool-buffer-name))
6644 (buffer-name ps-buffer) ; check if it's not killed
6615 (buffer-modified-p ps-buffer) 6645 (buffer-modified-p ps-buffer)
6616 (not (yes-or-no-p "Unprinted PostScript waiting; exit anyway? ")) 6646 (not (yes-or-no-p "Unprinted PostScript waiting; exit anyway? "))
6617 (error "Unprinted PostScript")))) 6647 (error "Unprinted PostScript"))))
6618 6648
6619 (cond ((fboundp 'add-hook) 6649 (cond ((fboundp 'add-hook)