comparison lisp/ps-print.el @ 23138:14e74d2a49cb

(ps-print-control-characters): Doc-string modified. (ps-output-string-prim): Comment format changed. (ps-do-despool): Indentation of source code changed.
author Kenichi Handa <handa@m17n.org>
date Fri, 28 Aug 1998 12:33:52 +0000
parents 25c95d9da0af
children ada869918064
comparison
equal deleted inserted replaced
23137:fed2ba47003f 23138:14e74d2a49cb
500 ;; If its value does not correspond to a known font family, 500 ;; If its value does not correspond to a known font family,
501 ;; an error message is printed into the `*Messages*' buffer, 501 ;; an error message is printed into the `*Messages*' buffer,
502 ;; which lists the currently available font families. 502 ;; which lists the currently available font families.
503 ;; 503 ;;
504 ;; The variable `ps-font-size' determines the size (in points) 504 ;; The variable `ps-font-size' determines the size (in points)
505 ;; of the font for ordinary text, when generating Postscript. 505 ;; of the font for ordinary text, when generating PostScript.
506 ;; Its value is a float. 506 ;; Its value is a float.
507 ;; 507 ;;
508 ;; Similarly, the variable `ps-header-font-family' determines 508 ;; Similarly, the variable `ps-header-font-family' determines
509 ;; which font family is to be used for text in the header. 509 ;; which font family is to be used for text in the header.
510 ;; The variable `ps-header-font-size' determines the font size, 510 ;; The variable `ps-header-font-size' determines the font size,
850 ;; 850 ;;
851 ;; 851 ;;
852 ;; Acknowledgements 852 ;; Acknowledgements
853 ;; ---------------- 853 ;; ----------------
854 ;; 854 ;;
855 ;; Thanks to Kein'ichi Handa <handa@etl.go.jp> for multi-byte buffer handling.
856 ;;
857 ;; Thanks to Matthew O Persico <Matthew.Persico@lazard.com> for line number on
858 ;; empty columns.
859 ;;
860 ;; Thanks to Theodore Jump <tjump@cais.com> for adjust PostScript code order on
861 ;; last page.
862 ;;
855 ;; Thanks to Roland Ducournau <ducour@lirmm.fr> for 863 ;; Thanks to Roland Ducournau <ducour@lirmm.fr> for
856 ;; `ps-print-control-characters' variable documentation. 864 ;; `ps-print-control-characters' variable documentation.
857 ;;
858 ;; Thanks to Kein'ichi Handa <handa@etl.go.jp> for multi-byte buffer handling.
859 ;; 865 ;;
860 ;; Thanks to Marcus G Daniels <marcus@cathcart.sysc.pdx.edu> for a better 866 ;; Thanks to Marcus G Daniels <marcus@cathcart.sysc.pdx.edu> for a better
861 ;; database font management. 867 ;; database font management.
862 ;; 868 ;;
863 ;; Thanks to Martin Boyer <gamin@videotron.ca> for some ideas on putting one 869 ;; Thanks to Martin Boyer <gamin@videotron.ca> for some ideas on putting one
1051 :group 'ps-print) 1057 :group 'ps-print)
1052 1058
1053 (defcustom ps-print-control-characters 'control-8-bit 1059 (defcustom ps-print-control-characters 'control-8-bit
1054 "*Specifies the printable form for control and 8-bit characters. 1060 "*Specifies the printable form for control and 8-bit characters.
1055 That is, instead of sending, for example, a ^D (\004) to printer, 1061 That is, instead of sending, for example, a ^D (\004) to printer,
1056 you can send ^ and D. 1062 it is sent the string \"^D\".
1057 1063
1058 Valid values are: 1064 Valid values are:
1059 1065
1060 `8-bit' This is the value to use when you want an ASCII encoding of 1066 `8-bit' This is the value to use when you want an ASCII encoding of
1061 any control or non-ASCII character. Control characters are 1067 any control or non-ASCII character. Control characters are
4002 (defun ps-output-string-prim (string) 4008 (defun ps-output-string-prim (string)
4003 (insert "(") ;insert start-string delimiter 4009 (insert "(") ;insert start-string delimiter
4004 (save-excursion ;insert string 4010 (save-excursion ;insert string
4005 (insert (string-as-unibyte string))) 4011 (insert (string-as-unibyte string)))
4006 ;; Find and quote special characters as necessary for PS 4012 ;; Find and quote special characters as necessary for PS
4007 ;; This skips everything except control chars, nonascii chars, 4013 ;; This skips everything except control chars, nonascii chars, (, ) and \.
4008 ;; (, ) and \.
4009 (while (progn (skip-chars-forward " -'*-[]-~") (not (eobp))) 4014 (while (progn (skip-chars-forward " -'*-[]-~") (not (eobp)))
4010 (let ((special (following-char))) 4015 (let ((special (following-char)))
4011 (delete-char 1) 4016 (delete-char 1)
4012 (insert (aref ps-string-escape-codes special)))) 4017 (insert (aref ps-string-escape-codes special))))
4013 (goto-char (point-max)) 4018 (goto-char (point-max))
5022 (let (safe-marker completed-safely needs-begin-file) 5027 (let (safe-marker completed-safely needs-begin-file)
5023 (unwind-protect 5028 (unwind-protect
5024 (progn 5029 (progn
5025 (set-buffer ps-spool-buffer) 5030 (set-buffer ps-spool-buffer)
5026 (set-buffer-multibyte nil) 5031 (set-buffer-multibyte nil)
5032
5027 ;; Get a marker and make it point to the current end of the 5033 ;; Get a marker and make it point to the current end of the
5028 ;; buffer, If an error occurs, we'll delete everything from 5034 ;; buffer, If an error occurs, we'll delete everything from
5029 ;; the end of this marker onwards. 5035 ;; the end of this marker onwards.
5030 (setq safe-marker (make-marker)) 5036 (setq safe-marker (make-marker))
5031 (set-marker safe-marker (point-max)) 5037 (set-marker safe-marker (point-max))
5098 (save-excursion 5104 (save-excursion
5099 (set-buffer ps-spool-buffer) 5105 (set-buffer ps-spool-buffer)
5100 (let* ((coding-system-for-write 'raw-text-unix) 5106 (let* ((coding-system-for-write 'raw-text-unix)
5101 (ps-printer-name (or ps-printer-name printer-name)) 5107 (ps-printer-name (or ps-printer-name printer-name))
5102 (ps-lpr-switches 5108 (ps-lpr-switches
5103 (append 5109 (append (and (stringp ps-printer-name)
5104 (and (stringp ps-printer-name) 5110 (list (concat "-P" ps-printer-name)))
5105 (list (concat "-P" ps-printer-name))) 5111 ps-lpr-switches)))
5106 ps-lpr-switches)))
5107 (if (and (memq system-type '(ms-dos windows-nt)) 5112 (if (and (memq system-type '(ms-dos windows-nt))
5108 (or (stringp dos-ps-printer) 5113 (or (stringp dos-ps-printer)
5109 (stringp ps-printer-name))) 5114 (stringp ps-printer-name)))
5110 (write-region (point-min) (point-max) 5115 (write-region (point-min) (point-max)
5111 (if (stringp dos-ps-printer) 5116 (if (stringp dos-ps-printer)