/[emacs]/emacs/lisp/ps-print.el
ViewVC logotype

Diff of /emacs/lisp/ps-print.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.135 by lektu, Tue May 6 17:53:37 2003 UTC revision 1.136 by viniciusjl, Thu May 15 02:32:03 2003 UTC
# Line 10  Line 10 
10  ;; Maintainer: Kenichi Handa <handa@etl.go.jp> (multi-byte characters)  ;; Maintainer: Kenichi Handa <handa@etl.go.jp> (multi-byte characters)
11  ;;      Vinicius Jose Latorre <viniciusjl@ig.com.br>  ;;      Vinicius Jose Latorre <viniciusjl@ig.com.br>
12  ;; Keywords: wp, print, PostScript  ;; Keywords: wp, print, PostScript
13  ;; Time-stamp: <2003/03/05 21:54:55 vinicius>  ;; Time-stamp: <2003/05/14 22:34:05 vinicius>
14  ;; Version: 6.6  ;; Version: 6.6.1
15  ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/  ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/
16    
17  (defconst ps-print-version "6.6"  (defconst ps-print-version "6.6.1"
18    "ps-print.el, v 6.6 <2003/03/05 vinicius>    "ps-print.el, v 6.6.1 <2003/05/14 vinicius>
19    
20  Vinicius's last change version -- this file may have been edited as part of  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  Emacs without changes to the version number.  When reporting bugs, please also
# Line 840  Please send all bug fixes and enhancemen Line 840  Please send all bug fixes and enhancemen
840  ;;              22       +   22          +  ;;              22       +   22          +
841  ;;              --------     -----------     ---------     ----------------  ;;              --------     -----------     ---------     ----------------
842  ;;  ;;
843  ;; Any other value is treated as `nil'.  ;; Any other value is treated as nil.
844  ;;  ;;
845  ;; See also section How Ps-Print Has A Text And/Or Image On Background.  ;; See also section How Ps-Print Has A Text And/Or Image On Background.
846  ;;  ;;
# Line 4666  page-height == ((floor print-height ((th Line 4666  page-height == ((floor print-height ((th
4666      (goto-char (point-max))      (goto-char (point-max))
4667      (insert-file fname)))      (insert-file fname)))
4668    
4669    ;; These functions are used in `ps-mule' to get charset of header and footer.
4670    ;; To avoid unnecessary calls to functions in `ps-left-header',
4671    ;; `ps-right-header', `ps-left-footer' and `ps-right-footer'.
4672    
4673    (defun ps-generate-string-list (content)
4674      (let (str)
4675        (while content
4676          (setq str (cons (cond
4677                           ((stringp (car content))
4678                            (car content))
4679                           ((and (symbolp (car content)) (fboundp (car content)))
4680                            (concat "(" (funcall (car content)) ")"))
4681                           ((and (symbolp (car content)) (boundp (car content)))
4682                            (concat "(" (symbol-value (car content)) ")"))
4683                           (t
4684                            ""))
4685                          str)
4686                content (cdr content)))
4687        (nreverse str)))
4688    
4689    (defvar ps-lh-cache nil)
4690    (defvar ps-rh-cache nil)
4691    (defvar ps-lf-cache nil)
4692    (defvar ps-rf-cache nil)
4693    
4694    (defun ps-header-footer-string ()
4695      (and ps-print-header
4696           (setq ps-lh-cache (ps-generate-string-list ps-left-header)
4697                 ps-rh-cache (ps-generate-string-list ps-right-header)))
4698      (and ps-print-footer
4699           (setq ps-lf-cache (ps-generate-string-list ps-left-footer)
4700                 ps-rf-cache (ps-generate-string-list ps-right-footer)))
4701      (mapconcat 'identity
4702                 (append ps-lh-cache ps-rh-cache ps-lf-cache ps-rf-cache)
4703                 ""))
4704    
4705  ;; These functions insert the arrays that define the contents of the headers.  ;; These functions insert the arrays that define the contents of the headers.
4706    
4707  (defun ps-generate-header-line (fonttag &optional content)  (defun ps-generate-header-line (fonttag &optional content)
# Line 5809  XSTART YSTART are the relative position Line 5845  XSTART YSTART are the relative position
5845               (format "/PageNumber %d def\n" (ps-page-number)))               (format "/PageNumber %d def\n" (ps-page-number)))
5846    
5847    (when ps-print-header    (when ps-print-header
5848      (ps-generate-header "HeaderLinesLeft"  "/h0" "/h1" ps-left-header)      (ps-generate-header "HeaderLinesLeft"  "/h0" "/h1"
5849      (ps-generate-header "HeaderLinesRight" "/h0" "/h1" ps-right-header)                          (or ps-lh-cache ps-left-header))
5850      (ps-output (format "%d SetHeaderLines\n" ps-header-lines)))      (ps-generate-header "HeaderLinesRight" "/h0" "/h1"
5851                            (or ps-rh-cache ps-right-header))
5852        (ps-output (format "%d SetHeaderLines\n" ps-header-lines))
5853        (setq ps-lh-cache nil
5854              ps-rh-cache nil))
5855    
5856    (when ps-print-footer    (when ps-print-footer
5857      (ps-generate-header "FooterLinesLeft"  "/H0" "/H0" ps-left-footer)      (ps-generate-header "FooterLinesLeft"  "/H0" "/H0"
5858      (ps-generate-header "FooterLinesRight" "/H0" "/H0" ps-right-footer)                          (or ps-lf-cache ps-left-footer))
5859      (ps-output (format "%d SetFooterLines\n" ps-footer-lines)))      (ps-generate-header "FooterLinesRight" "/H0" "/H0"
5860                            (or ps-rf-cache ps-right-footer))
5861        (ps-output (format "%d SetFooterLines\n" ps-footer-lines))
5862        (setq ps-lf-cache nil
5863              ps-rf-cache nil))
5864    
5865    (ps-output (number-to-string ps-lines-printed) " BeginPage\n")    (ps-output (number-to-string ps-lines-printed) " BeginPage\n")
5866    (ps-set-font  ps-current-font)    (ps-set-font  ps-current-font)

Legend:
Removed from v.1.135  
changed lines
  Added in v.1.136

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26