emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/ps-print.el [lexbind]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/ps-print.el [lexbind]
Date: Tue, 14 Oct 2003 19:52:19 -0400

Index: emacs/lisp/ps-print.el
diff -c emacs/lisp/ps-print.el:1.126.4.1 emacs/lisp/ps-print.el:1.126.4.2
*** emacs/lisp/ps-print.el:1.126.4.1    Fri Apr  4 01:20:10 2003
--- emacs/lisp/ps-print.el      Tue Oct 14 19:51:21 2003
***************
*** 10,21 ****
  ;; Maintainer: Kenichi Handa <address@hidden> (multi-byte characters)
  ;;    Vinicius Jose Latorre <address@hidden>
  ;; Keywords: wp, print, PostScript
! ;; Time-stamp: <2003/03/05 21:54:55 vinicius>
! ;; Version: 6.6
  ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/
  
! (defconst ps-print-version "6.6"
!   "ps-print.el, v 6.6 <2003/03/05 vinicius>
  
  Vinicius's last change version -- this file may have been edited as part of
  Emacs without changes to the version number.  When reporting bugs, please also
--- 10,21 ----
  ;; Maintainer: Kenichi Handa <address@hidden> (multi-byte characters)
  ;;    Vinicius Jose Latorre <address@hidden>
  ;; Keywords: wp, print, PostScript
! ;; Time-stamp: <2003/07/10 19:19:12 vinicius>
! ;; Version: 6.6.2
  ;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/
  
! (defconst ps-print-version "6.6.2"
!   "ps-print.el, v 6.6.2 <2003/07/10 vinicius>
  
  Vinicius's last change version -- this file may have been edited as part of
  Emacs without changes to the version number.  When reporting bugs, please also
***************
*** 840,846 ****
  ;;            22       +   22          +
  ;;            --------     -----------     ---------     ----------------
  ;;
! ;; Any other value is treated as `nil'.
  ;;
  ;; See also section How Ps-Print Has A Text And/Or Image On Background.
  ;;
--- 840,846 ----
  ;;            22       +   22          +
  ;;            --------     -----------     ---------     ----------------
  ;;
! ;; Any other value is treated as nil.
  ;;
  ;; See also section How Ps-Print Has A Text And/Or Image On Background.
  ;;
***************
*** 2134,2140 ****
                22       +   22          +
                --------     -----------     ---------     ----------------
  
! Any other value is treated as `nil'."
    :type '(choice :menu-tag "Zebra Stripe Follow"
                 :tag "Zebra Stripe Follow"
                 (const :tag "Always Restart" nil)
--- 2134,2140 ----
                22       +   22          +
                --------     -----------     ---------     ----------------
  
! Any other value is treated as nil."
    :type '(choice :menu-tag "Zebra Stripe Follow"
                 :tag "Zebra Stripe Follow"
                 (const :tag "Always Restart" nil)
***************
*** 4126,4132 ****
  
  (defun ps-spool-without-faces (from to &optional region-p)
    (run-hooks 'ps-print-hook)
!   (ps-printing-region region-p from)
    (ps-generate (current-buffer) from to 'ps-generate-postscript))
  
  
--- 4126,4132 ----
  
  (defun ps-spool-without-faces (from to &optional region-p)
    (run-hooks 'ps-print-hook)
!   (ps-printing-region region-p from to)
    (ps-generate (current-buffer) from to 'ps-generate-postscript))
  
  
***************
*** 4137,4143 ****
  
  (defun ps-spool-with-faces (from to &optional region-p)
    (run-hooks 'ps-print-hook)
!   (ps-printing-region region-p from)
    (ps-generate (current-buffer) from to 'ps-generate-postscript-with-faces))
  
  
--- 4137,4143 ----
  
  (defun ps-spool-with-faces (from to &optional region-p)
    (run-hooks 'ps-print-hook)
!   (ps-printing-region region-p from to)
    (ps-generate (current-buffer) from to 'ps-generate-postscript-with-faces))
  
  
***************
*** 4167,4177 ****
    "Non-nil means ps-print is printing a region.")
  
  
! (defun ps-printing-region (region-p from)
    (setq ps-printing-region-p region-p
        ps-printing-region
        (cons (if region-p
!                 (ps-count-lines (point-min) from)
                1)
              (ps-count-lines (point-min) (point-max)))))
  
--- 4167,4177 ----
    "Non-nil means ps-print is printing a region.")
  
  
! (defun ps-printing-region (region-p from to)
    (setq ps-printing-region-p region-p
        ps-printing-region
        (cons (if region-p
!                 (ps-count-lines (point-min) (min from to))
                1)
              (ps-count-lines (point-min) (point-max)))))
  
***************
*** 4666,4671 ****
--- 4666,4707 ----
      (goto-char (point-max))
      (insert-file fname)))
  
+ ;; These functions are used in `ps-mule' to get charset of header and footer.
+ ;; To avoid unnecessary calls to functions in `ps-left-header',
+ ;; `ps-right-header', `ps-left-footer' and `ps-right-footer'.
+ 
+ (defun ps-generate-string-list (content)
+   (let (str)
+     (while content
+       (setq str (cons (cond
+                      ((stringp (car content))
+                       (car content))
+                      ((and (symbolp (car content)) (fboundp (car content)))
+                       (concat "(" (funcall (car content)) ")"))
+                      ((and (symbolp (car content)) (boundp (car content)))
+                       (concat "(" (symbol-value (car content)) ")"))
+                      (t
+                       ""))
+                     str)
+           content (cdr content)))
+     (nreverse str)))
+ 
+ (defvar ps-lh-cache nil)
+ (defvar ps-rh-cache nil)
+ (defvar ps-lf-cache nil)
+ (defvar ps-rf-cache nil)
+ 
+ (defun ps-header-footer-string ()
+   (and ps-print-header
+        (setq ps-lh-cache (ps-generate-string-list ps-left-header)
+            ps-rh-cache (ps-generate-string-list ps-right-header)))
+   (and ps-print-footer
+        (setq ps-lf-cache (ps-generate-string-list ps-left-footer)
+            ps-rf-cache (ps-generate-string-list ps-right-footer)))
+   (mapconcat 'identity
+            (append ps-lh-cache ps-rh-cache ps-lf-cache ps-rf-cache)
+            ""))
+ 
  ;; These functions insert the arrays that define the contents of the headers.
  
  (defun ps-generate-header-line (fonttag &optional content)
***************
*** 5809,5822 ****
             (format "/PageNumber %d def\n" (ps-page-number)))
  
    (when ps-print-header
!     (ps-generate-header "HeaderLinesLeft"  "/h0" "/h1" ps-left-header)
!     (ps-generate-header "HeaderLinesRight" "/h0" "/h1" ps-right-header)
!     (ps-output (format "%d SetHeaderLines\n" ps-header-lines)))
  
    (when ps-print-footer
!     (ps-generate-header "FooterLinesLeft"  "/H0" "/H0" ps-left-footer)
!     (ps-generate-header "FooterLinesRight" "/H0" "/H0" ps-right-footer)
!     (ps-output (format "%d SetFooterLines\n" ps-footer-lines)))
  
    (ps-output (number-to-string ps-lines-printed) " BeginPage\n")
    (ps-set-font  ps-current-font)
--- 5845,5866 ----
             (format "/PageNumber %d def\n" (ps-page-number)))
  
    (when ps-print-header
!     (ps-generate-header "HeaderLinesLeft"  "/h0" "/h1"
!                       (or ps-lh-cache ps-left-header))
!     (ps-generate-header "HeaderLinesRight" "/h0" "/h1"
!                       (or ps-rh-cache ps-right-header))
!     (ps-output (format "%d SetHeaderLines\n" ps-header-lines))
!     (setq ps-lh-cache nil
!         ps-rh-cache nil))
  
    (when ps-print-footer
!     (ps-generate-header "FooterLinesLeft"  "/H0" "/H0"
!                       (or ps-lf-cache ps-left-footer))
!     (ps-generate-header "FooterLinesRight" "/H0" "/H0"
!                       (or ps-rf-cache ps-right-footer))
!     (ps-output (format "%d SetFooterLines\n" ps-footer-lines))
!     (setq ps-lf-cache nil
!         ps-rf-cache nil))
  
    (ps-output (number-to-string ps-lines-printed) " BeginPage\n")
    (ps-set-font  ps-current-font)
***************
*** 6828,6831 ****
--- 6872,6876 ----
  
  (provide 'ps-print)
  
+ ;;; arch-tag: fb06a585-1112-4206-885d-a57d95d50579
  ;;; ps-print.el ends here




reply via email to

[Prev in Thread] Current Thread [Next in Thread]