diff options
| author | Vinicius Jose Latorre | 2007-01-21 13:07:12 +0000 |
|---|---|---|
| committer | Vinicius Jose Latorre | 2007-01-21 13:07:12 +0000 |
| commit | 830f437ef1cf048448706d9d935dfbf8823dea86 (patch) | |
| tree | 33ee43f9f3180957cb048f9fb5b8b0d39fed8b3e | |
| parent | e35ae98e41ee3c7b511aa351455683aff26fc3cd (diff) | |
| download | emacs-830f437ef1cf048448706d9d935dfbf8823dea86.tar.gz emacs-830f437ef1cf048448706d9d935dfbf8823dea86.zip | |
Handle frame parameters changing dynamically
| -rw-r--r-- | lisp/ChangeLog.unicode | 13 | ||||
| -rw-r--r-- | lisp/ps-bdf.el | 4 | ||||
| -rw-r--r-- | lisp/ps-mule.el | 2 | ||||
| -rw-r--r-- | lisp/ps-print.el | 57 |
4 files changed, 56 insertions, 20 deletions
diff --git a/lisp/ChangeLog.unicode b/lisp/ChangeLog.unicode index 7e436513471..7d2b53b680b 100644 --- a/lisp/ChangeLog.unicode +++ b/lisp/ChangeLog.unicode | |||
| @@ -1,3 +1,16 @@ | |||
| 1 | 2007-01-21 Vinicius Jose Latorre <viniciusjl@ig.com.br> | ||
| 2 | |||
| 3 | * ps-print.el: Handle frame parameters (background and/or foreground | ||
| 4 | colors) changing dynamically. Reported by Leo <sdl.web@gmail.com>. | ||
| 5 | (ps-print-version): New Version 7.1. | ||
| 6 | (ps-x-frame-property, ps-e-frame-parameter): New aliases. | ||
| 7 | (ps-frame-parameter): New fun. | ||
| 8 | (ps-default-fg, ps-default-bg): New default value ('frame-parameter). | ||
| 9 | Fix doc and customization. | ||
| 10 | (ps-begin-job): Get frame parameters (background and/or foreground | ||
| 11 | colors). | ||
| 12 | (ps-do-despool): Ensure ps-printer-name has a valid value. | ||
| 13 | |||
| 1 | 2006-12-04 Vinicius Jose Latorre <viniciusjl@ig.com.br> | 14 | 2006-12-04 Vinicius Jose Latorre <viniciusjl@ig.com.br> |
| 2 | 15 | ||
| 3 | * progmodes/ebnf-abn.el: | 16 | * progmodes/ebnf-abn.el: |
diff --git a/lisp/ps-bdf.el b/lisp/ps-bdf.el index a19c0f02651..615f98b950b 100644 --- a/lisp/ps-bdf.el +++ b/lisp/ps-bdf.el | |||
| @@ -1,8 +1,8 @@ | |||
| 1 | ;;; ps-bdf.el --- BDF font file handler for ps-print | 1 | ;;; ps-bdf.el --- BDF font file handler for ps-print |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004, 2005, 2006 | 3 | ;; Copyright (C) 1998, 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007 |
| 4 | ;; Free Software Foundation, Inc. | 4 | ;; Free Software Foundation, Inc. |
| 5 | ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 | 5 | ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 |
| 6 | ;; National Institute of Advanced Industrial Science and Technology (AIST) | 6 | ;; National Institute of Advanced Industrial Science and Technology (AIST) |
| 7 | ;; Registration Number H14PRO021 | 7 | ;; Registration Number H14PRO021 |
| 8 | 8 | ||
diff --git a/lisp/ps-mule.el b/lisp/ps-mule.el index a252b6a180f..5223e751d6c 100644 --- a/lisp/ps-mule.el +++ b/lisp/ps-mule.el | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;;; ps-mule.el --- provide multi-byte character facility to ps-print | 1 | ;;; ps-mule.el --- provide multi-byte character facility to ps-print |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, | 3 | ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
| 4 | ;; 2005, 2006 Free Software Foundation, Inc. | 4 | ;; 2005, 2006, 2007 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> | 6 | ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> |
| 7 | ;; Kenichi Handa <handa@m17n.org> (multi-byte characters) | 7 | ;; Kenichi Handa <handa@m17n.org> (multi-byte characters) |
diff --git a/lisp/ps-print.el b/lisp/ps-print.el index 23a47286ad1..1003015aee0 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;;; ps-print.el --- print text from the buffer as PostScript | 1 | ;;; ps-print.el --- print text from the buffer as PostScript |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, | 3 | ;; Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, |
| 4 | ;; 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. | 4 | ;; 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Jim Thompson (was <thompson@wg2.waii.com>) | 6 | ;; Author: Jim Thompson (was <thompson@wg2.waii.com>) |
| 7 | ;; Jacques Duthen (was <duthen@cegelec-red.fr>) | 7 | ;; Jacques Duthen (was <duthen@cegelec-red.fr>) |
| @@ -10,11 +10,11 @@ | |||
| 10 | ;; Maintainer: Kenichi Handa <handa@m17n.org> (multi-byte characters) | 10 | ;; Maintainer: Kenichi Handa <handa@m17n.org> (multi-byte characters) |
| 11 | ;; Vinicius Jose Latorre <viniciusjl@ig.com.br> | 11 | ;; Vinicius Jose Latorre <viniciusjl@ig.com.br> |
| 12 | ;; Keywords: wp, print, PostScript | 12 | ;; Keywords: wp, print, PostScript |
| 13 | ;; Version: 7.0 | 13 | ;; Version: 7.1 |
| 14 | ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre | 14 | ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre |
| 15 | 15 | ||
| 16 | (defconst ps-print-version "7.0" | 16 | (defconst ps-print-version "7.1" |
| 17 | "ps-print.el, v 7.0 <2006/12/01 vinicius> | 17 | "ps-print.el, v 7.1 <2007/01/21 vinicius> |
| 18 | 18 | ||
| 19 | Vinicius's last change version -- this file may have been edited as part of | 19 | Vinicius's last change version -- this file may have been edited as part of |
| 20 | Emacs without changes to the version number. When reporting bugs, please also | 20 | Emacs without changes to the version number. When reporting bugs, please also |
| @@ -1490,6 +1490,7 @@ Please send all bug fixes and enhancements to | |||
| 1490 | (defalias 'ps-x-font-instance-properties 'font-instance-properties) | 1490 | (defalias 'ps-x-font-instance-properties 'font-instance-properties) |
| 1491 | (defalias 'ps-x-make-color-instance 'make-color-instance) | 1491 | (defalias 'ps-x-make-color-instance 'make-color-instance) |
| 1492 | (defalias 'ps-x-map-extents 'map-extents) | 1492 | (defalias 'ps-x-map-extents 'map-extents) |
| 1493 | (defalias 'ps-x-frame-property 'frame-property) | ||
| 1493 | 1494 | ||
| 1494 | ;; GNU Emacs | 1495 | ;; GNU Emacs |
| 1495 | (defalias 'ps-e-face-bold-p 'face-bold-p) | 1496 | (defalias 'ps-e-face-bold-p 'face-bold-p) |
| @@ -1500,6 +1501,7 @@ Please send all bug fixes and enhancements to | |||
| 1500 | (defalias 'ps-e-overlay-end 'overlay-end) | 1501 | (defalias 'ps-e-overlay-end 'overlay-end) |
| 1501 | (defalias 'ps-e-x-color-values 'x-color-values) | 1502 | (defalias 'ps-e-x-color-values 'x-color-values) |
| 1502 | (defalias 'ps-e-color-values 'color-values) | 1503 | (defalias 'ps-e-color-values 'color-values) |
| 1504 | (defalias 'ps-e-frame-parameter 'frame-parameter) | ||
| 1503 | (if (fboundp 'find-composition) | 1505 | (if (fboundp 'find-composition) |
| 1504 | (defalias 'ps-e-find-composition 'find-composition) | 1506 | (defalias 'ps-e-find-composition 'find-composition) |
| 1505 | (defalias 'ps-e-find-composition 'ignore)) | 1507 | (defalias 'ps-e-find-composition 'ignore)) |
| @@ -1523,6 +1525,8 @@ Please send all bug fixes and enhancements to | |||
| 1523 | (ps-xemacs-color-name (face-foreground face))) | 1525 | (ps-xemacs-color-name (face-foreground face))) |
| 1524 | (defun ps-face-background-name (face) | 1526 | (defun ps-face-background-name (face) |
| 1525 | (ps-xemacs-color-name (face-background face))) | 1527 | (ps-xemacs-color-name (face-background face))) |
| 1528 | (defun ps-frame-parameter (param) | ||
| 1529 | (ps-x-frame-property nil param)) | ||
| 1526 | ) | 1530 | ) |
| 1527 | (t ; emacs 23 or higher | 1531 | (t ; emacs 23 or higher |
| 1528 | (defvar mark-active nil) | 1532 | (defvar mark-active nil) |
| @@ -1531,7 +1535,10 @@ Please send all bug fixes and enhancements to | |||
| 1531 | (defun ps-face-foreground-name (face) | 1535 | (defun ps-face-foreground-name (face) |
| 1532 | (face-foreground face nil t)) | 1536 | (face-foreground face nil t)) |
| 1533 | (defun ps-face-background-name (face) | 1537 | (defun ps-face-background-name (face) |
| 1534 | (face-background face nil t)))) | 1538 | (face-background face nil t)) |
| 1539 | (defun ps-frame-parameter (param) | ||
| 1540 | (ps-e-frame-parameter nil param)) | ||
| 1541 | )) | ||
| 1535 | 1542 | ||
| 1536 | 1543 | ||
| 1537 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 1544 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| @@ -2985,8 +2992,8 @@ Any other value is treated as t." | |||
| 2985 | :version "20" | 2992 | :version "20" |
| 2986 | :group 'ps-print-color) | 2993 | :group 'ps-print-color) |
| 2987 | 2994 | ||
| 2988 | (defcustom ps-default-fg '(0.0 0.0 0.0) ; black | 2995 | (defcustom ps-default-fg 'frame-parameter |
| 2989 | "*RGB values of the default foreground color. Defaults to black. | 2996 | "*RGB values of the default foreground color. |
| 2990 | 2997 | ||
| 2991 | The `ps-default-fg' variable contains the default foreground color used by | 2998 | The `ps-default-fg' variable contains the default foreground color used by |
| 2992 | ps-print, that is, if there is a face in a text that doesn't have a foreground | 2999 | ps-print, that is, if there is a face in a text that doesn't have a foreground |
| @@ -2996,6 +3003,8 @@ Valid values are: | |||
| 2996 | 3003 | ||
| 2997 | t The foreground color of Emacs session will be used. | 3004 | t The foreground color of Emacs session will be used. |
| 2998 | 3005 | ||
| 3006 | frame-parameter The foreground-color frame parameter will be used. | ||
| 3007 | |||
| 2999 | NUMBER It's a real value between 0.0 (black) and 1.0 (white) that | 3008 | NUMBER It's a real value between 0.0 (black) and 1.0 (white) that |
| 3000 | indicate the gray color. | 3009 | indicate the gray color. |
| 3001 | 3010 | ||
| @@ -3010,12 +3019,13 @@ Valid values are: | |||
| 3010 | Where RED, GREEN and BLUE are reals between 0.0 (no color) and | 3019 | Where RED, GREEN and BLUE are reals between 0.0 (no color) and |
| 3011 | 1.0 (full color). | 3020 | 1.0 (full color). |
| 3012 | 3021 | ||
| 3013 | Any other value is ignored and black will be used. | 3022 | Any other value is ignored and black color will be used. |
| 3014 | 3023 | ||
| 3015 | It's used only when `ps-print-color-p' is non-nil." | 3024 | It's used only when `ps-print-color-p' is non-nil." |
| 3016 | :type '(choice :menu-tag "Default Foreground Gray/Color" | 3025 | :type '(choice :menu-tag "Default Foreground Gray/Color" |
| 3017 | :tag "Default Foreground Gray/Color" | 3026 | :tag "Default Foreground Gray/Color" |
| 3018 | (const :tag "Session Foreground" t) | 3027 | (const :tag "Session Foreground" t) |
| 3028 | (const :tag "Frame Foreground" frame-parameter) | ||
| 3019 | (number :tag "Gray Scale" :value 0.0) | 3029 | (number :tag "Gray Scale" :value 0.0) |
| 3020 | (string :tag "Color Name" :value "black") | 3030 | (string :tag "Color Name" :value "black") |
| 3021 | (list :tag "RGB Color" :value (0.0 0.0 0.0) | 3031 | (list :tag "RGB Color" :value (0.0 0.0 0.0) |
| @@ -3025,8 +3035,8 @@ It's used only when `ps-print-color-p' is non-nil." | |||
| 3025 | :version "20" | 3035 | :version "20" |
| 3026 | :group 'ps-print-color) | 3036 | :group 'ps-print-color) |
| 3027 | 3037 | ||
| 3028 | (defcustom ps-default-bg '(1.0 1.0 1.0) ; white | 3038 | (defcustom ps-default-bg 'frame-parameter |
| 3029 | "*RGB values of the default background color. Defaults to white. | 3039 | "*RGB values of the default background color. |
| 3030 | 3040 | ||
| 3031 | The `ps-default-bg' variable contains the default background color used by | 3041 | The `ps-default-bg' variable contains the default background color used by |
| 3032 | ps-print, that is, if there is a face in a text that doesn't have a background | 3042 | ps-print, that is, if there is a face in a text that doesn't have a background |
| @@ -3036,6 +3046,8 @@ Valid values are: | |||
| 3036 | 3046 | ||
| 3037 | t The background color of Emacs session will be used. | 3047 | t The background color of Emacs session will be used. |
| 3038 | 3048 | ||
| 3049 | frame-parameter The background-color frame parameter will be used. | ||
| 3050 | |||
| 3039 | NUMBER It's a real value between 0.0 (black) and 1.0 (white) that | 3051 | NUMBER It's a real value between 0.0 (black) and 1.0 (white) that |
| 3040 | indicate the gray color. | 3052 | indicate the gray color. |
| 3041 | 3053 | ||
| @@ -3050,7 +3062,7 @@ Valid values are: | |||
| 3050 | Where RED, GREEN and BLUE are reals between 0.0 (no color) and | 3062 | Where RED, GREEN and BLUE are reals between 0.0 (no color) and |
| 3051 | 1.0 (full color). | 3063 | 1.0 (full color). |
| 3052 | 3064 | ||
| 3053 | Any other value is ignored and white will be used. | 3065 | Any other value is ignored and white color will be used. |
| 3054 | 3066 | ||
| 3055 | It's used only when `ps-print-color-p' is non-nil. | 3067 | It's used only when `ps-print-color-p' is non-nil. |
| 3056 | 3068 | ||
| @@ -3058,6 +3070,7 @@ See also `ps-use-face-background'." | |||
| 3058 | :type '(choice :menu-tag "Default Background Gray/Color" | 3070 | :type '(choice :menu-tag "Default Background Gray/Color" |
| 3059 | :tag "Default Background Gray/Color" | 3071 | :tag "Default Background Gray/Color" |
| 3060 | (const :tag "Session Background" t) | 3072 | (const :tag "Session Background" t) |
| 3073 | (const :tag "Frame Background" frame-parameter) | ||
| 3061 | (number :tag "Gray Scale" :value 1.0) | 3074 | (number :tag "Gray Scale" :value 1.0) |
| 3062 | (string :tag "Color Name" :value "white") | 3075 | (string :tag "Color Name" :value "white") |
| 3063 | (list :tag "RGB Color" :value (1.0 1.0 1.0) | 3076 | (list :tag "RGB Color" :value (1.0 1.0 1.0) |
| @@ -5866,14 +5879,22 @@ XSTART YSTART are the relative position for the first page in a sheet.") | |||
| 5866 | "[\000-\037\177]") | 5879 | "[\000-\037\177]") |
| 5867 | (t "[\t\n\f]")) | 5880 | (t "[\t\n\f]")) |
| 5868 | ps-default-background (ps-rgb-color | 5881 | ps-default-background (ps-rgb-color |
| 5869 | (if (eq ps-default-bg t) | 5882 | (cond |
| 5870 | (ps-face-background-name 'default) | 5883 | ((eq ps-default-bg 'frame-parameter) |
| 5871 | ps-default-bg) | 5884 | (ps-frame-parameter 'background-color)) |
| 5885 | ((eq ps-default-bg t) | ||
| 5886 | (ps-face-background-name 'default)) | ||
| 5887 | (t | ||
| 5888 | ps-default-bg)) | ||
| 5872 | 1.0) | 5889 | 1.0) |
| 5873 | ps-default-foreground (ps-rgb-color | 5890 | ps-default-foreground (ps-rgb-color |
| 5874 | (if (eq ps-default-fg t) | 5891 | (cond |
| 5875 | (ps-face-foreground-name 'default) | 5892 | ((eq ps-default-fg 'frame-parameter) |
| 5876 | ps-default-fg) | 5893 | (ps-frame-parameter 'foreground-color)) |
| 5894 | ((eq ps-default-fg t) | ||
| 5895 | (ps-face-foreground-name 'default)) | ||
| 5896 | (t | ||
| 5897 | ps-default-fg)) | ||
| 5877 | 0.0) | 5898 | 0.0) |
| 5878 | ps-default-color (and (eq ps-print-color-p t) ps-default-foreground) | 5899 | ps-default-color (and (eq ps-print-color-p t) ps-default-foreground) |
| 5879 | ps-current-color ps-default-color | 5900 | ps-current-color ps-default-color |
| @@ -6678,6 +6699,8 @@ If FACE is not a valid face name, it is used default face." | |||
| 6678 | (and (stringp ps-printer-name-option) | 6699 | (and (stringp ps-printer-name-option) |
| 6679 | ps-printer-name-option) | 6700 | ps-printer-name-option) |
| 6680 | ps-printer-name)))))) | 6701 | ps-printer-name)))))) |
| 6702 | (or (stringp ps-printer-name) | ||
| 6703 | (setq ps-printer-name nil)) | ||
| 6681 | (apply (or ps-print-region-function 'call-process-region) | 6704 | (apply (or ps-print-region-function 'call-process-region) |
| 6682 | (point-min) (point-max) ps-lpr-command nil | 6705 | (point-min) (point-max) ps-lpr-command nil |
| 6683 | (and (fboundp 'start-process) 0) | 6706 | (and (fboundp 'start-process) 0) |