From xemacs-m  Sat Mar  1 19:40:02 1997
Received: from jagor.srce.hr (hniksic@jagor.srce.hr [161.53.2.130])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id TAA22849
	for <xemacs-beta@xemacs.org>; Sat, 1 Mar 1997 19:40:01 -0600 (CST)
Received: (from hniksic@localhost)
          by jagor.srce.hr (8.8.5/8.8.4)
	  id CAA23071; Sun, 2 Mar 1997 02:40:00 +0100 (MET)
Sender: hniksic@public.srce.hr
To: xemacs-beta@xemacs.org
Subject: Colors patch
X-URL: ftp://gnjilux.cc.fer.hr/pub/unix/util/wget/
X-Attribution: Hrv
X-Face: &}4JQk=L;e.~x+|eo]#DGk@x3~ed!.~lZ}YQcYb7f[WL9L'Z*+OyA\nAEL1M(".[qvI#a2E
 6WYI5>>e7'@_)3Ol9p|Nn2wNa/;~06jL*B%tTcn/XvhAu7qeES0\|MF%$;sI#yn1+y"
From: Hrvoje Niksic <hniksic@srce.hr>
Date: 02 Mar 1997 02:39:59 +0100
Message-ID: <kign2sn9imo.fsf@jagor.srce.hr>
Lines: 151
X-Mailer: Gnus v5.4.16/XEmacs 19.14

OK, here is my try at a patch for 20.1-b3.  This patch does the
following:

1) patches the ChangeLog.

This is the most important part of the patch.  It increases the
probability of entering the distribution.  Read "The Hitch-Hiker's
Guide Through the Galaxy" for details.

2) patches x11/x-faces.el.

I hope I've done it right.  The words "black" and "white" pop up on
several places, and I changed on the one place where it looked
important.  I hope I got it right.  If not, please correct me.

I set the color to gray80, for two reasons:

a) it is a bit lighter, and tends to look nicer.  It's also a
   compromise to the users that had it at `white' default all the
   time.

b) `gray75' is actually the same as `gray', which means that whoever
   sets his face background to `gray' loses, and that's not nice.

3) patches prim/faces.el.

And fixes zmacs-regions and primary-selection.

4) patches packages/ps-print.el

...to set ps-print-color-p to nil unconditionally.

4) patches x11/x-menubar.el.

This may be the shakiest part of the patch.  I have removed the
`Pretty Print With Color' toggle, and introduced an irreversible menu
entry `Enable Color Printing' that does the following:

a) (set-face-background 'default "white")

b) (setq ps-print-color-p t)

So, when you choose this entry, XEmacs will flash white, and your
printer will turn colorful.  Oh, yeah.  Great.

In the future we may turn this menu option back into a toggle, by
using a function that would remember the original color of the default
face, and later turned it back on.

If someone can write a patch for that off the top of his head, I'll be
delighted!


The patch follows:

--- ChangeLog.orig	Sun Mar  2 01:37:40 1997
+++ ChangeLog	Sun Mar  2 02:32:56 1997
@@ -1,3 +1,16 @@
+Sun Mar  2 01:37:04 1997  Hrvoje Niksic  <hniksic@srce.hr>
+
+	* packages/ps-print.el (ps-print-color-p): Default to nil.
+
+	* x11/x-menubar.el (default-menubar): Changed menubar entry for
+	color printing.
+
+	* prim/faces.el (init-other-random-faces): Use gray65 for
+	zmacs-region and primary-selection background.
+
+	* x11/x-faces.el (x-init-global-faces): New default background
+	gray75.
+
 Sat Mar  1 07:26:33 1997  Hrvoje Niksic  <hniksic@srce.hr>
 
 	* mel/mel-g.el (gzip64-external-encoder): Find `mmencode' in
--- x11/x-faces.el.orig	Sun Mar  2 01:36:44 1997
+++ x11/x-faces.el	Sun Mar  2 02:25:28 1997
@@ -496,7 +496,7 @@
   (or (face-foreground 'default 'global)
       (set-face-foreground 'default "black" 'global 'x))
   (or (face-background 'default 'global)
-      (set-face-background 'default "white" 'global 'x)))
+      (set-face-background 'default "gray80" 'global 'x)))
 
 ;;; x-init-device-faces is responsible for initializing default
 ;;; values for faces on a newly created device.
@@ -578,8 +578,8 @@
 	    (progn
 	      (or fg (set-face-foreground 'default "white" device))
 	      (or bg (set-face-background 'default "black" device)))
-	  (or fg (set-face-foreground 'default "black" device))
-	  (or bg (set-face-background 'default "white" device)))))
+	  (or fg (set-face-foreground 'default "white" device))
+	  (or bg (set-face-background 'default "black" device)))))
 
   ;; Don't look at reverseVideo now or initialize the modeline.  This
   ;; is done on a per-frame basis at the appropriate time.
--- prim/faces.el.orig	Sun Mar  2 01:59:52 1997
+++ prim/faces.el	Sun Mar  2 02:02:55 1997
@@ -1265,8 +1265,8 @@
   ;; specified.
   (unless (or (face-differs-from-default-p 'zmacs-region device)
 	      (face-background 'zmacs-region 'global))
-    (set-face-background 'zmacs-region "gray" 'global 'color)
-    (set-face-background 'zmacs-region "gray80" 'global 'grayscale))
+    (set-face-background 'zmacs-region "gray65" 'global 'color)
+    (set-face-background 'zmacs-region "gray65" 'global 'grayscale))
   (unless (or (face-differs-from-default-p 'zmacs-region device)
 	      (face-background-pixmap 'zmacs-region 'global))
     (set-face-background-pixmap 'zmacs-region [nothing] 'global 'color)
@@ -1296,8 +1296,8 @@
   ;; Set the primary-selection color unless already specified.
   (unless (or (face-differs-from-default-p 'primary-selection device)
 	      (face-background 'primary-selection 'global))
-    (set-face-background 'primary-selection "gray" 'global 'color)
-    (set-face-background 'primary-selection "gray80" 'global 'grayscale))
+    (set-face-background 'primary-selection "gray65" 'global 'color)
+    (set-face-background 'primary-selection "gray65" 'global 'grayscale))
   (unless (or (face-differs-from-default-p 'secondary-selection device)
 	      (face-background-pixmap 'primary-selection 'global))
     (set-face-background-pixmap 'primary-selection "gray3" 'global 'mono))
--- x11/x-menubar.el.orig	Sun Mar  2 02:09:11 1997
+++ x11/x-menubar.el	Sun Mar  2 02:09:33 1997
@@ -185,9 +185,6 @@
 	      (read-expression "Switches for `lpr'/`lp': "
 			       (format "%S" lpr-switches)))
 	t]
-       ["Pretty-Print With Color"
-	(setq ps-print-color-p (not ps-print-color-p))
-	:style toggle :selected ps-print-color-p]
        ("Pretty-Print Paper Size"
 	["Letter"
 	 (setq ps-paper-type 'letter)
@@ -238,6 +235,11 @@
 	 :style radio
 	 :selected (eq ps-paper-type 'b5)]
 	)
+       ["Enable Color Printing"
+	(progn
+	  (set-face-background 'default "white")
+	  (setq ps-print-color-p t))
+	t]
        )
       ("\"Other Window\" Location"
        ["Always in Same Frame"


-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
"Silence!" cries Freydag. "I did not call thee in for a consultation!" 
"They are my innards! I will not have them misread by a poseur!"

