aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman1997-04-12 01:50:50 +0000
committerRichard M. Stallman1997-04-12 01:50:50 +0000
commite0af0d3ef44362af78b2a3f0fa86c07a80c2edaf (patch)
treeedd4e46947a100447d81ff06dc406a8ce976472e /lisp
parente98227af46feb11e1cb05137e1c7fad74210d1e9 (diff)
downloademacs-e0af0d3ef44362af78b2a3f0fa86c07a80c2edaf.tar.gz
emacs-e0af0d3ef44362af78b2a3f0fa86c07a80c2edaf.zip
Add defgroup's; change use defcustom for user vars.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ps-print.el300
1 files changed, 216 insertions, 84 deletions
diff --git a/lisp/ps-print.el b/lisp/ps-print.el
index 0fba0aa75fc..62faf44318d 100644
--- a/lisp/ps-print.el
+++ b/lisp/ps-print.el
@@ -618,11 +618,58 @@ Please send all bug fixes and enhancements to
618 618
619;;; Interface to the command system 619;;; Interface to the command system
620 620
621(defvar ps-lpr-command lpr-command 621(defgroup ps-print nil
622 "*The shell command for printing a PostScript file.") 622 "Postscript generator for Emacs 19"
623 623 :prefix "ps-"
624(defvar ps-lpr-switches lpr-switches 624 :group 'wp)
625 "*A list of extra switches to pass to `ps-lpr-command'.") 625
626(defgroup ps-print-horizontal nil
627 "Horizontal page layout"
628 :prefix "ps-"
629 :tag "Horizontal"
630 :group 'ps-print)
631
632(defgroup ps-print-vertical nil
633 "Vertical page layout"
634 :prefix "ps-"
635 :tag "Vertical"
636 :group 'ps-print)
637
638(defgroup ps-print-header nil
639 "Headers layout"
640 :prefix "ps-"
641 :tag "Header"
642 :group 'ps-print)
643
644(defgroup ps-print-font nil
645 "Fonts customization"
646 :prefix "ps-"
647 :tag "Font"
648 :group 'ps-print)
649
650(defgroup ps-print-color nil
651 "Color customization"
652 :prefix "ps-"
653 :tag "Color"
654 :group 'ps-print)
655
656(defgroup ps-print-face nil
657 "Faces customization"
658 :prefix "ps-"
659 :tag "PS Faces"
660 :group 'ps-print
661 :group 'faces)
662
663
664(defcustom ps-lpr-command lpr-command
665 "*The shell command for printing a PostScript file."
666 :type 'string
667 :group 'ps-print)
668
669(defcustom ps-lpr-switches lpr-switches
670 "*A list of extra switches to pass to `ps-lpr-command'."
671 :type '(repeat string)
672 :group 'ps-print)
626 673
627;;; Page layout 674;;; Page layout
628 675
@@ -644,7 +691,7 @@ Please send all bug fixes and enhancements to
644;; B4 10.125 inch x 14.33 inch 691;; B4 10.125 inch x 14.33 inch
645;; B5 7.16 inch x 10.125 inch 692;; B5 7.16 inch x 10.125 inch
646 693
647(defvar ps-page-dimensions-database 694(defcustom ps-page-dimensions-database
648 (list (list 'a4 (/ (* 72 21.0) 2.54) (/ (* 72 29.7) 2.54)) 695 (list (list 'a4 (/ (* 72 21.0) 2.54) (/ (* 72 29.7) 2.54))
649 (list 'a3 (/ (* 72 29.7) 2.54) (/ (* 72 42.0) 2.54)) 696 (list 'a3 (/ (* 72 29.7) 2.54) (/ (* 72 42.0) 2.54))
650 (list 'letter (* 72 8.5) (* 72 11.0)) 697 (list 'letter (* 72 8.5) (* 72 11.0))
@@ -658,18 +705,33 @@ Please send all bug fixes and enhancements to
658 (list 'b4 (* 72 10.125) (* 72 14.33)) 705 (list 'b4 (* 72 10.125) (* 72 14.33))
659 (list 'b5 (* 72 7.16) (* 72 10.125))) 706 (list 'b5 (* 72 7.16) (* 72 10.125)))
660 "*List associating a symbolic paper type to its width and height. 707 "*List associating a symbolic paper type to its width and height.
661see `ps-paper-type'.") 708see `ps-paper-type'."
662 709 :type '(repeat (list :tag "Paper Type"
663(defvar ps-paper-type 'letter 710 (symbol :tag "Name")
711 (number :tag "Width")
712 (number :tag "Height")))
713 :group 'ps-print)
714
715(defcustom ps-paper-type 'letter
664 "*Specifies the size of paper to format for. 716 "*Specifies the size of paper to format for.
665Should be one of the paper types defined in `ps-page-dimensions-database', for 717Should be one of the paper types defined in `ps-page-dimensions-database', for
666example `letter', `legal' or `a4'.") 718example `letter', `legal' or `a4'."
667 719 :type '(symbol :validate (lambda (wid)
668(defvar ps-landscape-mode 'nil 720 (if (assq (widget-value wid) ps-page-dimensions-database)
669 "*Non-nil means print in landscape mode.") 721 nil
670 722 (widget-put wid :error "Unknown paper size")
671(defvar ps-number-of-columns (if ps-landscape-mode 2 1) 723 wid)))
672 "*Specifies the number of columns") 724 :group 'ps-print)
725
726(defcustom ps-landscape-mode 'nil
727 "*Non-nil means print in landscape mode."
728 :type 'boolean
729 :group 'ps-print)
730
731(defcustom ps-number-of-columns (if ps-landscape-mode 2 1)
732 "*Specifies the number of columns"
733 :type 'integer
734 :group 'ps-print)
673 735
674;;; Horizontal layout 736;;; Horizontal layout
675 737
@@ -679,14 +741,20 @@ example `letter', `legal' or `a4'.")
679;; | | | | | | | | 741;; | | | | | | | |
680;; ------------------------------------------ 742;; ------------------------------------------
681 743
682(defvar ps-left-margin (/ (* 72 2.0) 2.54) ; 2 cm 744(defcustom ps-left-margin (/ (* 72 2.0) 2.54) ; 2 cm
683 "*Left margin in points (1/72 inch).") 745 "*Left margin in points (1/72 inch)."
746 :type 'number
747 :group 'ps-print-horizontal)
684 748
685(defvar ps-right-margin (/ (* 72 2.0) 2.54) ; 2 cm 749(defcustom ps-right-margin (/ (* 72 2.0) 2.54) ; 2 cm
686 "*Right margin in points (1/72 inch).") 750 "*Right margin in points (1/72 inch)."
751 :type 'number
752 :group 'ps-print-horizontal)
687 753
688(defvar ps-inter-column (/ (* 72 2.0) 2.54) ; 2 cm 754(defcustom ps-inter-column (/ (* 72 2.0) 2.54) ; 2 cm
689 "*Horizontal space between columns in points (1/72 inch).") 755 "*Horizontal space between columns in points (1/72 inch)."
756 :type 'number
757 :group 'ps-print-horizontal)
690 758
691;;; Vertical layout 759;;; Vertical layout
692 760
@@ -702,52 +770,70 @@ example `letter', `legal' or `a4'.")
702;; | bm | 770;; | bm |
703;; |--------| 771;; |--------|
704 772
705(defvar ps-bottom-margin (/ (* 72 1.5) 2.54) ; 1.5 cm 773(defcustom ps-bottom-margin (/ (* 72 1.5) 2.54) ; 1.5 cm
706 "*Bottom margin in points (1/72 inch).") 774 "*Bottom margin in points (1/72 inch)."
775 :type 'number
776 :group 'ps-print-vertical)
707 777
708(defvar ps-top-margin (/ (* 72 1.5) 2.54) ; 1.5 cm 778(defcustom ps-top-margin (/ (* 72 1.5) 2.54) ; 1.5 cm
709 "*Top margin in points (1/72 inch).") 779 "*Top margin in points (1/72 inch)."
780 :type 'number
781 :group 'ps-print-vertical)
710 782
711(defvar ps-header-offset (/ (* 72 1.0) 2.54) ; 1.0 cm 783(defcustom ps-header-offset (/ (* 72 1.0) 2.54) ; 1.0 cm
712 "*Vertical space in points (1/72 inch) between the main text and the header.") 784 "*Vertical space in points (1/72 inch) between the main text and the header."
785 :type 'number
786 :group 'ps-print-vertical)
713 787
714(defvar ps-header-line-pad 0.15 788(defcustom ps-header-line-pad 0.15
715 "*Portion of a header title line height to insert between the header frame 789 "*Portion of a header title line height to insert between the header frame
716and the text it contains, both in the vertical and horizontal directions.") 790and the text it contains, both in the vertical and horizontal directions."
791 :type 'number
792 :group 'ps-print-vertical)
717 793
718;;; Header setup 794;;; Header setup
719 795
720(defvar ps-print-header t 796(defcustom ps-print-header t
721 "*Non-nil means print a header at the top of each page. 797 "*Non-nil means print a header at the top of each page.
722By default, the header displays the buffer name, page number, and, if 798By default, the header displays the buffer name, page number, and, if
723the buffer is visiting a file, the file's directory. Headers are 799the buffer is visiting a file, the file's directory. Headers are
724customizable by changing variables `ps-left-header' and 800customizable by changing variables `ps-left-header' and
725`ps-right-header'.") 801`ps-right-header'."
726 802 :type 'boolean
727(defvar ps-print-header-frame t 803 :group 'ps-print-header)
728 "*Non-nil means draw a gaudy frame around the header.") 804
729 805(defcustom ps-print-header-frame t
730(defvar ps-header-lines 2 806 "*Non-nil means draw a gaudy frame around the header."
731 "*Number of lines to display in page header, when generating Postscript.") 807 :type 'boolean
808 :group 'ps-print-header)
809
810(defcustom ps-header-lines 2
811 "*Number of lines to display in page header, when generating Postscript."
812 :type 'integer
813 :group 'ps-print-header)
732(make-variable-buffer-local 'ps-header-lines) 814(make-variable-buffer-local 'ps-header-lines)
733 815
734(defvar ps-show-n-of-n t 816(defcustom ps-show-n-of-n t
735 "*Non-nil means show page numbers as N/M, meaning page N of M. 817 "*Non-nil means show page numbers as N/M, meaning page N of M.
736Note: page numbers are displayed as part of headers, see variable 818Note: page numbers are displayed as part of headers, see variable
737`ps-print-headers'.") 819`ps-print-headers'."
820 :type 'boolean
821 :group 'ps-print-header)
738 822
739(defvar ps-spool-duplex nil ; Not many people have duplex 823(defcustom ps-spool-duplex nil ; Not many people have duplex
740 ; printers, so default to nil. 824 ; printers, so default to nil.
741 "*Non-nil indicates spooling is for a two-sided printer. 825 "*Non-nil indicates spooling is for a two-sided printer.
742For a duplex printer, the `ps-spool-*' commands will insert blank pages 826For a duplex printer, the `ps-spool-*' commands will insert blank pages
743as needed between print jobs so that the next buffer printed will 827as needed between print jobs so that the next buffer printed will
744start on the right page. Also, if headers are turned on, the headers 828start on the right page. Also, if headers are turned on, the headers
745will be reversed on duplex printers so that the page numbers fall to 829will be reversed on duplex printers so that the page numbers fall to
746the left on even-numbered pages.") 830the left on even-numbered pages."
831 :type 'boolean
832 :group 'ps-print-header)
747 833
748;;; Fonts 834;;; Fonts
749 835
750(defvar ps-font-info-database 836(defcustom ps-font-info-database
751 '((Courier ; the family key 837 '((Courier ; the family key
752 "Courier" "Courier-Bold" "Courier-Oblique" "Courier-BoldOblique" 838 "Courier" "Courier-Bold" "Courier-Oblique" "Courier-BoldOblique"
753 10.0 10.55 6.0 6.0) 839 10.0 10.55 6.0 6.0)
@@ -808,43 +894,73 @@ To get the info for another specific font (say Helvetica), do the following:
808 to get the line 894 to get the line
809 `3 cm 20 cm moveto 10 /Helvetica ReportFontInfo showpage' 895 `3 cm 20 cm moveto 10 /Helvetica ReportFontInfo showpage'
810- add the values to `ps-font-info-database'. 896- add the values to `ps-font-info-database'.
811You can get all the fonts of YOUR printer using `ReportAllFontInfo'.") 897You can get all the fonts of YOUR printer using `ReportAllFontInfo'."
812 898 :type '(repeat (list :tag "Font Definition"
813(defvar ps-font-family 'Courier 899 (symbol :tag "Font")
814 "Font family name for ordinary text, when generating Postscript.") 900 (string :tag "Name")
815 901 (string :tag "Bold")
816(defvar ps-font-size (if ps-landscape-mode 7 8.5) 902 (string :tag "Italic")
817 "Font size, in points, for ordinary text, when generating Postscript.") 903 (string :tag "Bold-Italic")
818 904 (number :tag "Reference Size")
819(defvar ps-header-font-family 'Helvetica 905 (number :tag "Line Height")
820 "Font family name for text in the header, when generating Postscript.") 906 (number :tag "Space Width")
821 907 (number :tag "Average Character Width")))
822(defvar ps-header-font-size (if ps-landscape-mode 10 12) 908 :group 'ps-print-font)
823 "Font size, in points, for text in the header, when generating Postscript.") 909
824 910(defcustom ps-font-family 'Courier
825(defvar ps-header-title-font-size (if ps-landscape-mode 12 14) 911 "Font family name for ordinary text, when generating Postscript."
912 :type 'symbol
913 :group 'ps-print-font)
914
915(defcustom ps-font-size (if ps-landscape-mode 7 8.5)
916 "Font size, in points, for ordinary text, when generating Postscript."
917 :type 'number
918 :group 'ps-print-font)
919
920(defcustom ps-header-font-family 'Helvetica
921 "Font family name for text in the header, when generating Postscript."
922 :type 'symbol
923 :group 'ps-print-font)
924
925(defcustom ps-header-font-size (if ps-landscape-mode 10 12)
926 "Font size, in points, for text in the header, when generating Postscript."
927 :type 'number
928 :group 'ps-print-font)
929
930(defcustom ps-header-title-font-size (if ps-landscape-mode 12 14)
826 "Font size, in points, for the top line of text in the header, 931 "Font size, in points, for the top line of text in the header,
827when generating Postscript.") 932when generating Postscript."
933 :type 'number
934 :group 'ps-print-font)
828 935
829;;; Colors 936;;; Colors
830 937
831(defvar ps-print-color-p (or (fboundp 'x-color-values) ; Emacs 938(defcustom ps-print-color-p (or (fboundp 'x-color-values) ; Emacs
832 (fboundp 'pixel-components)) ; XEmacs 939 (fboundp 'pixel-components) ; XEmacs
940 ; xemacs
833; Printing color requires x-color-values. 941; Printing color requires x-color-values.
834 "*If non-nil, print the buffer's text in color.") 942 "*If non-nil, print the buffer's text in color."
943 :type 'boolean
944 :group 'ps-print-color)
835 945
836(defvar ps-default-fg '(0.0 0.0 0.0) 946(defcustom ps-default-fg '(0.0 0.0 0.0)
837 "*RGB values of the default foreground color. Defaults to black.") 947 "*RGB values of the default foreground color. Defaults to black."
948 :type '(list (number :tag "Red") (number :tag "Green") (number :tag "Blue"))
949 :group 'ps-print-color)
838 950
839(defvar ps-default-bg '(1.0 1.0 1.0) 951(defcustom ps-default-bg '(1.0 1.0 1.0)
840 "*RGB values of the default background color. Defaults to white.") 952 "*RGB values of the default background color. Defaults to white."
953 :type '(list (number :tag "Red") (number :tag "Green") (number :tag "Blue"))
954 :group 'ps-print-color)
841 955
842(defvar ps-auto-font-detect t 956(defcustom ps-auto-font-detect t
843 "*Non-nil means automatically detect bold/italic face attributes. 957 "*Non-nil means automatically detect bold/italic face attributes.
844nil means rely solely on the lists `ps-bold-faces', `ps-italic-faces', 958nil means rely solely on the lists `ps-bold-faces', `ps-italic-faces',
845and `ps-underlined-faces'.") 959and `ps-underlined-faces'."
960 :type 'boolean
961 :group 'ps-print-font)
846 962
847(defvar ps-bold-faces 963(defcustom ps-bold-faces
848 (unless ps-print-color-p 964 (unless ps-print-color-p
849 '(font-lock-function-name-face 965 '(font-lock-function-name-face
850 font-lock-builtin-face 966 font-lock-builtin-face
@@ -852,27 +968,33 @@ and `ps-underlined-faces'.")
852 font-lock-keyword-face 968 font-lock-keyword-face
853 font-lock-warning-face)) 969 font-lock-warning-face))
854 "*A list of the \(non-bold\) faces that should be printed in bold font. 970 "*A list of the \(non-bold\) faces that should be printed in bold font.
855This applies to generating Postscript.") 971This applies to generating Postscript."
972 :type '(repeat face)
973 :group 'ps-print-face)
856 974
857(defvar ps-italic-faces 975(defcustom ps-italic-faces
858 (unless ps-print-color-p 976 (unless ps-print-color-p
859 '(font-lock-variable-name-face 977 '(font-lock-variable-name-face
860 font-lock-string-face 978 font-lock-string-face
861 font-lock-comment-face 979 font-lock-comment-face
862 font-lock-warning-face)) 980 font-lock-warning-face))
863 "*A list of the \(non-italic\) faces that should be printed in italic font. 981 "*A list of the \(non-italic\) faces that should be printed in italic font.
864This applies to generating Postscript.") 982This applies to generating Postscript."
983 :type '(repeat face)
984 :group 'ps-print-face)
865 985
866(defvar ps-underlined-faces 986(defcustom ps-underlined-faces
867 (unless ps-print-color-p 987 (unless ps-print-color-p
868 '(font-lock-function-name-face 988 '(font-lock-function-name-face
869 font-lock-type-face 989 font-lock-type-face
870 font-lock-reference-face 990 font-lock-reference-face
871 font-lock-warning-face)) 991 font-lock-warning-face))
872 "*A list of the \(non-underlined\) faces that should be printed underlined. 992 "*A list of the \(non-underlined\) faces that should be printed underlined.
873This applies to generating Postscript.") 993This applies to generating Postscript."
994 :type '(repeat face)
995 :group 'ps-print-face)
874 996
875(defvar ps-left-header 997(defcustom ps-left-header
876 (list 'ps-get-buffer-name 'ps-header-dirpart) 998 (list 'ps-get-buffer-name 'ps-header-dirpart)
877 "*The items to display (each on a line) on the left part of the page header. 999 "*The items to display (each on a line) on the left part of the page header.
878This applies to generating Postscript. 1000This applies to generating Postscript.
@@ -888,27 +1010,33 @@ For symbols with bound functions, the function is called and should
888return a string to be inserted into the array. For symbols with bound 1010return a string to be inserted into the array. For symbols with bound
889values, the value should be a string to be inserted into the array. 1011values, the value should be a string to be inserted into the array.
890In either case, function or variable, the string value has PostScript 1012In either case, function or variable, the string value has PostScript
891string delimiters added to it.") 1013string delimiters added to it."
1014 :type '(repeat (choice string symbol))
1015 :group ps-print-header)
892(make-variable-buffer-local 'ps-left-header) 1016(make-variable-buffer-local 'ps-left-header)
893 1017
894(defvar ps-right-header 1018(defcustom ps-right-header
895 (list "/pagenumberstring load" 'time-stamp-mon-dd-yyyy 'time-stamp-hh:mm:ss) 1019 (list "/pagenumberstring load" 'time-stamp-mon-dd-yyyy 'time-stamp-hh:mm:ss)
896 "*The items to display (each on a line) on the right part of the page header. 1020 "*The items to display (each on a line) on the right part of the page header.
897This applies to generating Postscript. 1021This applies to generating Postscript.
898 1022
899See the variable `ps-left-header' for a description of the format of 1023See the variable `ps-left-header' for a description of the format of
900this variable.") 1024this variable."
1025 :type '(repeat (choice string symbol))
1026 :group ps-print-header)
901(make-variable-buffer-local 'ps-right-header) 1027(make-variable-buffer-local 'ps-right-header)
902 1028
903(defvar ps-razzle-dazzle t 1029(defcustom ps-razzle-dazzle t
904 "*Non-nil means report progress while formatting buffer.") 1030 "*Non-nil means report progress while formatting buffer."
1031 :type 'boolean
1032 :group 'ps-print)
905 1033
906(defvar ps-adobe-tag "%!PS-Adobe-1.0\n" 1034(defvar ps-adobe-tag "%!PS-Adobe-1.0\n"
907 "*Contains the header line identifying the output as PostScript. 1035 "*Contains the header line identifying the output as PostScript.
908By default, `ps-adobe-tag' contains the standard identifier. Some 1036By default, `ps-adobe-tag' contains the standard identifier. Some
909printers require slightly different versions of this line.") 1037printers require slightly different versions of this line.")
910 1038
911(defvar ps-build-face-reference t 1039(defcustom ps-build-face-reference t
912 "*Non-nil means build the reference face lists. 1040 "*Non-nil means build the reference face lists.
913 1041
914Ps-print sets this value to nil after it builds its internal reference 1042Ps-print sets this value to nil after it builds its internal reference
@@ -918,15 +1046,19 @@ of the ...-with-faces commands.
918 1046
919You should set this value back to t after you change the attributes of 1047You should set this value back to t after you change the attributes of
920any face, or create new faces. Most users shouldn't have to worry 1048any face, or create new faces. Most users shouldn't have to worry
921about its setting, though.") 1049about its setting, though."
1050 :type 'boolean
1051 :group 'ps-print-face)
922 1052
923(defvar ps-always-build-face-reference nil 1053(defcustom ps-always-build-face-reference nil
924 "*Non-nil means always rebuild the reference face lists. 1054 "*Non-nil means always rebuild the reference face lists.
925 1055
926If this variable is non-nil, ps-print will rebuild its internal 1056If this variable is non-nil, ps-print will rebuild its internal
927reference lists of bold and italic faces *every* time one of the 1057reference lists of bold and italic faces *every* time one of the
928-with-faces commands is called. Most users shouldn't need to set this 1058-with-faces commands is called. Most users shouldn't need to set this
929variable.") 1059variable."
1060 :type 'boolean
1061 :group 'ps-print-face)
930 1062
931;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1063;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
932;; User commands 1064;; User commands