/[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.149 by viniciusjl, Tue Jul 27 02:10:51 2004 UTC revision 1.150 by viniciusjl, Sun Nov 21 22:30:00 2004 UTC
# Line 1443  Please send all bug fixes and enhancemen Line 1443  Please send all bug fixes and enhancemen
1443    
1444  ;;; Code:  ;;; Code:
1445    
 (eval-and-compile  
   (require 'lpr)  
1446    
1447    (or (featurep 'lisp-float-type)  (require 'lpr)
       (error "`ps-print' requires floating point support"))  
1448    
1449    (or (featurep 'lisp-float-type)
1450        (error "`ps-print' requires floating point support"))
1451    
   (defvar ps-print-emacs-type  
     (let ((case-fold-search t))  
       (cond ((string-match "XEmacs" emacs-version) 'xemacs)  
             ((string-match "Lucid" emacs-version)  
              (error "`ps-print' doesn't support Lucid"))  
             ((string-match "Epoch" emacs-version)  
              (error "`ps-print' doesn't support Epoch"))  
             (t  
              (unless (and (boundp 'emacs-major-version)  
                           (> emacs-major-version 19))  
                (error "`ps-print' only supports Emacs 20 and higher"))  
              'emacs))))  
1452    
1453    (defvar ps-print-emacs-type
1454      (let ((case-fold-search t))
1455        (cond ((string-match "XEmacs" emacs-version) 'xemacs)
1456              ((string-match "Lucid" emacs-version)
1457               (error "`ps-print' doesn't support Lucid"))
1458              ((string-match "Epoch" emacs-version)
1459               (error "`ps-print' doesn't support Epoch"))
1460              (t
1461               (unless (and (boundp 'emacs-major-version)
1462                            (> emacs-major-version 19))
1463                 (error "`ps-print' only supports Emacs 20 and higher"))
1464               'emacs))))
1465    
   ;; For Emacs 20.2 and the earlier version.  
1466    
1467    (or (fboundp 'set-buffer-multibyte)  ;; For Emacs 20.2 and the earlier version.
       (defun set-buffer-multibyte (arg)  
         (setq enable-multibyte-characters arg)))  
1468    
1469    (or (fboundp 'string-as-unibyte)  (or (fboundp 'set-buffer-multibyte)
1470        (defun string-as-unibyte (arg) arg))      (defun set-buffer-multibyte (arg)
1471          (setq enable-multibyte-characters arg)))
1472    
1473    (or (fboundp 'string-as-multibyte)  (or (fboundp 'string-as-unibyte)
1474        (defun string-as-multibyte (arg) arg))      (defun string-as-unibyte (arg) arg))
1475    
1476    (or (fboundp 'char-charset)  (or (fboundp 'string-as-multibyte)
1477        (defun char-charset (arg) 'ascii))      (defun string-as-multibyte (arg) arg))
1478    
1479    (or (fboundp 'charset-after)  (or (fboundp 'char-charset)
1480        (defun charset-after (&optional arg)      (defun char-charset (arg) 'ascii))
         (char-charset (char-after arg))))  
1481    
1482    (or (fboundp 'charset-after)
1483        (defun charset-after (&optional arg)
1484          (char-charset (char-after arg))))
1485    
1486    ;; GNU Emacs  
1487    (or (fboundp 'line-beginning-position)  ;; GNU Emacs
1488        (defun line-beginning-position (&optional n)  (or (fboundp 'line-beginning-position)
1489          (save-excursion      (defun line-beginning-position (&optional n)
1490            (and n (/= n 1) (forward-line (1- n)))        (save-excursion
1491            (beginning-of-line)          (and n (/= n 1) (forward-line (1- n)))
1492            (point))))          (beginning-of-line)
1493            (point))))
1494    
1495    ;; to avoid compilation gripes  
1496    ;; to avoid compilation gripes
1497    ;; XEmacs  
1498    (defalias 'ps-x-color-instance-p              'color-instance-p)  ;; XEmacs
1499    (defalias 'ps-x-color-instance-rgb-components 'color-instance-rgb-components)  (defalias 'ps-x-color-instance-p              'color-instance-p)
1500    (defalias 'ps-x-color-name                    'color-name)  (defalias 'ps-x-color-instance-rgb-components 'color-instance-rgb-components)
1501    (defalias 'ps-x-color-specifier-p             'color-specifier-p)  (defalias 'ps-x-color-name                    'color-name)
1502    (defalias 'ps-x-copy-coding-system            'copy-coding-system)  (defalias 'ps-x-color-specifier-p             'color-specifier-p)
1503    (defalias 'ps-x-device-class                  'device-class)  (defalias 'ps-x-copy-coding-system            'copy-coding-system)
1504    (defalias 'ps-x-extent-end-position           'extent-end-position)  (defalias 'ps-x-device-class                  'device-class)
1505    (defalias 'ps-x-extent-face                   'extent-face)  (defalias 'ps-x-extent-end-position           'extent-end-position)
1506    (defalias 'ps-x-extent-priority               'extent-priority)  (defalias 'ps-x-extent-face                   'extent-face)
1507    (defalias 'ps-x-extent-start-position         'extent-start-position)  (defalias 'ps-x-extent-priority               'extent-priority)
1508    (defalias 'ps-x-face-font-instance            'face-font-instance)  (defalias 'ps-x-extent-start-position         'extent-start-position)
1509    (defalias 'ps-x-find-coding-system            'find-coding-system)  (defalias 'ps-x-face-font-instance            'face-font-instance)
1510    (defalias 'ps-x-font-instance-properties      'font-instance-properties)  (defalias 'ps-x-find-coding-system            'find-coding-system)
1511    (defalias 'ps-x-make-color-instance           'make-color-instance)  (defalias 'ps-x-font-instance-properties      'font-instance-properties)
1512    (defalias 'ps-x-map-extents                   'map-extents)  (defalias 'ps-x-make-color-instance           'make-color-instance)
1513    (defalias 'ps-x-map-extents                   'map-extents)
1514    ;; GNU Emacs  
1515    (defalias 'ps-e-face-bold-p         'face-bold-p)  ;; GNU Emacs
1516    (defalias 'ps-e-face-italic-p       'face-italic-p)  (defalias 'ps-e-face-bold-p         'face-bold-p)
1517    (defalias 'ps-e-next-overlay-change 'next-overlay-change)  (defalias 'ps-e-face-italic-p       'face-italic-p)
1518    (defalias 'ps-e-overlays-at         'overlays-at)  (defalias 'ps-e-next-overlay-change 'next-overlay-change)
1519    (defalias 'ps-e-overlay-get         'overlay-get)  (defalias 'ps-e-overlays-at         'overlays-at)
1520    (defalias 'ps-e-overlay-end         'overlay-end)  (defalias 'ps-e-overlay-get         'overlay-get)
1521    (defalias 'ps-e-x-color-values      'x-color-values)  (defalias 'ps-e-overlay-end         'overlay-end)
1522    (defalias 'ps-e-color-values        'color-values)  (defalias 'ps-e-x-color-values      'x-color-values)
1523    (if (fboundp 'find-composition)  (defalias 'ps-e-color-values        'color-values)
1524        (defalias 'ps-e-find-composition 'find-composition)  (if (fboundp 'find-composition)
1525      (defalias 'ps-e-find-composition 'ignore))      (defalias 'ps-e-find-composition 'find-composition)
1526      (defalias 'ps-e-find-composition 'ignore))
1527    
1528    (defconst ps-windows-system  
1529      (memq system-type '(emx win32 w32 mswindows ms-dos windows-nt)))  (defconst ps-windows-system
1530    (defconst ps-lp-system    (memq system-type '(emx win32 w32 mswindows ms-dos windows-nt)))
1531      (memq system-type '(usg-unix-v dgux hpux irix)))  (defconst ps-lp-system
1532      (memq system-type '(usg-unix-v dgux hpux irix)))
1533    
1534    (defun ps-xemacs-color-name (color)  
1535      (if (ps-x-color-specifier-p color)  (defun ps-xemacs-color-name (color)
1536          (ps-x-color-name color)    (if (ps-x-color-specifier-p color)
1537        color))        (ps-x-color-name color)
1538        color))
1539    
1540    (cond ((eq ps-print-emacs-type 'emacs) ; emacs  
1541           (defvar mark-active nil)  (cond ((featurep 'xemacs)               ; xemacs
1542           (defun ps-mark-active-p ()         (defalias 'ps-mark-active-p 'region-active-p)
1543             mark-active)         (defun ps-face-foreground-name (face)
1544           (defalias 'ps-face-foreground-name 'face-foreground)           (ps-xemacs-color-name (face-foreground face)))
1545           (defalias 'ps-face-background-name 'face-background)         (defun ps-face-background-name (face)
1546           )           (ps-xemacs-color-name (face-background face)))
1547          (t                              ; xemacs         )
1548           (defalias 'ps-mark-active-p 'region-active-p)        (t                                ; emacs
1549           (defun ps-face-foreground-name (face)         (defvar mark-active nil)
1550             (ps-xemacs-color-name (face-foreground face)))         (defun ps-mark-active-p ()
1551           (defun ps-face-background-name (face)           mark-active)
1552             (ps-xemacs-color-name (face-background face)))         (defalias 'ps-face-foreground-name 'face-foreground)
1553           )))         (defalias 'ps-face-background-name 'face-background)
1554           ))
1555    
1556    
1557  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
# Line 1563  Please send all bug fixes and enhancemen Line 1563  Please send all bug fixes and enhancemen
1563  (defgroup postscript nil  (defgroup postscript nil
1564    "PostScript Group"    "PostScript Group"
1565    :tag "PostScript"    :tag "PostScript"
1566      :version "20"
1567    :group 'emacs)    :group 'emacs)
1568    
1569  (defgroup ps-print nil  (defgroup ps-print nil
1570    "PostScript generator for Emacs"    "PostScript generator for Emacs"
1571    :link '(emacs-library-link :tag "Source Lisp File" "ps-print.el")    :link '(emacs-library-link :tag "Source Lisp File" "ps-print.el")
1572    :prefix "ps-"    :prefix "ps-"
1573      :version "20"
1574    :group 'wp    :group 'wp
1575    :group 'postscript)    :group 'postscript)
1576    
# Line 1576  Please send all bug fixes and enhancemen Line 1578  Please send all bug fixes and enhancemen
1578    "Horizontal page layout"    "Horizontal page layout"
1579    :prefix "ps-"    :prefix "ps-"
1580    :tag "Horizontal"    :tag "Horizontal"
1581      :version "20"
1582    :group 'ps-print)    :group 'ps-print)
1583    
1584  (defgroup ps-print-vertical nil  (defgroup ps-print-vertical nil
1585    "Vertical page layout"    "Vertical page layout"
1586    :prefix "ps-"    :prefix "ps-"
1587    :tag "Vertical"    :tag "Vertical"
1588      :version "20"
1589    :group 'ps-print)    :group 'ps-print)
1590    
1591  (defgroup ps-print-headers nil  (defgroup ps-print-headers nil
1592    "Headers & footers layout"    "Headers & footers layout"
1593    :prefix "ps-"    :prefix "ps-"
1594    :tag "Header & Footer"    :tag "Header & Footer"
1595      :version "20"
1596    :group 'ps-print)    :group 'ps-print)
1597    
1598  (defgroup ps-print-font nil  (defgroup ps-print-font nil
1599    "Fonts customization"    "Fonts customization"
1600    :prefix "ps-"    :prefix "ps-"
1601    :tag "Font"    :tag "Font"
1602      :version "20"
1603    :group 'ps-print)    :group 'ps-print)
1604    
1605  (defgroup ps-print-color nil  (defgroup ps-print-color nil
1606    "Color customization"    "Color customization"
1607    :prefix "ps-"    :prefix "ps-"
1608    :tag "Color"    :tag "Color"
1609      :version "20"
1610    :group 'ps-print)    :group 'ps-print)
1611    
1612  (defgroup ps-print-face nil  (defgroup ps-print-face nil
1613    "Faces customization"    "Faces customization"
1614    :prefix "ps-"    :prefix "ps-"
1615    :tag "PS Faces"    :tag "PS Faces"
1616      :version "20"
1617    :group 'ps-print    :group 'ps-print
1618    :group 'faces)    :group 'faces)
1619    
# Line 1613  Please send all bug fixes and enhancemen Line 1621  Please send all bug fixes and enhancemen
1621    "N-up customization"    "N-up customization"
1622    :prefix "ps-"    :prefix "ps-"
1623    :tag "N-Up"    :tag "N-Up"
1624      :version "20"
1625    :group 'ps-print)    :group 'ps-print)
1626    
1627  (defgroup ps-print-zebra nil  (defgroup ps-print-zebra nil
1628    "Zebra customization"    "Zebra customization"
1629    :prefix "ps-"    :prefix "ps-"
1630    :tag "Zebra"    :tag "Zebra"
1631      :version "20"
1632    :group 'ps-print)    :group 'ps-print)
1633    
1634  (defgroup ps-print-background nil  (defgroup ps-print-background nil
1635    "Background customization"    "Background customization"
1636    :prefix "ps-"    :prefix "ps-"
1637    :tag "Background"    :tag "Background"
1638      :version "20"
1639    :group 'ps-print)    :group 'ps-print)
1640    
1641  (defgroup ps-print-printer '((lpr custom-group))  (defgroup ps-print-printer '((lpr custom-group))
1642    "Printer customization"    "Printer customization"
1643    :prefix "ps-"    :prefix "ps-"
1644    :tag "Printer"    :tag "Printer"
1645      :version "20"
1646    :group 'ps-print)    :group 'ps-print)
1647    
1648  (defgroup ps-print-page nil  (defgroup ps-print-page nil
1649    "Page customization"    "Page customization"
1650    :prefix "ps-"    :prefix "ps-"
1651    :tag "Page"    :tag "Page"
1652      :version "20"
1653    :group 'ps-print)    :group 'ps-print)
1654    
1655  (defgroup ps-print-miscellany nil  (defgroup ps-print-miscellany nil
1656    "Miscellany customization"    "Miscellany customization"
1657    :prefix "ps-"    :prefix "ps-"
1658    :tag "Miscellany"    :tag "Miscellany"
1659      :version "20"
1660    :group 'ps-print)    :group 'ps-print)
1661    
1662    
# Line 1669  Any other value is treated as `paper'." Line 1683  Any other value is treated as `paper'."
1683                   :tag "Error Handler Message"                   :tag "Error Handler Message"
1684                   (const none)   (const paper)                   (const none)   (const paper)
1685                   (const system) (const paper-and-system))                   (const system) (const paper-and-system))
1686      :version "20"
1687    :group 'ps-print-miscellany)    :group 'ps-print-miscellany)
1688    
1689  (defcustom ps-user-defined-prologue nil  (defcustom ps-user-defined-prologue nil
# Line 1700  As an example for `ps-user-defined-prolo Line 1715  As an example for `ps-user-defined-prolo
1715    :type '(choice :menu-tag "User Defined Prologue"    :type '(choice :menu-tag "User Defined Prologue"
1716                   :tag "User Defined Prologue"                   :tag "User Defined Prologue"
1717                   (const :tag "none" nil) string symbol)                   (const :tag "none" nil) string symbol)
1718      :version "20"
1719    :group 'ps-print-miscellany)    :group 'ps-print-miscellany)
1720    
1721  (defcustom ps-print-prologue-header nil  (defcustom ps-print-prologue-header nil
# Line 1729  For more information about PostScript do Line 1745  For more information about PostScript do
1745    :type '(choice :menu-tag "Prologue Header"    :type '(choice :menu-tag "Prologue Header"
1746                   :tag "Prologue Header"                   :tag "Prologue Header"
1747                   (const :tag "none" nil) string symbol)                   (const :tag "none" nil) string symbol)
1748      :version "20"
1749    :group 'ps-print-miscellany)    :group 'ps-print-miscellany)
1750    
1751  (defcustom ps-printer-name (and (boundp 'printer-name)  (defcustom ps-printer-name (and (boundp 'printer-name)
# Line 1760  See also `ps-printer-name-option' for do Line 1777  See also `ps-printer-name-option' for do
1777                   (const :tag "No Printer Name" t)                   (const :tag "No Printer Name" t)
1778                   (file :tag "Print to file")                   (file :tag "Print to file")
1779                   (string :tag "Pipe to ps-lpr-command"))                   (string :tag "Pipe to ps-lpr-command"))
1780      :version "20"
1781    :group 'ps-print-printer)    :group 'ps-print-printer)
1782    
1783  (defcustom ps-printer-name-option  (defcustom ps-printer-name-option
# Line 1803  Novell Netware respectively) are handled Line 1821  Novell Netware respectively) are handled
1821  the destination for output; any other program is treated like `lpr' except that  the destination for output; any other program is treated like `lpr' except that
1822  an explicit filename is given as the last argument."  an explicit filename is given as the last argument."
1823    :type 'string    :type 'string
1824      :version "20"
1825    :group 'ps-print-printer)    :group 'ps-print-printer)
1826    
1827  (defcustom ps-lpr-switches lpr-switches  (defcustom ps-lpr-switches lpr-switches
# Line 1811  an explicit filename is given as the las Line 1830  an explicit filename is given as the las
1830                   (choice :menu-tag "PostScript lpr Switch"                   (choice :menu-tag "PostScript lpr Switch"
1831                           :tag "PostScript lpr Switch"                           :tag "PostScript lpr Switch"
1832                           string symbol (repeat sexp)))                           string symbol (repeat sexp)))
1833      :version "20"
1834    :group 'ps-print-printer)    :group 'ps-print-printer)
1835    
1836  (defcustom ps-print-region-function nil  (defcustom ps-print-region-function nil
# Line 1818  an explicit filename is given as the las Line 1838  an explicit filename is given as the las
1838  See definition of `call-process-region' for calling conventions.  The fourth  See definition of `call-process-region' for calling conventions.  The fourth
1839  and the sixth arguments are both nil."  and the sixth arguments are both nil."
1840    :type '(choice (const nil) function)    :type '(choice (const nil) function)
1841      :version "20"
1842    :group 'ps-print-printer)    :group 'ps-print-printer)
1843    
1844  (defcustom ps-manual-feed nil  (defcustom ps-manual-feed nil
# Line 1825  and the sixth arguments are both nil." Line 1846  and the sixth arguments are both nil."
1846    
1847  If it's nil, automatic feeding takes place."  If it's nil, automatic feeding takes place."
1848    :type 'boolean    :type 'boolean
1849      :version "20"
1850    :group 'ps-print-printer)    :group 'ps-print-printer)
1851    
1852  (defcustom ps-end-with-control-d (and ps-windows-system t)  (defcustom ps-end-with-control-d (and ps-windows-system t)
1853    "*Non-nil means insert C-d at end of PostScript file generated."    "*Non-nil means insert C-d at end of PostScript file generated."
1854    :version "21.1"    :version "21.1"
1855    :type 'boolean    :type 'boolean
1856      :version "20"
1857    :group 'ps-print-printer)    :group 'ps-print-printer)
1858    
1859  ;;; Page layout  ;;; Page layout
# Line 1874  See `ps-paper-type'." Line 1897  See `ps-paper-type'."
1897                         (number :tag "Width")                         (number :tag "Width")
1898                         (number :tag "Height")                         (number :tag "Height")
1899                         (string :tag "Media")))                         (string :tag "Media")))
1900      :version "20"
1901    :group 'ps-print-page)    :group 'ps-print-page)
1902    
1903  ;;;###autoload  ;;;###autoload
# Line 1887  example `letter', `legal' or `a4'." Line 1911  example `letter', `legal' or `a4'."
1911                                   nil                                   nil
1912                                 (widget-put wid :error "Unknown paper size")                                 (widget-put wid :error "Unknown paper size")
1913                                 wid)))                                 wid)))
1914      :version "20"
1915    :group 'ps-print-page)    :group 'ps-print-page)
1916    
1917  (defcustom ps-warn-paper-type t  (defcustom ps-warn-paper-type t
# Line 1894  example `letter', `legal' or `a4'." Line 1919  example `letter', `legal' or `a4'."
1919    
1920  It's used when `ps-spool-config' is set to `setpagedevice'."  It's used when `ps-spool-config' is set to `setpagedevice'."
1921    :type 'boolean    :type 'boolean
1922      :version "20"
1923    :group 'ps-print-page)    :group 'ps-print-page)
1924    
1925  (defcustom ps-landscape-mode nil  (defcustom ps-landscape-mode nil
1926    "*Non-nil means print in landscape mode."    "*Non-nil means print in landscape mode."
1927    :type 'boolean    :type 'boolean
1928      :version "20"
1929    :group 'ps-print-page)    :group 'ps-print-page)
1930    
1931  (defcustom ps-print-upside-down nil  (defcustom ps-print-upside-down nil
# Line 1931  See also `ps-even-or-odd-pages'." Line 1958  See also `ps-even-or-odd-pages'."
1958                          (cons :tag "Range"                          (cons :tag "Range"
1959                                (integer :tag "From")                                (integer :tag "From")
1960                                (integer :tag "To"))))                                (integer :tag "To"))))
1961      :version "20"
1962    :group 'ps-print-page)    :group 'ps-print-page)
1963    
1964  (defcustom ps-even-or-odd-pages nil  (defcustom ps-even-or-odd-pages nil
# Line 1989  sheet parity." Line 2017  sheet parity."
2017                   (const :tag "Only Odd Pages" odd-page)                   (const :tag "Only Odd Pages" odd-page)
2018                   (const :tag "Only Even Sheets" even-sheet)                   (const :tag "Only Even Sheets" even-sheet)
2019                   (const :tag "Only Odd Sheets" odd-sheet))                   (const :tag "Only Odd Sheets" odd-sheet))
2020      :version "20"
2021    :group 'ps-print-page)    :group 'ps-print-page)
2022    
2023  (defcustom ps-print-control-characters 'control-8-bit  (defcustom ps-print-control-characters 'control-8-bit
# Line 2020  Any other value is treated as nil." Line 2049  Any other value is treated as nil."
2049                   :tag "Control Char"                   :tag "Control Char"
2050                   (const 8-bit)   (const control-8-bit)                   (const 8-bit)   (const control-8-bit)
2051                   (const control) (const :tag "nil" nil))                   (const control) (const :tag "nil" nil))
2052      :version "20"
2053    :group 'ps-print-miscellany)    :group 'ps-print-miscellany)
2054    
2055  (defcustom ps-n-up-printing 1  (defcustom ps-n-up-printing 1
# Line 2035  Any other value is treated as nil." Line 2065  Any other value is treated as nil."
2065                 wid :error                 wid :error
2066                 "Number of pages per sheet paper must be between 1 and 100.")                 "Number of pages per sheet paper must be between 1 and 100.")
2067                wid)))                wid)))
2068      :version "20"
2069    :group 'ps-print-n-up)    :group 'ps-print-n-up)
2070    
2071  (defcustom ps-n-up-margin (/ (* 72  1.0) 2.54) ; 1 cm  (defcustom ps-n-up-margin (/ (* 72  1.0) 2.54) ; 1 cm
2072    "*Specify the margin in points between the sheet border and n-up printing."    "*Specify the margin in points between the sheet border and n-up printing."
2073    :type 'number    :type 'number
2074      :version "20"
2075    :group 'ps-print-n-up)    :group 'ps-print-n-up)
2076    
2077  (defcustom ps-n-up-border-p t  (defcustom ps-n-up-border-p t
2078    "*Non-nil means a border is drawn around each page."    "*Non-nil means a border is drawn around each page."
2079    :type 'boolean    :type 'boolean
2080      :version "20"
2081    :group 'ps-print-n-up)    :group 'ps-print-n-up)
2082    
2083  (defcustom ps-n-up-filling 'left-top  (defcustom ps-n-up-filling 'left-top
# Line 2076  Any other value is treated as `left-top' Line 2109  Any other value is treated as `left-top'
2109                   (const right-top) (const right-bottom)                   (const right-top) (const right-bottom)
2110                   (const top-left)  (const bottom-left)                   (const top-left)  (const bottom-left)
2111                   (const top-right) (const bottom-right))                   (const top-right) (const bottom-right))
2112      :version "20"
2113    :group 'ps-print-n-up)    :group 'ps-print-n-up)
2114    
2115  (defcustom ps-number-of-columns (if ps-landscape-mode 2 1)  (defcustom ps-number-of-columns (if ps-landscape-mode 2 1)
2116    "*Specify the number of columns."    "*Specify the number of columns."
2117    :type 'number    :type 'number
2118      :version "20"
2119    :group 'ps-print-miscellany)    :group 'ps-print-miscellany)
2120    
2121  (defcustom ps-zebra-stripes nil  (defcustom ps-zebra-stripes nil
2122    "*Non-nil means print zebra stripes.    "*Non-nil means print zebra stripes.
2123  See also documentation for `ps-zebra-stripe-height' and `ps-zebra-color'."  See also documentation for `ps-zebra-stripe-height' and `ps-zebra-color'."
2124    :type 'boolean    :type 'boolean
2125      :version "20"
2126    :group 'ps-print-zebra)    :group 'ps-print-zebra)
2127    
2128  (defcustom ps-zebra-stripe-height 3  (defcustom ps-zebra-stripe-height 3
2129    "*Number of zebra stripe lines.    "*Number of zebra stripe lines.
2130  See also documentation for `ps-zebra-stripes' and `ps-zebra-color'."  See also documentation for `ps-zebra-stripes' and `ps-zebra-color'."
2131    :type 'number    :type 'number
2132      :version "20"
2133    :group 'ps-print-zebra)    :group 'ps-print-zebra)
2134    
2135  (defcustom ps-zebra-color 0.95  (defcustom ps-zebra-color 0.95
# Line 2106  See also documentation for `ps-zebra-str Line 2143  See also documentation for `ps-zebra-str
2143                         (number :tag "Red")                         (number :tag "Red")
2144                         (number :tag "Green")                         (number :tag "Green")
2145                         (number :tag "Blue")))                         (number :tag "Blue")))
2146      :version "20"
2147    :group 'ps-print-zebra)    :group 'ps-print-zebra)
2148    
2149  (defcustom ps-zebra-stripe-follow nil  (defcustom ps-zebra-stripe-follow nil
# Line 2149  Any other value is treated as nil." Line 2187  Any other value is treated as nil."
2187                   (const :tag "Continue on Next Page" follow)                   (const :tag "Continue on Next Page" follow)
2188                   (const :tag "Print Only Full Stripe" full)                   (const :tag "Print Only Full Stripe" full)
2189                   (const :tag "Continue on Full Stripe" full-follow))                   (const :tag "Continue on Full Stripe" full-follow))
2190      :version "20"
2191    :group 'ps-print-zebra)    :group 'ps-print-zebra)
2192    
2193  (defcustom ps-line-number nil  (defcustom ps-line-number nil
2194    "*Non-nil means print line number."    "*Non-nil means print line number."
2195    :type 'boolean    :type 'boolean
2196      :version "20"
2197    :group 'ps-print-miscellany)    :group 'ps-print-miscellany)
2198    
2199  (defcustom ps-line-number-step 1  (defcustom ps-line-number-step 1
# Line 2183  Any other value is treated as `zebra'." Line 2223  Any other value is treated as `zebra'."
2223                   :tag "Line Number Step"                   :tag "Line Number Step"
2224                   (integer :tag "Step Interval")                   (integer :tag "Step Interval")
2225                   (const :tag "Synchronize Zebra" zebra))                   (const :tag "Synchronize Zebra" zebra))
2226      :version "20"
2227    :group 'ps-print-miscellany)    :group 'ps-print-miscellany)
2228    
2229  (defcustom ps-line-number-start 1  (defcustom ps-line-number-start 1
# Line 2212  The values for `ps-line-number-start': Line 2253  The values for `ps-line-number-start':
2253       value of `ps-zebra-strip-height' inclusive.  Use this combination if you       value of `ps-zebra-strip-height' inclusive.  Use this combination if you
2254       wish that line number be relative to zebra stripes."       wish that line number be relative to zebra stripes."
2255    :type '(integer :tag "Start Step Interval")    :type '(integer :tag "Start Step Interval")
2256      :version "20"
2257    :group 'ps-print-miscellany)    :group 'ps-print-miscellany)
2258    
2259  (defcustom ps-print-background-image nil  (defcustom ps-print-background-image nil
# Line 2258  For example, if you wish to print an EPS Line 2300  For example, if you wish to print an EPS
2300                            (cons :tag "Range"                            (cons :tag "Range"
2301                                  (integer :tag "From")                                  (integer :tag "From")
2302                                  (integer :tag "To"))))))                                  (integer :tag "To"))))))
2303      :version "20"
2304    :group 'ps-print-background)    :group 'ps-print-background)
2305    
2306  (defcustom ps-print-background-text nil  (defcustom ps-print-background-text nil
# Line 2309  For example, if you wish to print text \ Line 2352  For example, if you wish to print text \
2352                            (cons :tag "Range"                            (cons :tag "Range"
2353                                  (integer :tag "From")                                  (integer :tag "From")
2354                                  (integer :tag "To"))))))                                  (integer :tag "To"))))))
2355      :version "20"
2356    :group 'ps-print-background)    :group 'ps-print-background)
2357    
2358  ;;; Horizontal layout  ;;; Horizontal layout
# Line 2322  For example, if you wish to print text \ Line 2366  For example, if you wish to print text \
2366  (defcustom ps-left-margin   (/ (* 72  2.0) 2.54) ;   2 cm  (defcustom ps-left-margin   (/ (* 72  2.0) 2.54) ;   2 cm
2367    "*Left margin in points (1/72 inch)."    "*Left margin in points (1/72 inch)."
2368    :type 'number    :type 'number
2369      :version "20"
2370    :group 'ps-print-horizontal)    :group 'ps-print-horizontal)
2371    
2372  (defcustom ps-right-margin  (/ (* 72  2.0) 2.54) ;   2 cm  (defcustom ps-right-margin  (/ (* 72  2.0) 2.54) ;   2 cm
2373    "*Right margin in points (1/72 inch)."    "*Right margin in points (1/72 inch)."
2374    :type 'number    :type 'number
2375      :version "20"
2376    :group 'ps-print-horizontal)    :group 'ps-print-horizontal)
2377    
2378  (defcustom ps-inter-column  (/ (* 72  2.0) 2.54) ;   2 cm  (defcustom ps-inter-column  (/ (* 72  2.0) 2.54) ;   2 cm
2379    "*Horizontal space between columns in points (1/72 inch)."    "*Horizontal space between columns in points (1/72 inch)."
2380    :type 'number    :type 'number
2381      :version "20"
2382    :group 'ps-print-horizontal)    :group 'ps-print-horizontal)
2383    
2384  ;;; Vertical layout  ;;; Vertical layout
# Line 2351  For example, if you wish to print text \ Line 2398  For example, if you wish to print text \
2398  (defcustom ps-bottom-margin (/ (* 72  1.5) 2.54) ; 1.5 cm  (defcustom ps-bottom-margin (/ (* 72  1.5) 2.54) ; 1.5 cm
2399    "*Bottom margin in points (1/72 inch)."    "*Bottom margin in points (1/72 inch)."
2400    :type 'number    :type 'number
2401      :version "20"
2402    :group 'ps-print-vertical)    :group 'ps-print-vertical)
2403    
2404  (defcustom ps-top-margin    (/ (* 72  1.5) 2.54) ; 1.5 cm  (defcustom ps-top-margin    (/ (* 72  1.5) 2.54) ; 1.5 cm
2405    "*Top margin in points (1/72 inch)."    "*Top margin in points (1/72 inch)."
2406    :type 'number    :type 'number
2407      :version "20"
2408    :group 'ps-print-vertical)    :group 'ps-print-vertical)
2409    
2410  (defcustom ps-header-offset (/ (* 72  1.0) 2.54) ; 1.0 cm  (defcustom ps-header-offset (/ (* 72  1.0) 2.54) ; 1.0 cm
2411    "*Vertical space in points (1/72 inch) between the main text and the header."    "*Vertical space in points (1/72 inch) between the main text and the header."
2412    :type 'number    :type 'number
2413      :version "20"
2414    :group 'ps-print-vertical)    :group 'ps-print-vertical)
2415    
2416  (defcustom ps-header-line-pad 0.15  (defcustom ps-header-line-pad 0.15
# Line 2368  For example, if you wish to print text \ Line 2418  For example, if you wish to print text \
2418  The insertion is done between the header frame and the text it contains,  The insertion is done between the header frame and the text it contains,
2419  both in the vertical and horizontal directions."  both in the vertical and horizontal directions."
2420    :type 'number    :type 'number
2421      :version "20"
2422    :group 'ps-print-vertical)    :group 'ps-print-vertical)
2423    
2424  (defcustom ps-footer-offset (/ (* 72  1.0) 2.54) ; 1.0 cm  (defcustom ps-footer-offset (/ (* 72  1.0) 2.54) ; 1.0 cm
2425    "*Vertical space in points (1/72 inch) between the main text and the footer."    "*Vertical space in points (1/72 inch) between the main text and the footer."
2426    :type 'number    :type 'number
2427      :version "20"
2428    :group 'ps-print-vertical)    :group 'ps-print-vertical)
2429    
2430  (defcustom ps-footer-line-pad 0.15  (defcustom ps-footer-line-pad 0.15
# Line 2380  both in the vertical and horizontal dire Line 2432  both in the vertical and horizontal dire
2432  The insertion is done between the footer frame and the text it contains,  The insertion is done between the footer frame and the text it contains,
2433  both in the vertical and horizontal directions."  both in the vertical and horizontal directions."
2434    :type 'number    :type 'number
2435      :version "20"
2436    :group 'ps-print-vertical)    :group 'ps-print-vertical)
2437    
2438  ;;; Header/Footer setup  ;;; Header/Footer setup
# Line 2390  By default, the header displays the buff Line 2443  By default, the header displays the buff
2443  buffer is visiting a file, the file's directory.  Headers are customizable by  buffer is visiting a file, the file's directory.  Headers are customizable by
2444  changing variables `ps-left-header' and `ps-right-header'."  changing variables `ps-left-header' and `ps-right-header'."
2445    :type 'boolean    :type 'boolean
2446      :version "20"
2447    :group 'ps-print-headers)    :group 'ps-print-headers)
2448    
2449  (defcustom ps-print-header-frame t  (defcustom ps-print-header-frame t
2450    "*Non-nil means draw a gaudy frame around the header."    "*Non-nil means draw a gaudy frame around the header."
2451    :type 'boolean    :type 'boolean
2452      :version "20"
2453    :group 'ps-print-headers)    :group 'ps-print-headers)
2454    
2455  (defcustom ps-header-frame-alist  (defcustom ps-header-frame-alist
# Line 2474  Don't change this alist directly, instea Line 2529  Don't change this alist directly, instea
2529                                        (number :tag "Red")                                        (number :tag "Red")
2530                                        (number :tag "Green")                                        (number :tag "Green")
2531                                        (number :tag "Blue"))))))                                        (number :tag "Blue"))))))
2532      :version "20"
2533    :group 'ps-print-headers)    :group 'ps-print-headers)
2534    
2535  (defcustom ps-header-lines 2  (defcustom ps-header-lines 2
2536    "*Number of lines to display in page header, when generating PostScript."    "*Number of lines to display in page header, when generating PostScript."
2537    :type 'integer    :type 'integer
2538      :version "20"
2539    :group 'ps-print-headers)    :group 'ps-print-headers)
2540    
2541  (defcustom ps-print-footer nil  (defcustom ps-print-footer nil
# Line 2486  Don't change this alist directly, instea Line 2543  Don't change this alist directly, instea
2543  By default, the footer displays page number.  By default, the footer displays page number.
2544  Footers are customizable by changing variables `ps-left-footer' and  Footers are customizable by changing variables `ps-left-footer' and
2545  `ps-right-footer'."  `ps-right-footer'."
   :version "21.1"  
2546    :type 'boolean    :type 'boolean
2547      :version "21.1"
2548    :group 'ps-print-headers)    :group 'ps-print-headers)
2549    
2550  (defcustom ps-print-footer-frame t  (defcustom ps-print-footer-frame t
2551    "*Non-nil means draw a gaudy frame around the footer."    "*Non-nil means draw a gaudy frame around the footer."
   :version "21.1"  
2552    :type 'boolean    :type 'boolean
2553      :version "21.1"
2554    :group 'ps-print-headers)    :group 'ps-print-headers)
2555    
2556  (defcustom ps-footer-frame-alist  (defcustom ps-footer-frame-alist
# Line 2508  Don't change this alist directly, instea Line 2565  Don't change this alist directly, instea
2565  `ps-get', `ps-put' and `ps-del' functions (see them for documentation).  `ps-get', `ps-put' and `ps-del' functions (see them for documentation).
2566    
2567  See also `ps-header-frame-alist' for documentation."  See also `ps-header-frame-alist' for documentation."
   :version "21.1"  
2568    :type '(repeat    :type '(repeat
2569            (choice :menu-tag "Header Frame Element"            (choice :menu-tag "Header Frame Element"
2570                    :tag ""                    :tag ""
# Line 2555  See also `ps-header-frame-alist' for doc Line 2611  See also `ps-header-frame-alist' for doc
2611                                        (number :tag "Red")                                        (number :tag "Red")
2612                                        (number :tag "Green")                                        (number :tag "Green")
2613                                        (number :tag "Blue"))))))                                        (number :tag "Blue"))))))
2614      :version "21.1"
2615    :group 'ps-print-headers)    :group 'ps-print-headers)
2616    
2617  (defcustom ps-footer-lines 2  (defcustom ps-footer-lines 2
2618    "*Number of lines to display in page footer, when generating PostScript."    "*Number of lines to display in page footer, when generating PostScript."
   :version "21.1"  
2619    :type 'integer    :type 'integer
2620      :version "21.1"
2621    :group 'ps-print-headers)    :group 'ps-print-headers)
2622    
2623  (defcustom ps-print-only-one-header nil  (defcustom ps-print-only-one-header nil
# Line 2569  This is useful when printing more than o Line 2626  This is useful when printing more than o
2626  only one header/footer over all columns or one header/footer per column.  only one header/footer over all columns or one header/footer per column.
2627  See also `ps-print-header' and `ps-print-footer'."  See also `ps-print-header' and `ps-print-footer'."
2628    :type 'boolean    :type 'boolean
2629      :version "20"
2630    :group 'ps-print-headers)    :group 'ps-print-headers)
2631    
2632  (defcustom ps-switch-header 'duplex  (defcustom ps-switch-header 'duplex
# Line 2591  See also `ps-print-header' and `ps-print Line 2649  See also `ps-print-header' and `ps-print
2649                   (const :tag "Never Switch" nil)                   (const :tag "Never Switch" nil)
2650                   (const :tag "Always Switch" t)                   (const :tag "Always Switch" t)
2651                   (const :tag "Switch When Duplexing" duplex))                   (const :tag "Switch When Duplexing" duplex))
2652      :version "20"
2653    :group 'ps-print-headers)    :group 'ps-print-headers)
2654    
2655  (defcustom ps-show-n-of-n t  (defcustom ps-show-n-of-n t
# Line 2598  See also `ps-print-header' and `ps-print Line 2657  See also `ps-print-header' and `ps-print
2657  NOTE: page numbers are displayed as part of headers,  NOTE: page numbers are displayed as part of headers,
2658        see variable `ps-print-header'."        see variable `ps-print-header'."
2659    :type 'boolean    :type 'boolean
2660      :version "20"
2661    :group 'ps-print-headers)    :group 'ps-print-headers)
2662    
2663  (defcustom ps-spool-config  (defcustom ps-spool-config
# Line 2633  WARNING: The setpagedevice PostScript op Line 2693  WARNING: The setpagedevice PostScript op
2693                   :tag "Spool Config"                   :tag "Spool Config"
2694                   (const lpr-switches) (const setpagedevice)                   (const lpr-switches) (const setpagedevice)
2695                   (const :tag "nil" nil))                   (const :tag "nil" nil))
2696      :version "20"
2697    :group 'ps-print-headers)    :group 'ps-print-headers)
2698    
2699  (defcustom ps-spool-duplex nil          ; Not many people have duplex printers,  (defcustom ps-spool-duplex nil          ; Not many people have duplex printers,
# Line 2646  even-numbered pages. Line 2707  even-numbered pages.
2707    
2708  See also `ps-spool-tumble'."  See also `ps-spool-tumble'."
2709    :type 'boolean    :type 'boolean
2710      :version "20"
2711    :group 'ps-print-headers)    :group 'ps-print-headers)
2712    
2713  (defcustom ps-spool-tumble nil  (defcustom ps-spool-tumble nil
# Line 2656  binding at the top or bottom. Line 2718  binding at the top or bottom.
2718    
2719  It has effect only when `ps-spool-duplex' is non-nil."  It has effect only when `ps-spool-duplex' is non-nil."
2720    :type 'boolean    :type 'boolean
2721      :version "20"
2722    :group 'ps-print-headers)    :group 'ps-print-headers)
2723    
2724  ;;; Fonts  ;;; Fonts
# Line 2806  uses the fonts resident in your printer. Line 2869  uses the fonts resident in your printer.
2869                  (cons :format "%v"                  (cons :format "%v"
2870                        (const :format "" avg-char-width)                        (const :format "" avg-char-width)
2871                        (number :tag "Average Character Width"))))                        (number :tag "Average Character Width"))))
2872      :version "20"
2873    :group 'ps-print-font)    :group 'ps-print-font)
2874    
2875  (defcustom ps-font-family 'Courier  (defcustom ps-font-family 'Courier
2876    "*Font family name for ordinary text, when generating PostScript."    "*Font family name for ordinary text, when generating PostScript."
2877    :type 'symbol    :type 'symbol
2878      :version "20"
2879    :group 'ps-print-font)    :group 'ps-print-font)
2880    
2881  (defcustom ps-font-size   '(7 . 8.5)  (defcustom ps-font-size   '(7 . 8.5)
# Line 2821  uses the fonts resident in your printer. Line 2886  uses the fonts resident in your printer.
2886                   (cons :tag "Landscape/Portrait"                   (cons :tag "Landscape/Portrait"
2887                         (number :tag "Landscape Text Size")                         (number :tag "Landscape Text Size")
2888                         (number :tag "Portrait Text Size")))                         (number :tag "Portrait Text Size")))
2889      :version "20"
2890    :group 'ps-print-font)    :group 'ps-print-font)
2891    
2892  (defcustom ps-header-font-family      'Helvetica  (defcustom ps-header-font-family      'Helvetica
2893    "*Font family name for text in the header, when generating PostScript."    "*Font family name for text in the header, when generating PostScript."
2894    :type 'symbol    :type 'symbol
2895      :version "20"
2896    :group 'ps-print-font)    :group 'ps-print-font)
2897    
2898  (defcustom ps-header-font-size       '(10 . 12)  (defcustom ps-header-font-size       '(10 . 12)
# Line 2836  uses the fonts resident in your printer. Line 2903  uses the fonts resident in your printer.
2903                   (cons :tag "Landscape/Portrait"                   (cons :tag "Landscape/Portrait"
2904                         (number :tag "Landscape Header Size")                         (number :tag "Landscape Header Size")
2905                         (number :tag "Portrait Header Size")))                         (number :tag "Portrait Header Size")))
2906      :version "20"
2907    :group 'ps-print-font)    :group 'ps-print-font)
2908    
2909  (defcustom ps-header-title-font-size '(12 . 14)  (defcustom ps-header-title-font-size '(12 . 14)
# Line 2846  uses the fonts resident in your printer. Line 2914  uses the fonts resident in your printer.
2914                   (cons :tag "Landscape/Portrait"                   (cons :tag "Landscape/Portrait"
2915                         (number :tag "Landscape Header Title Size")                         (number :tag "Landscape Header Title Size")
2916                         (number :tag "Portrait Header Title Size")))                         (number :tag "Portrait Header Title Size")))
2917      :version "20"
2918    :group 'ps-print-font)    :group 'ps-print-font)
2919    
2920  (defcustom ps-footer-font-family      'Helvetica  (defcustom ps-footer-font-family      'Helvetica
2921    "*Font family name for text in the footer, when generating PostScript."    "*Font family name for text in the footer, when generating PostScript."
   :version "21.1"  
2922    :type 'symbol    :type 'symbol
2923      :version "21.1"
2924    :group 'ps-print-font)    :group 'ps-print-font)
2925    
2926  (defcustom ps-footer-font-size       '(10 . 12)  (defcustom ps-footer-font-size       '(10 . 12)
2927    "*Font size, in points, for text in the footer, when generating PostScript."    "*Font size, in points, for text in the footer, when generating PostScript."
   :version "21.1"  
2928    :type '(choice :menu-tag "Footer Font Size"    :type '(choice :menu-tag "Footer Font Size"
2929                   :tag "Footer Font Size"                   :tag "Footer Font Size"
2930                   (number :tag "Footer Size")                   (number :tag "Footer Size")
2931                   (cons :tag "Landscape/Portrait"                   (cons :tag "Landscape/Portrait"
2932                         (number :tag "Landscape Footer Size")                         (number :tag "Landscape Footer Size")
2933                         (number :tag "Portrait Footer Size")))                         (number :tag "Portrait Footer Size")))
2934      :version "21.1"
2935    :group 'ps-print-font)    :group 'ps-print-font)
2936    
2937  (defcustom ps-line-number-color      "black"  (defcustom ps-line-number-color      "black"
# Line 2882  uses the fonts resident in your printer. Line 2951  uses the fonts resident in your printer.
2951  (defcustom ps-line-number-font      "Times-Italic"  (defcustom ps-line-number-font      "Times-Italic"
2952    "*Font for line-number, when generating PostScript."    "*Font for line-number, when generating PostScript."
2953    :type 'string    :type 'string
2954      :version "20"
2955    :group 'ps-print-font    :group 'ps-print-font
2956    :group 'ps-print-miscellany)    :group 'ps-print-miscellany)
2957    
# Line 2893  uses the fonts resident in your printer. Line 2963  uses the fonts resident in your printer.
2963                   (cons :tag "Landscape/Portrait"                   (cons :tag "Landscape/Portrait"
2964                         (number :tag "Landscape Font Size")                         (number :tag "Landscape Font Size")
2965                         (number :tag "Portrait Font Size")))                         (number :tag "Portrait Font Size")))
2966      :version "20"
2967    :group 'ps-print-font    :group 'ps-print-font
2968    :group 'ps-print-miscellany)    :group 'ps-print-miscellany)
2969    
# Line 2923  Any other value is treated as t." Line 2994  Any other value is treated as t."
2994                   (const :tag "Do NOT Print Color" nil)                   (const :tag "Do NOT Print Color" nil)
2995                   (const :tag "Print Always Color" t)                   (const :tag "Print Always Color" t)
2996                   (const :tag "Print Black/White Color" black-white))                   (const :tag "Print Black/White Color" black-white))
2997      :version "20"
2998    :group 'ps-print-color)    :group 'ps-print-color)
2999    
3000  (defcustom ps-default-fg '(0.0 0.0 0.0) ; black  (defcustom ps-default-fg '(0.0 0.0 0.0) ; black
# Line 2962  It's used only when `ps-print-color-p' i Line 3034  It's used only when `ps-print-color-p' i
3034                         (number :tag "Red")                         (number :tag "Red")
3035                         (number :tag "Green")                         (number :tag "Green")
3036                         (number :tag "Blue")))                         (number :tag "Blue")))
3037      :version "20"
3038    :group 'ps-print-color)    :group 'ps-print-color)
3039    
3040  (defcustom ps-default-bg '(1.0 1.0 1.0) ; white  (defcustom ps-default-bg '(1.0 1.0 1.0) ; white
# Line 3003  See also `ps-use-face-background'." Line 3076  See also `ps-use-face-background'."
3076                         (number :tag "Red")                         (number :tag "Red")
3077                         (number :tag "Green")                         (number :tag "Green")
3078                         (number :tag "Blue")))                         (number :tag "Blue")))
3079      :version "20"
3080    :group 'ps-print-color)    :group 'ps-print-color)
3081    
3082  (defcustom ps-auto-font-detect t  (defcustom ps-auto-font-detect t
# Line 3010  See also `ps-use-face-background'." Line 3084  See also `ps-use-face-background'."
3084  If nil, we rely solely on the lists `ps-bold-faces', `ps-italic-faces', and  If nil, we rely solely on the lists `ps-bold-faces', `ps-italic-faces', and
3085  `ps-underlined-faces'."  `ps-underlined-faces'."
3086    :type 'boolean    :type 'boolean
3087      :version "20"
3088    :group 'ps-print-font)    :group 'ps-print-font)
3089    
3090  (defcustom ps-black-white-faces  (defcustom ps-black-white-faces
# Line 3049  This variable is used only when `ps-prin Line 3124  This variable is used only when `ps-prin
3124                                  (const shadow)                                  (const shadow)
3125                                  (const box)                                  (const box)
3126                                  (const outline)))))                                  (const outline)))))
3127      :version "20"
3128    :group 'ps-print-face)    :group 'ps-print-face)
3129    
3130  (defcustom ps-bold-faces  (defcustom ps-bold-faces
# Line 3061  This variable is used only when `ps-prin Line 3137  This variable is used only when `ps-prin
3137    "*A list of the \(non-bold\) faces that should be printed in bold font.    "*A list of the \(non-bold\) faces that should be printed in bold font.
3138  This applies to generating PostScript."  This applies to generating PostScript."
3139    :type '(repeat face)    :type '(repeat face)
3140      :version "20"
3141    :group 'ps-print-face)    :group 'ps-print-face)
3142    
3143  (defcustom ps-italic-faces  (defcustom ps-italic-faces
# Line 3073  This applies to generating PostScript." Line 3150  This applies to generating PostScript."
3150    "*A list of the \(non-italic\) faces that should be printed in italic font.    "*A list of the \(non-italic\) faces that should be printed in italic font.
3151  This applies to generating PostScript."  This applies to generating PostScript."
3152    :type '(repeat face)    :type '(repeat face)
3153      :version "20"
3154    :group 'ps-print-face)    :group 'ps-print-face)
3155    
3156  (defcustom ps-underlined-faces  (defcustom ps-underlined-faces
# Line 3083  This applies to generating PostScript." Line 3161  This applies to generating PostScript."
3161    "*A list of the \(non-underlined\) faces that should be printed underlined.    "*A list of the \(non-underlined\) faces that should be printed underlined.
3162  This applies to generating PostScript."  This applies to generating PostScript."
3163    :type '(repeat face)    :type '(repeat face)
3164      :version "20"
3165    :group 'ps-print-face)    :group 'ps-print-face)
3166    
3167  (defcustom ps-use-face-background nil  (defcustom ps-use-face-background nil
# Line 3102  Any other value will be treated as t." Line 3181  Any other value will be treated as t."
3181                   (repeat :menu-tag "Face Background List"                   (repeat :menu-tag "Face Background List"
3182                           :tag "Face Background List"                           :tag "Face Background List"
3183                           face))                           face))
3184      :version "20"
3185    :group 'ps-print-face)    :group 'ps-print-face)
3186    
3187  (defcustom ps-left-header  (defcustom ps-left-header
# Line 3125  If symbols are unbounded, they are silen Line 3205  If symbols are unbounded, they are silen
3205    :type '(repeat (choice :menu-tag "Left Header"    :type '(repeat (choice :menu-tag "Left Header"
3206                           :tag "Left Header"                           :tag "Left Header"
3207                           string symbol))                           string symbol))
3208      :version "20"
3209    :group 'ps-print-headers)    :group 'ps-print-headers)
3210    
3211  (defcustom ps-right-header  (defcustom ps-right-header
# Line 3155  You can also create your own time stamp Line 3236  You can also create your own time stamp
3236    :type '(repeat (choice :menu-tag "Right Header"    :type '(repeat (choice :menu-tag "Right Header"
3237                           :tag "Right Header"                           :tag "Right Header"
3238                           string symbol))                           string symbol))
3239      :version "20"
3240    :group 'ps-print-headers)    :group 'ps-print-headers)
3241    
3242  (defcustom ps-left-footer  (defcustom ps-left-footer
# Line 3175  should be a string to be inserted into t Line 3257  should be a string to be inserted into t
3257  variable, the string value has PostScript string delimiters added to it.  variable, the string value has PostScript string delimiters added to it.
3258    
3259  If symbols are unbounded, they are silently ignored."  If symbols are unbounded, they are silently ignored."
   :version "21.1"  
3260    :type '(repeat (choice :menu-tag "Left Footer"    :type '(repeat (choice :menu-tag "Left Footer"
3261                           :tag "Left Footer"                           :tag "Left Footer"
3262                           string symbol))                           string symbol))
3263      :version "21.1"
3264    :group 'ps-print-headers)    :group 'ps-print-headers)
3265    
3266  (defcustom ps-right-footer  (defcustom ps-right-footer
# Line 3206  There are the following basic functions Line 3288  There are the following basic functions
3288    
3289  You can also create your own time stamp function by using `format-time-string'  You can also create your own time stamp function by using `format-time-string'
3290  \(which see)."  \(which see)."
   :version "21.1"  
3291    :type '(repeat (choice :menu-tag "Right Footer"    :type '(repeat (choice :menu-tag "Right Footer"
3292                           :tag "Right Footer"                           :tag "Right Footer"
3293                           string symbol))                           string symbol))
3294      :version "21.1"
3295    :group 'ps-print-headers)    :group 'ps-print-headers)
3296    
3297  (defcustom ps-razzle-dazzle t  (defcustom ps-razzle-dazzle t
3298    "*Non-nil means report progress while formatting buffer."    "*Non-nil means report progress while formatting buffer."
3299    :type 'boolean    :type 'boolean
3300      :version "20"
3301    :group 'ps-print-miscellany)    :group 'ps-print-miscellany)
3302    
3303  (defcustom ps-adobe-tag "%!PS-Adobe-3.0\n"  (defcustom ps-adobe-tag "%!PS-Adobe-3.0\n"
# Line 3222  You can also create your own time stamp Line 3305  You can also create your own time stamp
3305  By default, `ps-adobe-tag' contains the standard identifier.  Some printers  By default, `ps-adobe-tag' contains the standard identifier.  Some printers
3306  require slightly different versions of this line."  require slightly different versions of this line."
3307    :type 'string    :type 'string
3308      :version "20"
3309    :group 'ps-print-miscellany)    :group 'ps-print-miscellany)
3310    
3311  (defcustom ps-build-face-reference t  (defcustom ps-build-face-reference t
# Line 3236  You should set this value back to t afte Line 3320  You should set this value back to t afte
3320  face, or create new faces.  Most users shouldn't have to worry about its  face, or create new faces.  Most users shouldn't have to worry about its
3321  setting, though."  setting, though."
3322    :type 'boolean    :type 'boolean
3323      :version "20"
3324    :group 'ps-print-face)    :group 'ps-print-face)
3325    
3326  (defcustom ps-always-build-face-reference nil  (defcustom ps-always-build-face-reference nil
# Line 3245  If this variable is non-nil, ps-print wi Line 3330  If this variable is non-nil, ps-print wi
3330  of bold and italic faces *every* time one of the ...-with-faces commands is  of bold and italic faces *every* time one of the ...-with-faces commands is
3331  called.  Most users shouldn't need to set this variable."  called.  Most users shouldn't need to set this variable."
3332    :type 'boolean    :type 'boolean
3333      :version "20"
3334    :group 'ps-print-face)    :group 'ps-print-face)
3335    
3336  (defcustom ps-banner-page-when-duplexing nil  (defcustom ps-banner-page-when-duplexing nil
3337    "*Non-nil means the very first page is skipped.    "*Non-nil means the very first page is skipped.
3338  It's like the very first character of buffer (or region) is ^L (\\014)."  It's like the very first character of buffer (or region) is ^L (\\014)."
3339    :type 'boolean    :type 'boolean
3340      :version "20"
3341    :group 'ps-print-headers)    :group 'ps-print-headers)
3342    
3343  (defcustom ps-postscript-code-directory  (defcustom ps-postscript-code-directory
3344    (or (cond    (or (if (featurep 'xemacs)
3345         ((eq ps-print-emacs-type 'emacs) ; emacs            (cond ((fboundp 'locate-data-directory) ; xemacs
3346          data-directory)                   (locate-data-directory "ps-print"))
3347         ((fboundp 'locate-data-directory) ; xemacs                  ((boundp 'data-directory) ; xemacs
3348          (locate-data-directory "ps-print"))                   data-directory)
3349         ((boundp 'data-directory)        ; xemacs                  (t                      ; don't know what to do
3350          data-directory)                   nil))
3351         (t                               ; don't know what to do          data-directory)                 ; emacs
         nil))  
3352        (error "`ps-postscript-code-directory' isn't set properly"))        (error "`ps-postscript-code-directory' isn't set properly"))
3353    "*Directory where it's located the PostScript prologue file used by ps-print.    "*Directory where it's located the PostScript prologue file used by ps-print.
3354  By default, this directory is the same as in the variable `data-directory'."  By default, this directory is the same as in the variable `data-directory'."
3355    :type 'directory    :type 'directory
3356      :version "20"
3357    :group 'ps-print-miscellany)    :group 'ps-print-miscellany)
3358    
3359  (defcustom ps-line-spacing 0  (defcustom ps-line-spacing 0
# Line 3749  It can be retrieved with `(ps-get ALIST- Line 3836  It can be retrieved with `(ps-get ALIST-
3836    (format-time-string "%T"))    (format-time-string "%T"))
3837    
3838    
3839  (eval-and-compile  (and (featurep 'xemacs)
3840    (and (eq ps-print-emacs-type 'xemacs)       ;; XEmacs change: Need to check for emacs-major-version too.
3841         ;; XEmacs change: Need to check for emacs-major-version too.       (or (< emacs-major-version 19)
3842         (or (< emacs-major-version 19)           (and (= emacs-major-version 19) (< emacs-minor-version 12)))
3843             (and (= emacs-major-version 19) (< emacs-minor-version 12)))       (setq ps-print-color-p nil))
3844         (setq ps-print-color-p nil))  
3845    
3846    ;; Return t if the device (which can be changed during an emacs session)
3847    ;; Return t if the device (which can be changed during an emacs session)  ;; can handle colors.
3848    ;; can handle colors.  ;; This function is not yet implemented for GNU emacs.
3849    ;; This function is not yet implemented for GNU emacs.  (cond ((and (featurep 'xemacs)
3850    (cond ((and (eq ps-print-emacs-type 'xemacs)              ;; XEmacs change: Need to check for emacs-major-version too.
3851                ;; XEmacs change: Need to check for emacs-major-version too.              (or (> emacs-major-version 19)
3852                (or (> emacs-major-version 19)                  (and (= emacs-major-version 19)
3853                    (and (= emacs-major-version 19)                       (>= emacs-minor-version 12)))) ; xemacs >= 19.12
3854                         (>= emacs-minor-version 12)))) ; xemacs >= 19.12         (defun ps-color-device ()
3855           (defun ps-color-device ()           (eq (ps-x-device-class) 'color)))
3856             (eq (ps-x-device-class) 'color)))  
3857          (t                                ; emacs
3858          (t                              ; emacs         (defun ps-color-device ()
3859           (defun ps-color-device ()           (if (fboundp 'color-values)
3860             (if (fboundp 'color-values)               (ps-e-color-values "Green")
3861                 (ps-e-color-values "Green")             t))))
3862               t))))  
3863    
3864    (defun ps-mapper (extent list)
3865    (defun ps-mapper (extent list)    (nconc list
3866      (nconc list           (list (list (ps-x-extent-start-position extent) 'push extent)
3867             (list (list (ps-x-extent-start-position extent) 'push extent)                 (list (ps-x-extent-end-position extent) 'pull extent)))
3868                   (list (ps-x-extent-end-position extent) 'pull extent)))    nil)
3869      nil)  
3870    (defun ps-extent-sorter (a b)
3871    (defun ps-extent-sorter (a b)    (< (ps-x-extent-priority a) (ps-x-extent-priority b)))
3872      (< (ps-x-extent-priority a) (ps-x-extent-priority b)))  
3873    (defun ps-xemacs-face-kind-p (face kind kind-regex)
3874    (defun ps-xemacs-face-kind-p (face kind kind-regex)    (let* ((frame-font (or (ps-x-face-font-instance face)
3875      (let* ((frame-font (or (ps-x-face-font-instance face)                           (ps-x-face-font-instance 'default)))
3876                             (ps-x-face-font-instance 'default)))           (kind-cons
3877             (kind-cons            (and frame-font
3878              (and frame-font                 (assq kind
3879                   (assq kind                       (ps-x-font-instance-properties frame-font))))
3880                         (ps-x-font-instance-properties frame-font))))           (kind-spec (cdr-safe kind-cons))
3881             (kind-spec (cdr-safe kind-cons))           (case-fold-search t))
3882             (case-fold-search t))      (and kind-spec (string-match kind-regex kind-spec))))
3883        (and kind-spec (string-match kind-regex kind-spec))))  
3884    (cond ((featurep 'xemacs)               ; xemacs
3885    (cond ((eq ps-print-emacs-type 'emacs) ; emacs  
3886           ;; to avoid XEmacs compilation gripes
3887           (defvar coding-system-for-write   nil)
3888           (defvar coding-system-for-read    nil)
3889           (defvar buffer-file-coding-system nil)
3890    
3891           (and (fboundp 'find-coding-system)
3892                (or (ps-x-find-coding-system 'raw-text-unix)
3893                    (ps-x-copy-coding-system 'no-conversion-unix 'raw-text-unix)))
3894    
3895           (defun ps-color-values (x-color)         (defun ps-color-values (x-color)
3896             (let ((color (ps-xemacs-color-name x-color)))
3897             (cond             (cond
             ((fboundp 'color-values)  
              (ps-e-color-values x-color))  
3898              ((fboundp 'x-color-values)              ((fboundp 'x-color-values)
3899               (ps-e-x-color-values x-color))               (ps-e-x-color-values color))
3900                ((and (fboundp 'color-instance-rgb-components)
3901                      (ps-color-device))
3902                 (ps-x-color-instance-rgb-components
3903                  (if (ps-x-color-instance-p x-color)
3904                      x-color
3905                    (ps-x-make-color-instance color))))
3906              (t              (t
3907               (error "No available function to determine X color values"))))               (error "No available function to determine X color values")))))
3908    
3909           (defun ps-face-bold-p (face)         (defun ps-face-bold-p (face)
3910             (or (ps-e-face-bold-p face)           (or (ps-xemacs-face-kind-p face 'WEIGHT_NAME "bold\\|demibold")
3911                 (memq face ps-bold-faces)))               (memq face ps-bold-faces))) ; Kludge-compatible
3912    
3913           (defun ps-face-italic-p (face)         (defun ps-face-italic-p (face)
3914             (or (ps-e-face-italic-p face)           (or (ps-xemacs-face-kind-p face 'ANGLE_NAME "i\\|o")
3915                 (memq face ps-italic-faces)))               (ps-xemacs-face-kind-p face 'SLANT "i\\|o")
3916           )               (memq face ps-italic-faces))) ; Kludge-compatible
3917           )
3918          (t                              ; xemacs  
3919          (t                                ; emacs
3920    
3921           (defun ps-color-values (x-color)
3922             (cond
3923              ((fboundp 'color-values)
3924               (ps-e-color-values x-color))
3925              ((fboundp 'x-color-values)
3926               (ps-e-x-color-values x-color))
3927              (t
3928               (error "No available function to determine X color values"))))
3929    
3930           ;; to avoid XEmacs compilation gripes         (defun ps-face-bold-p (face)
3931           (defvar coding-system-for-write   nil)           (or (ps-e-face-bold-p face)
3932           (defvar coding-system-for-read    nil)               (memq face ps-bold-faces)))
3933           (defvar buffer-file-coding-system nil)  
3934           (defun ps-face-italic-p (face)
3935           (and (fboundp 'find-coding-system)           (or (ps-e-face-italic-p face)
3936                (or (ps-x-find-coding-system 'raw-text-unix)               (memq face ps-italic-faces)))
3937                    (ps-x-copy-coding-system 'no-conversion-unix 'raw-text-unix)))         ))
   
          (defun ps-color-values (x-color)  
            (let ((color (ps-xemacs-color-name x-color)))  
              (cond  
               ((fboundp 'x-color-values)  
                (ps-e-x-color-values color))  
               ((and (fboundp 'color-instance-rgb-components)  
                     (ps-color-device))  
                (ps-x-color-instance-rgb-components  
                 (if (ps-x-color-instance-p x-color)  
                     x-color  
                   (ps-x-make-color-instance color))))  
               (t  
                (error "No available function to determine X color values")))))  
   
          (defun ps-face-bold-p (face)  
            (or (ps-xemacs-face-kind-p face 'WEIGHT_NAME "bold\\|demibold")  
                (memq face ps-bold-faces))) ; Kludge-compatible  
   
          (defun ps-face-italic-p (face)  
            (or (ps-xemacs-face-kind-p face 'ANGLE_NAME "i\\|o")  
                (ps-xemacs-face-kind-p face 'SLANT "i\\|o")  
                (memq face ps-italic-faces))) ; Kludge-compatible  
          )))  
3938    
3939    
3940  (defvar ps-print-color-scale 1.0)  (defvar ps-print-color-scale 1.0)
# Line 3931  Note: No major/minor-mode is activated a Line 4017  Note: No major/minor-mode is activated a
4017    
4018  (defvar ps-color-p nil)  (defvar ps-color-p nil)
4019  (defvar ps-color-format  (defvar ps-color-format
4020    (if (eq ps-print-emacs-type 'emacs)    (if (featurep 'xemacs)
4021          ;; XEmacs will have to make do with %s (princ) for floats.
4022        ;; Emacs understands the %f format; we'll use it to limit color RGB        "%s %s %s"
4023        ;; values to three decimals to cut down some on the size of the  
4024        ;; PostScript output.      ;; Emacs understands the %f format; we'll use it to limit color RGB
4025        "%0.3f %0.3f %0.3f"      ;; values to three decimals to cut down some on the size of the
4026        ;; PostScript output.
4027      ;; XEmacs will have to make do with %s (princ) for floats.      "%0.3f %0.3f %0.3f"))
     "%s %s %s"))  
4028    
4029  ;; These values determine how much print-height to deduct when headers/footers  ;; These values determine how much print-height to deduct when headers/footers
4030  ;; are turned on.  This is a pretty clumsy way of handling it, but it'll do for  ;; are turned on.  This is a pretty clumsy way of handling it, but it'll do for
# Line 4723  page-height == ((floor print-height ((th Line 4808  page-height == ((floor print-height ((th
4808    (save-excursion    (save-excursion
4809      (set-buffer ps-spool-buffer)      (set-buffer ps-spool-buffer)
4810      (goto-char (point-max))      (goto-char (point-max))
4811      (insert-file fname)))      (insert-file-contents fname)))
4812    
4813  ;; These functions are used in `ps-mule' to get charset of header and footer.  ;; These functions are used in `ps-mule' to get charset of header and footer.
4814  ;; To avoid unnecessary calls to functions in `ps-left-header',  ;; To avoid unnecessary calls to functions in `ps-left-header',
# Line 4855  page-height == ((floor print-height ((th Line 4940  page-height == ((floor print-height ((th
4940  ;; to three decimals to cut down some on the size of the PostScript output.  ;; to three decimals to cut down some on the size of the PostScript output.
4941  ;; XEmacs will have to make do with %s (princ) for floats.  ;; XEmacs will have to make do with %s (princ) for floats.
4942    
4943  (defvar ps-float-format (if (eq ps-print-emacs-type 'emacs)  (defvar ps-float-format (if (featurep 'xemacs)
4944                              "%0.3f "    ; emacs                              "%s "       ; xemacs
4945                            "%s "))       ; xemacs                            "%0.3f "))    ; emacs
4946    
4947    
4948  (defun ps-float-format (value &optional default)  (defun ps-float-format (value &optional default)
# Line 6360  If FACE is not a valid face name, it is Line 6445  If FACE is not a valid face name, it is
6445    
6446    
6447  ;; to avoid compilation gripes  ;; to avoid compilation gripes
6448    (defalias 'ps-jitify 'jit-lock-fontify-now)
6449    (defalias 'ps-lazify 'lazy-lock-fontify-region)
6450    
6451    
6452    ;; to avoid compilation gripes
6453  (defun ps-print-ensure-fontified (start end)  (defun ps-print-ensure-fontified (start end)
6454    (cond    (cond ((and (boundp 'jit-lock-mode) (symbol-value 'jit-lock-mode))
6455     ((and (boundp 'jit-lock-mode) (symbol-value 'jit-lock-mode))           (ps-jitify start end))
6456      (defalias 'ps-jitify 'jit-lock-fontify-now) ; avoid compilation gripes          ((and (boundp 'lazy-lock-mode) (symbol-value 'lazy-lock-mode))
6457      (ps-jitify start end))           (ps-lazify start end))))
    ((and (boundp 'lazy-lock-mode) (symbol-value 'lazy-lock-mode))  
     (defalias 'ps-lazify 'lazy-lock-fontify-region) ; avoid compilation gripes  
     (ps-lazify start end))))  
6458    
6459    
6460  (defun ps-generate-postscript-with-faces (from to)  (defun ps-generate-postscript-with-faces (from to)
# Line 6393  If FACE is not a valid face name, it is Line 6480  If FACE is not a valid face name, it is
6480      (let ((face 'default)      (let ((face 'default)
6481            (position to))            (position to))
6482        (cond        (cond
6483         ((eq ps-print-emacs-type 'xemacs)         ((featurep 'xemacs)              ; xemacs
6484          ;; Build the list of extents...          ;; Build the list of extents...
6485          (let ((a (cons 'dummy nil))          (let ((a (cons 'dummy nil))
6486                record type extent extent-list)                record type extent extent-list)
# Line 6437  If FACE is not a valid face name, it is Line 6524  If FACE is not a valid face name, it is
6524                    from position                    from position
6525                    a (cdr a)))))                    a (cdr a)))))
6526    
6527         ((eq ps-print-emacs-type 'emacs)         (t                               ; emacs
6528          (let ((property-change from)          (let ((property-change from)
6529                (overlay-change from)                (overlay-change from)
6530                (save-buffer-invisibility-spec buffer-invisibility-spec)                (save-buffer-invisibility-spec buffer-invisibility-spec)
# Line 6714  If FACE is not a valid face name, it is Line 6801  If FACE is not a valid face name, it is
6801  ;; Don't use it unless you understand what it does!  ;; Don't use it unless you understand what it does!
6802    
6803  (defmacro ps-prsc ()  (defmacro ps-prsc ()
6804    `(if (eq ps-print-emacs-type 'emacs) [f22] 'f22))    `(if (featurep 'xemacs) 'f22           [f22]))
6805  (defmacro ps-c-prsc ()  (defmacro ps-c-prsc ()
6806    `(if (eq ps-print-emacs-type 'emacs) [C-f22] '(control f22)))    `(if (featurep 'xemacs) '(control f22) [C-f22]))
6807  (defmacro ps-s-prsc ()  (defmacro ps-s-prsc ()
6808    `(if (eq ps-print-emacs-type 'emacs) [S-f22] '(shift f22)))    `(if (featurep 'xemacs) '(shift f22)   [S-f22]))
6809    
6810  ;; A hook to bind to `rmail-mode-hook' to locally bind prsc and set the  ;; A hook to bind to `rmail-mode-hook' to locally bind prsc and set the
6811  ;; `ps-left-headers' specially for mail messages.  ;; `ps-left-headers' specially for mail messages.

Legend:
Removed from v.1.149  
changed lines
  Added in v.1.150

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