comparison lisp/ps-print.el @ 89956:b9eee0a7bef5

Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-25 Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-459 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-463 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-464 Update from CVS: lisp/progmodes/make-mode.el: Fix comments. * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-465 Update from CVS
author Miles Bader <miles@gnu.org>
date Fri, 23 Jul 2004 04:30:44 +0000
parents 4c90ffeb71c5 8d030ffc0866
children c08afac24467
comparison
equal deleted inserted replaced
89955:7f8b53f94713 89956:b9eee0a7bef5
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: <2004/03/10 18:57:00 vinicius> 13 ;; Time-stamp: <2004/07/21 23:12:05 vinicius>
14 ;; Version: 6.6.4 14 ;; Version: 6.6.5
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.4" 17 (defconst ps-print-version "6.6.5"
18 "ps-print.el, v 6.6.4 <2004/03/10 vinicius> 18 "ps-print.el, v 6.6.5 <2004/07/21 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
1351 ;; 1351 ;;
1352 ;; 1352 ;;
1353 ;; Acknowledgments 1353 ;; Acknowledgments
1354 ;; --------------- 1354 ;; ---------------
1355 ;; 1355 ;;
1356 ;; Thanks to Michael Piotrowski <mxp@dynalabs.de> for improving the DSC
1357 ;; compliance of the generated PostScript.
1358 ;;
1356 ;; Thanks to Adam Doppelt <adoppelt@avogadro.com> for face mapping suggestion 1359 ;; Thanks to Adam Doppelt <adoppelt@avogadro.com> for face mapping suggestion
1357 ;; for black/white PostScript printers. 1360 ;; for black/white PostScript printers.
1358 ;; 1361 ;;
1359 ;; Thanks to Toni Ronkko <tronkko@hytti.uku.fi> for line and paragraph spacing, 1362 ;; Thanks to Toni Ronkko <tronkko@hytti.uku.fi> for line and paragraph spacing,
1360 ;; region to cut out when printing and footer suggestions. 1363 ;; region to cut out when printing and footer suggestions.
1422 ;; 1425 ;;
1423 ;; Thanks to Avishai Yacobi, avishaiy@mcil.comm.mot.com, for writing the 1426 ;; Thanks to Avishai Yacobi, avishaiy@mcil.comm.mot.com, for writing the
1424 ;; initial port to Emacs 19. His code is no longer part of ps-print, but his 1427 ;; initial port to Emacs 19. His code is no longer part of ps-print, but his
1425 ;; work is still appreciated. 1428 ;; work is still appreciated.
1426 ;; 1429 ;;
1427 ;; Thanks to Remi Houdaille and Michel Train, michel@metasoft.fdn.org, for 1430 ;; Thanks to Remi Houdaille and Michel Train <michel@metasoft.fdn.org> for
1428 ;; adding underline support. Their code also is no longer part of ps-print, 1431 ;; adding underline support. Their code also is no longer part of ps-print,
1429 ;; but their efforts are not forgotten. 1432 ;; but their efforts are not forgotten.
1430 ;; 1433 ;;
1431 ;; Thanks also to all of you who mailed code to add features to ps-print; 1434 ;; Thanks also to all of you who mailed code to add features to ps-print;
1432 ;; although I didn't use your code, I still appreciate your sharing it with me. 1435 ;; although I didn't use your code, I still appreciate your sharing it with me.
4160 ;; Internal functions and variables 4163 ;; Internal functions and variables
4161 4164
4162 4165
4163 (defun ps-message-log-max () 4166 (defun ps-message-log-max ()
4164 (and (not (string= (buffer-name) "*Messages*")) 4167 (and (not (string= (buffer-name) "*Messages*"))
4168 (boundp 'message-log-max)
4165 message-log-max)) 4169 message-log-max))
4166 4170
4167 4171
4168 (defvar ps-print-hook nil) 4172 (defvar ps-print-hook nil)
4169 (defvar ps-print-begin-sheet-hook nil) 4173 (defvar ps-print-begin-sheet-hook nil)
4208 (goto-char to) 4212 (goto-char to)
4209 (if (= (current-column) 0) 1 0)))) 4213 (if (= (current-column) 0) 1 0))))
4210 4214
4211 4215
4212 (defvar ps-printing-region nil 4216 (defvar ps-printing-region nil
4213 "Variable used to indicate if the region that ps-print is printing. 4217 "Variable used to indicate the region that ps-print is printing.
4214 It is a cons, the car of which is the line number where the region begins, and 4218 It is a cons, the car of which is the line number where the region begins, and
4215 its cdr is the total number of lines in the buffer. Formatting functions can 4219 its cdr is the total number of lines in the buffer. Formatting functions can
4216 use this information to print the original line number (and not the number of 4220 use this information to print the original line number (and not the number of
4217 lines printed), and to indicate in the header that the printout is of a partial 4221 lines printed), and to indicate in the header that the printout is of a partial
4218 file.") 4222 file.")
5394 (and ps-n-up-on (setq tumble (not tumble))) 5398 (and ps-n-up-on (setq tumble (not tumble)))
5395 (ps-output 5399 (ps-output
5396 ps-adobe-tag 5400 ps-adobe-tag
5397 "%%Title: " (buffer-name) ; Take job name from name of 5401 "%%Title: " (buffer-name) ; Take job name from name of
5398 ; first buffer printed 5402 ; first buffer printed
5399 "\n%%Creator: " (user-full-name) 5403 "\n%%Creator: ps-print v" ps-print-version
5400 " (using ps-print v" ps-print-version 5404 "\n%%For: " (user-full-name)
5401 ")\n%%CreationDate: " (format-time-string "%T %b %d %Y") 5405 "\n%%CreationDate: " (format-time-string "%T %b %d %Y")
5402 "\n%%Orientation: " 5406 "\n%%Orientation: "
5403 (if ps-landscape-mode "Landscape" "Portrait") 5407 (if ps-landscape-mode "Landscape" "Portrait")
5404 "\n%%DocumentNeededResources: font Times-Roman Times-Italic\n%%+ font " 5408 "\n%%DocumentNeededResources: font Times-Roman Times-Italic\n%%+ font "
5405 (mapconcat 'identity 5409 (mapconcat 'identity
5406 (ps-remove-duplicates 5410 (ps-remove-duplicates
5407 (append (ps-fonts 'ps-font-for-text) 5411 (append (ps-fonts 'ps-font-for-text)
5408 (list (ps-font 'ps-font-for-header 'normal) 5412 (list (ps-font 'ps-font-for-header 'normal)
5409 (ps-font 'ps-font-for-header 'bold)))) 5413 (ps-font 'ps-font-for-header 'bold)
5414 (ps-font 'ps-font-for-footer 'normal)
5415 (ps-font 'ps-font-for-footer 'bold))))
5410 "\n%%+ font ") 5416 "\n%%+ font ")
5417 "\n%%DocumentSuppliedResources: procset PSPrintUserDefinedPrologue-" (user-login-name) " 0 0"
5411 "\n%%DocumentMedia: " (ps-page-dimensions-get-media dimensions) 5418 "\n%%DocumentMedia: " (ps-page-dimensions-get-media dimensions)
5412 (format " %d" (round (ps-page-dimensions-get-width dimensions))) 5419 (format " %d" (round (ps-page-dimensions-get-width dimensions)))
5413 (format " %d" (round (ps-page-dimensions-get-height dimensions))) 5420 (format " %d" (round (ps-page-dimensions-get-height dimensions)))
5414 " 0 () ()\n%%PageOrder: Ascend\n%%Pages: (atend)\n%%Requirements:" 5421 " 0 () ()\n%%PageOrder: Ascend\n%%Pages: (atend)\n%%Requirements:"
5415 (if ps-spool-duplex 5422 (if ps-spool-duplex
5425 (format "/ErrorMessage %s def\n\n" 5432 (format "/ErrorMessage %s def\n\n"
5426 (or (cdr (assoc ps-error-handler-message 5433 (or (cdr (assoc ps-error-handler-message
5427 ps-error-handler-alist)) 5434 ps-error-handler-alist))
5428 1)) ; send to paper 5435 1)) ; send to paper
5429 ps-print-prologue-0 5436 ps-print-prologue-0
5430 "\n%%BeginProcSet: UserDefinedPrologue\n\n") 5437 "\n%%BeginResource: procset PSPrintUserDefinedPrologue-" (user-login-name) " 0 0\n\n")
5431 5438
5432 (ps-insert-string ps-user-defined-prologue) 5439 (ps-insert-string ps-user-defined-prologue)
5433 5440
5434 (ps-output "\n%%EndProcSet\n\n") 5441 (ps-output "\n%%EndResource\n\n")
5435 5442
5436 (ps-output-boolean "LandscapeMode " 5443 (ps-output-boolean "LandscapeMode "
5437 (or ps-landscape-mode 5444 (or ps-landscape-mode
5438 (eq (ps-n-up-landscape n-up) 'pag))) 5445 (eq (ps-n-up-landscape n-up) 'pag)))
5439 (ps-output-boolean "UpsideDown " ps-print-upside-down) 5446 (ps-output-boolean "UpsideDown " ps-print-upside-down)
5541 5548
5542 (ps-output "\n/printGlobalBackground{\n") 5549 (ps-output "\n/printGlobalBackground{\n")
5543 (mapcar 'ps-output ps-background-all-pages) 5550 (mapcar 'ps-output ps-background-all-pages)
5544 (ps-output "}def\n/printLocalBackground{\n}def\n") 5551 (ps-output "}def\n/printLocalBackground{\n}def\n")
5545 5552
5553 (ps-output "\n%%EndProlog\n\n%%BeginSetup\n")
5554
5555 (ps-output
5556 "\n%%IncludeResource: font Times-Roman"
5557 "\n%%IncludeResource: font Times-Italic\n%%IncludeResource: font "
5558 (mapconcat 'identity
5559 (ps-remove-duplicates
5560 (append (ps-fonts 'ps-font-for-text)
5561 (list (ps-font 'ps-font-for-header 'normal)
5562 (ps-font 'ps-font-for-header 'bold)
5563 (ps-font 'ps-font-for-footer 'normal)
5564 (ps-font 'ps-font-for-footer 'bold))))
5565 "\n%%IncludeResource: font ")
5566 "\n")
5567
5546 ;; Header/line number fonts 5568 ;; Header/line number fonts
5547 (ps-output (format "/h0 %s(%s)cvn DefFont\n" ; /h0 14/Helvetica-Bold DefFont 5569 (ps-output (format "/h0 %s(%s)cvn DefFont\n" ; /h0 14/Helvetica-Bold DefFont
5548 ps-header-title-font-size-internal 5570 ps-header-title-font-size-internal
5549 (ps-font 'ps-font-for-header 'bold)) 5571 (ps-font 'ps-font-for-header 'bold))
5550 (format "/h1 %s(%s)cvn DefFont\n" ; /h1 12/Helvetica DefFont 5572 (format "/h1 %s(%s)cvn DefFont\n" ; /h1 12/Helvetica DefFont
5584 5606
5585 (let ((font-entry (cdr (assq ps-font-family ps-font-info-database)))) 5607 (let ((font-entry (cdr (assq ps-font-family ps-font-info-database))))
5586 (ps-output (format "/SpaceWidthRatio %f def\n" 5608 (ps-output (format "/SpaceWidthRatio %f def\n"
5587 (/ (ps-lookup 'space-width) (ps-lookup 'size))))) 5609 (/ (ps-lookup 'space-width) (ps-lookup 'size)))))
5588 5610
5589 (ps-output "\n%%EndProlog\n\n%%BeginSetup\n")
5590 (unless (eq ps-spool-config 'lpr-switches) 5611 (unless (eq ps-spool-config 'lpr-switches)
5591 (ps-output "\n%%BeginFeature: *Duplex " 5612 (ps-output "\n%%BeginFeature: *Duplex "
5592 (ps-boolean-capitalized ps-spool-duplex) 5613 (ps-boolean-capitalized ps-spool-duplex)
5593 " *Tumble " 5614 " *Tumble "
5594 (ps-boolean-capitalized tumble) 5615 (ps-boolean-capitalized tumble)