diff options
| author | Richard M. Stallman | 1997-09-11 23:51:29 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-09-11 23:51:29 +0000 |
| commit | 06fb6aabb2290c7f510bdc1f2f6e837e8810f4c9 (patch) | |
| tree | a570881eac832b58e79691f7e2f51d22c35bdd67 | |
| parent | e3799a725391c70e3931b4070db34aa20e3357ec (diff) | |
| download | emacs-06fb6aabb2290c7f510bdc1f2f6e837e8810f4c9.tar.gz emacs-06fb6aabb2290c7f510bdc1f2f6e837e8810f4c9.zip | |
(ps-emacs-face-kind-p): Function deleted.
(ps-face-bold-p, ps-face-italic-p):
Check ps-bold-faces or ps-italic-faces.
(ps-zebra-stripes, ps-zebra-stripe-height): Doc fixes.
(ps-line-lengths, ps-nb-pages-buffer, ps-nb-pages-region, ps-setup): Doc fixes.
| -rw-r--r-- | lisp/ps-print.el | 72 |
1 files changed, 30 insertions, 42 deletions
diff --git a/lisp/ps-print.el b/lisp/ps-print.el index 1ea38b98c52..7a5a74d3ed3 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el | |||
| @@ -99,7 +99,7 @@ Please send all bug fixes and enhancements to | |||
| 99 | ;; otherwise be wasted on banner pages, and to make it easier to find | 99 | ;; otherwise be wasted on banner pages, and to make it easier to find |
| 100 | ;; your output at the printer (it's easier to pick up one 50-page | 100 | ;; your output at the printer (it's easier to pick up one 50-page |
| 101 | ;; printout than to find 50 single-page printouts). | 101 | ;; printout than to find 50 single-page printouts). |
| 102 | ;; | 102 | ;; |
| 103 | ;; Ps-print has a hook in the `kill-emacs-hooks' so that you won't | 103 | ;; Ps-print has a hook in the `kill-emacs-hooks' so that you won't |
| 104 | ;; accidentally quit from Emacs while you have unprinted PostScript | 104 | ;; accidentally quit from Emacs while you have unprinted PostScript |
| 105 | ;; waiting in the spool buffer. If you do attempt to exit with | 105 | ;; waiting in the spool buffer. If you do attempt to exit with |
| @@ -276,7 +276,7 @@ Please send all bug fixes and enhancements to | |||
| 276 | ;; | 276 | ;; |
| 277 | ;; ps-print.el 1/21 | 277 | ;; ps-print.el 1/21 |
| 278 | ;; /home/jct/emacs-lisp/ps/new 94/12/31 | 278 | ;; /home/jct/emacs-lisp/ps/new 94/12/31 |
| 279 | ;; | 279 | ;; |
| 280 | ;; When printing on duplex printers, left and right are reversed so | 280 | ;; When printing on duplex printers, left and right are reversed so |
| 281 | ;; that the page numbers are toward the outside (cf. `ps-spool-duplex'). | 281 | ;; that the page numbers are toward the outside (cf. `ps-spool-duplex'). |
| 282 | ;; | 282 | ;; |
| @@ -286,7 +286,7 @@ Please send all bug fixes and enhancements to | |||
| 286 | ;; set `ps-print-header-frame' to nil. | 286 | ;; set `ps-print-header-frame' to nil. |
| 287 | ;; | 287 | ;; |
| 288 | ;; The font family and size of text in the header are determined | 288 | ;; The font family and size of text in the header are determined |
| 289 | ;; by the variables `ps-header-font-family', `ps-header-font-size' and | 289 | ;; by the variables `ps-header-font-family', `ps-header-font-size' and |
| 290 | ;; `ps-header-title-font-size' (see below). | 290 | ;; `ps-header-title-font-size' (see below). |
| 291 | ;; | 291 | ;; |
| 292 | ;; The variable `ps-header-line-pad' determines the portion of a header | 292 | ;; The variable `ps-header-line-pad' determines the portion of a header |
| @@ -361,7 +361,7 @@ Please send all bug fixes and enhancements to | |||
| 361 | ;; Don't forget to set `ps-lpr-switches' to select duplex printing | 361 | ;; Don't forget to set `ps-lpr-switches' to select duplex printing |
| 362 | ;; for your printer. | 362 | ;; for your printer. |
| 363 | ;; | 363 | ;; |
| 364 | ;; | 364 | ;; |
| 365 | ;; Line Number | 365 | ;; Line Number |
| 366 | ;; ----------- | 366 | ;; ----------- |
| 367 | ;; | 367 | ;; |
| @@ -385,7 +385,7 @@ Please send all bug fixes and enhancements to | |||
| 385 | ;; XXXXXXXXXXXXXXXXXXXXXXXX | 385 | ;; XXXXXXXXXXXXXXXXXXXXXXXX |
| 386 | ;; XXXXXXXXXXXXXXXXXXXXXXXX | 386 | ;; XXXXXXXXXXXXXXXXXXXXXXXX |
| 387 | ;; | 387 | ;; |
| 388 | ;; The X's here represent rectangles filled with a light gray color. | 388 | ;; The blocks of X's represent rectangles filled with a light gray color. |
| 389 | ;; Each rectangle extends all the way across the page. | 389 | ;; Each rectangle extends all the way across the page. |
| 390 | ;; | 390 | ;; |
| 391 | ;; The height, in lines, of each rectangle is controlled by | 391 | ;; The height, in lines, of each rectangle is controlled by |
| @@ -408,7 +408,7 @@ Please send all bug fixes and enhancements to | |||
| 408 | ;; Each font family contains the font names for standard, bold, italic | 408 | ;; Each font family contains the font names for standard, bold, italic |
| 409 | ;; and bold-italic characters, a reference size (usually 10) and the | 409 | ;; and bold-italic characters, a reference size (usually 10) and the |
| 410 | ;; corresponding line height, width of a space and average character width. | 410 | ;; corresponding line height, width of a space and average character width. |
| 411 | ;; | 411 | ;; |
| 412 | ;; The variable `ps-font-family' determines which font family | 412 | ;; The variable `ps-font-family' determines which font family |
| 413 | ;; is to be used for ordinary text. | 413 | ;; is to be used for ordinary text. |
| 414 | ;; If its value does not correspond to a known font family, | 414 | ;; If its value does not correspond to a known font family, |
| @@ -546,7 +546,7 @@ Please send all bug fixes and enhancements to | |||
| 546 | ;; box - text will be surrounded by a box. | 546 | ;; box - text will be surrounded by a box. |
| 547 | ;; outline - print characters as hollow outlines. | 547 | ;; outline - print characters as hollow outlines. |
| 548 | ;; | 548 | ;; |
| 549 | ;; See the documentation for `ps-extend-face' and `ps-extend-face-list'. | 549 | ;; See the documentation for `ps-extend-face'. |
| 550 | ;; | 550 | ;; |
| 551 | ;; Let's, for example, remap font-lock-keyword-face to another foreground color | 551 | ;; Let's, for example, remap font-lock-keyword-face to another foreground color |
| 552 | ;; and bold attribute: | 552 | ;; and bold attribute: |
| @@ -556,9 +556,6 @@ Please send all bug fixes and enhancements to | |||
| 556 | ;; If you want to use a new face, define it first with `defface', | 556 | ;; If you want to use a new face, define it first with `defface', |
| 557 | ;; and then call `ps-extend-face' to specify how to print it. | 557 | ;; and then call `ps-extend-face' to specify how to print it. |
| 558 | ;; | 558 | ;; |
| 559 | ;; NOTE: the only face attributes that have an effect are bold, italic and | ||
| 560 | ;; underline. All other attributes are ignored. | ||
| 561 | ;; | ||
| 562 | ;; | 559 | ;; |
| 563 | ;; How Ps-Print Has A Text And/Or Image On Background | 560 | ;; How Ps-Print Has A Text And/Or Image On Background |
| 564 | ;; -------------------------------------------------- | 561 | ;; -------------------------------------------------- |
| @@ -696,7 +693,7 @@ Please send all bug fixes and enhancements to | |||
| 696 | ;; | 693 | ;; |
| 697 | ;; Epoch and Emacs 18 not supported. At all. | 694 | ;; Epoch and Emacs 18 not supported. At all. |
| 698 | ;; | 695 | ;; |
| 699 | ;; Fixed-pitch fonts work better for line folding, but are not required. | 696 | ;; Fixed-pitch fonts work better for line folding, but are not required. |
| 700 | ;; | 697 | ;; |
| 701 | ;; `ps-nb-pages-buffer' and `ps-nb-pages-region' don't take care | 698 | ;; `ps-nb-pages-buffer' and `ps-nb-pages-region' don't take care |
| 702 | ;; of folding lines. | 699 | ;; of folding lines. |
| @@ -873,13 +870,13 @@ example `letter', `legal' or `a4'." | |||
| 873 | 870 | ||
| 874 | (defcustom ps-zebra-stripes nil | 871 | (defcustom ps-zebra-stripes nil |
| 875 | "*Non-nil means print zebra stripes. | 872 | "*Non-nil means print zebra stripes. |
| 876 | See also documentation for `ps-print-n-zebra'." | 873 | See also documentation for `ps-zebra-stripe-height'." |
| 877 | :type 'boolean | 874 | :type 'boolean |
| 878 | :group 'ps-print) | 875 | :group 'ps-print) |
| 879 | 876 | ||
| 880 | (defcustom ps-zebra-stripe-height 3 | 877 | (defcustom ps-zebra-stripe-height 3 |
| 881 | "*Number of zebra stripe lines. | 878 | "*Number of zebra stripe lines. |
| 882 | See also documentation for `ps-print-zebra'." | 879 | See also documentation for `ps-zebra-stripes'." |
| 883 | :type 'number | 880 | :type 'number |
| 884 | :group 'ps-print) | 881 | :group 'ps-print) |
| 885 | 882 | ||
| @@ -1396,7 +1393,7 @@ number, prompt the user for the name of the file to save in." | |||
| 1396 | 1393 | ||
| 1397 | ;;;###autoload | 1394 | ;;;###autoload |
| 1398 | (defun ps-line-lengths () | 1395 | (defun ps-line-lengths () |
| 1399 | "*Display the correspondence between a line length and a font size, | 1396 | "Display the correspondence between a line length and a font size, |
| 1400 | using the current ps-print setup. | 1397 | using the current ps-print setup. |
| 1401 | Try: pr -t file | awk '{printf \"%3d %s\n\", length($0), $0}' | sort -r | head" | 1398 | Try: pr -t file | awk '{printf \"%3d %s\n\", length($0), $0}' | sort -r | head" |
| 1402 | (interactive) | 1399 | (interactive) |
| @@ -1404,23 +1401,21 @@ Try: pr -t file | awk '{printf \"%3d %s\n\", length($0), $0}' | sort -r | head" | |||
| 1404 | 1401 | ||
| 1405 | ;;;###autoload | 1402 | ;;;###autoload |
| 1406 | (defun ps-nb-pages-buffer (nb-lines) | 1403 | (defun ps-nb-pages-buffer (nb-lines) |
| 1407 | "*Display an approximate correspondence between a font size and the number | 1404 | "Display number of pages to print this buffer, for various font heights. |
| 1408 | of pages the current buffer would require to print | 1405 | The table depends on the current ps-print setup." |
| 1409 | using the current ps-print setup." | ||
| 1410 | (interactive (list (count-lines (point-min) (point-max)))) | 1406 | (interactive (list (count-lines (point-min) (point-max)))) |
| 1411 | (ps-nb-pages nb-lines)) | 1407 | (ps-nb-pages nb-lines)) |
| 1412 | 1408 | ||
| 1413 | ;;;###autoload | 1409 | ;;;###autoload |
| 1414 | (defun ps-nb-pages-region (nb-lines) | 1410 | (defun ps-nb-pages-region (nb-lines) |
| 1415 | "*Display an approximate correspondence between a font size and the number | 1411 | "Display number of pages to print the region, for various font heights. |
| 1416 | of pages the current region would require to print | 1412 | The table depends on the current ps-print setup." |
| 1417 | using the current ps-print setup." | ||
| 1418 | (interactive (list (count-lines (mark) (point)))) | 1413 | (interactive (list (count-lines (mark) (point)))) |
| 1419 | (ps-nb-pages nb-lines)) | 1414 | (ps-nb-pages nb-lines)) |
| 1420 | 1415 | ||
| 1421 | ;;;###autoload | 1416 | ;;;###autoload |
| 1422 | (defun ps-setup () | 1417 | (defun ps-setup () |
| 1423 | "*Return the current setup" | 1418 | "Return the current setup." |
| 1424 | (format | 1419 | (format |
| 1425 | " | 1420 | " |
| 1426 | \(setq ps-print-color-p %s | 1421 | \(setq ps-print-color-p %s |
| @@ -2683,7 +2678,7 @@ page-height == bm + print-height + tm - ho - hh | |||
| 2683 | (set-buffer ps-spool-buffer) | 2678 | (set-buffer ps-spool-buffer) |
| 2684 | (goto-char (point-max)) | 2679 | (goto-char (point-max)) |
| 2685 | (insert-file fname))) | 2680 | (insert-file fname))) |
| 2686 | 2681 | ||
| 2687 | ;; These functions insert the arrays that define the contents of the | 2682 | ;; These functions insert the arrays that define the contents of the |
| 2688 | ;; headers. | 2683 | ;; headers. |
| 2689 | 2684 | ||
| @@ -2724,6 +2719,7 @@ page-height == bm + print-height + tm - ho - hh | |||
| 2724 | (defun ps-output-boolean (name bool) | 2719 | (defun ps-output-boolean (name bool) |
| 2725 | (ps-output (format "/%s %s def\n" name (if bool "true" "false")))) | 2720 | (ps-output (format "/%s %s def\n" name (if bool "true" "false")))) |
| 2726 | 2721 | ||
| 2722 | |||
| 2727 | (defun ps-background-pages (page-list func) | 2723 | (defun ps-background-pages (page-list func) |
| 2728 | (if page-list | 2724 | (if page-list |
| 2729 | (mapcar | 2725 | (mapcar |
| @@ -2892,7 +2888,7 @@ page-height == bm + print-height + tm - ho - hh | |||
| 2892 | (ps-output (format "/TopMargin %s def\n" ps-top-margin)) ; not used | 2888 | (ps-output (format "/TopMargin %s def\n" ps-top-margin)) ; not used |
| 2893 | (ps-output (format "/HeaderOffset %s def\n" ps-header-offset)) | 2889 | (ps-output (format "/HeaderOffset %s def\n" ps-header-offset)) |
| 2894 | (ps-output (format "/HeaderPad %s def\n" ps-header-pad)) | 2890 | (ps-output (format "/HeaderPad %s def\n" ps-header-pad)) |
| 2895 | 2891 | ||
| 2896 | (ps-output-boolean "PrintHeader" ps-print-header) | 2892 | (ps-output-boolean "PrintHeader" ps-print-header) |
| 2897 | (ps-output-boolean "PrintHeaderFrame" ps-print-header-frame) | 2893 | (ps-output-boolean "PrintHeaderFrame" ps-print-header-frame) |
| 2898 | (ps-output-boolean "ShowNofN" ps-show-n-of-n) | 2894 | (ps-output-boolean "ShowNofN" ps-show-n-of-n) |
| @@ -3018,7 +3014,7 @@ page-height == bm + print-height + tm - ho - hh | |||
| 3018 | BeginPage | 3014 | BeginPage |
| 3019 | EndPage | 3015 | EndPage |
| 3020 | EndDSCPage\n")) | 3016 | EndDSCPage\n")) |
| 3021 | 3017 | ||
| 3022 | (defun ps-next-line () | 3018 | (defun ps-next-line () |
| 3023 | (setq ps-showline-count (1+ ps-showline-count)) | 3019 | (setq ps-showline-count (1+ ps-showline-count)) |
| 3024 | (if (< ps-height-remaining ps-line-height) | 3020 | (if (< ps-height-remaining ps-line-height) |
| @@ -3110,15 +3106,15 @@ EndDSCPage\n")) | |||
| 3110 | (defun ps-plot-region (from to font &optional fg-color bg-color effects) | 3106 | (defun ps-plot-region (from to font &optional fg-color bg-color effects) |
| 3111 | (if (not (equal font ps-current-font)) | 3107 | (if (not (equal font ps-current-font)) |
| 3112 | (ps-set-font font)) | 3108 | (ps-set-font font)) |
| 3113 | 3109 | ||
| 3114 | ;; Specify a foreground color only if one's specified and it's | 3110 | ;; Specify a foreground color only if one's specified and it's |
| 3115 | ;; different than the current. | 3111 | ;; different than the current. |
| 3116 | (if (not (equal fg-color ps-current-color)) | 3112 | (if (not (equal fg-color ps-current-color)) |
| 3117 | (ps-set-color fg-color)) | 3113 | (ps-set-color fg-color)) |
| 3118 | 3114 | ||
| 3119 | (if (not (equal bg-color ps-current-bg)) | 3115 | (if (not (equal bg-color ps-current-bg)) |
| 3120 | (ps-set-bg bg-color)) | 3116 | (ps-set-bg bg-color)) |
| 3121 | 3117 | ||
| 3122 | ;; Specify effects (underline, overline, box, etc) | 3118 | ;; Specify effects (underline, overline, box, etc) |
| 3123 | (cond | 3119 | (cond |
| 3124 | ((not (integerp effects)) | 3120 | ((not (integerp effects)) |
| @@ -3247,16 +3243,6 @@ If FACE is not a valid face name, it is used default face." | |||
| 3247 | (goto-char to)) | 3243 | (goto-char to)) |
| 3248 | 3244 | ||
| 3249 | 3245 | ||
| 3250 | (defun ps-emacs-face-kind-p (face kind kind-regex kind-list) | ||
| 3251 | (let ((frame-font (face-font face)) | ||
| 3252 | (face-defaults (face-font face t))) | ||
| 3253 | (or | ||
| 3254 | ;; Check FACE defaults: | ||
| 3255 | (and (listp face-defaults) | ||
| 3256 | (memq kind face-defaults)) | ||
| 3257 | ;; Check the user's preferences | ||
| 3258 | (memq face kind-list)))) | ||
| 3259 | |||
| 3260 | (defun ps-xemacs-face-kind-p (face kind kind-regex kind-list) | 3246 | (defun ps-xemacs-face-kind-p (face kind kind-regex kind-list) |
| 3261 | (let* ((frame-font (or (face-font face) (face-font 'default))) | 3247 | (let* ((frame-font (or (face-font face) (face-font 'default))) |
| 3262 | (kind-cons (assq kind (x-font-properties frame-font))) | 3248 | (kind-cons (assq kind (x-font-properties frame-font))) |
| @@ -3269,13 +3255,15 @@ If FACE is not a valid face name, it is used default face." | |||
| 3269 | 3255 | ||
| 3270 | (defun ps-face-bold-p (face) | 3256 | (defun ps-face-bold-p (face) |
| 3271 | (if (eq ps-print-emacs-type 'emacs) | 3257 | (if (eq ps-print-emacs-type 'emacs) |
| 3272 | (face-bold-p face) | 3258 | (or (face-bold-p face) |
| 3259 | (memq face ps-bold-faces)) | ||
| 3273 | (ps-xemacs-face-kind-p face 'WEIGHT_NAME "bold\\|demibold" | 3260 | (ps-xemacs-face-kind-p face 'WEIGHT_NAME "bold\\|demibold" |
| 3274 | ps-bold-faces))) | 3261 | ps-bold-faces))) |
| 3275 | 3262 | ||
| 3276 | (defun ps-face-italic-p (face) | 3263 | (defun ps-face-italic-p (face) |
| 3277 | (if (eq ps-print-emacs-type 'emacs) | 3264 | (if (eq ps-print-emacs-type 'emacs) |
| 3278 | (face-italic-p face) | 3265 | (or (face-italic-p face) |
| 3266 | (memq face ps-italic-faces)) | ||
| 3279 | (or | 3267 | (or |
| 3280 | (ps-xemacs-face-kind-p face 'ANGLE_NAME "i\\|o" ps-italic-faces) | 3268 | (ps-xemacs-face-kind-p face 'ANGLE_NAME "i\\|o" ps-italic-faces) |
| 3281 | (ps-xemacs-face-kind-p face 'SLANT "i\\|o" ps-italic-faces)))) | 3269 | (ps-xemacs-face-kind-p face 'SLANT "i\\|o" ps-italic-faces)))) |
| @@ -3339,7 +3327,7 @@ If FACE is not a valid face name, it is used default face." | |||
| 3339 | 3327 | ||
| 3340 | (defun ps-mapper (extent list) | 3328 | (defun ps-mapper (extent list) |
| 3341 | (nconc list (list (list (extent-start-position extent) 'push extent) | 3329 | (nconc list (list (list (extent-start-position extent) 'push extent) |
| 3342 | (list (extent-end-position extent) 'pull extent))) | 3330 | (list (extent-end-position extent) 'pull extent))) |
| 3343 | nil) | 3331 | nil) |
| 3344 | 3332 | ||
| 3345 | (defun ps-extent-sorter (a b) | 3333 | (defun ps-extent-sorter (a b) |
| @@ -3348,8 +3336,8 @@ If FACE is not a valid face name, it is used default face." | |||
| 3348 | (defun ps-print-ensure-fontified (start end) | 3336 | (defun ps-print-ensure-fontified (start end) |
| 3349 | (if (and (boundp 'lazy-lock-mode) lazy-lock-mode) | 3337 | (if (and (boundp 'lazy-lock-mode) lazy-lock-mode) |
| 3350 | (if (fboundp 'lazy-lock-fontify-region) | 3338 | (if (fboundp 'lazy-lock-fontify-region) |
| 3351 | (lazy-lock-fontify-region start end) ; the new | 3339 | (lazy-lock-fontify-region start end) ; the new |
| 3352 | (lazy-lock-fontify-buffer)))) ; the old | 3340 | (lazy-lock-fontify-buffer)))) ; the old |
| 3353 | 3341 | ||
| 3354 | (defun ps-generate-postscript-with-faces (from to) | 3342 | (defun ps-generate-postscript-with-faces (from to) |
| 3355 | ;; Some initialization... | 3343 | ;; Some initialization... |