From xemacs-m  Fri Mar  7 23:42:15 1997
Received: from corona.pixar.com (corona.pixar.com [138.72.20.84])
	by xemacs.org (8.8.5/8.8.5) with SMTP id XAA00997
	for <xemacs-beta@xemacs.org>; Fri, 7 Mar 1997 23:42:13 -0600 (CST)
Received: by corona.pixar.com (Smail3.1.29.1 #2)
	id m0w3Erk-0001XtC; Fri, 7 Mar 97 21:40 PST
Sender: retnuh@pixar.com (Hunter Kelly)
Sender: retnuh@corona
To: xemacs-beta@xemacs.org
Subject: more fonst madness! [WAS Re: 20.1-b5: Setting fonts?]
References: <199703062143.QAA07193@spacely.icd.teradyne.com> 	<m3afog31we.fsf@jens.metrix.de> <199703071540.KAA05372@anthem.CNRI.Reston.Va.US> <yvtybbz82il.fsf@corona.pixar.com> <m24tenvv2t.fsf@altair.xemacs.org>
Mime-Version: 1.0 (generated by tm-edit 7.105)
Content-Type: multipart/mixed;
 boundary="Multipart_Fri_Mar__7_21:40:20_1997-1"
Content-Transfer-Encoding: 7bit
From: Hunter Kelly <retnuh@corona.pixar.com>
Date: 07 Mar 1997 21:40:20 -0800
In-Reply-To: Steven L Baur's message of 07 Mar 1997 20:58:18 -0800
Message-ID: <yvtvi737xh7.fsf_-_@corona.pixar.com>
Lines: 90
X-Mailer: Gnus v5.4.17/XEmacs 19.15

--Multipart_Fri_Mar__7_21:40:20_1997-1
Content-Type: text/plain; charset=US-ASCII

Steven L Baur <steve@miranova.com> writes:

> Hunter Kelly writes:
> 
> > It should be easy enough to change 'save-options to not save out faces
> > that have been saved/defined with customize.  I'll go ahead and whip
> > up a patch if people are interested.
> 
> I'm interested, please do it.

Ask, and ye shall receive!

I'm pretty sure the attached patch will prevent faces that have been
customized from getting saved out in .xemacs-options.

This should allow someone who has customized faces to keep all the
customize information in the same place.

It is also possible (I think) to hack edit-faces to munge any font it
changes to forget the fact that it had been customized.  I think this
would allow safe interaction between saving edit-faces faces and
custom faces, but then there is potential for weird lossage.  Also, if
we are going to change edit-faces to browse-faces or something, then I
definitely should not do this, because it will stop people from
conveniently being able to "browse-face" and then save out their faces
with customize-face.  Sort of.  It is more complicated than that,
really.  It could be made to work correctly when I finish my other
deal (see below), but I am not sure if it is worth it.

Thoughts?

> Flawed or not, I've restored edit-faces to the Options menu for the
> next betas.

I am also finishing up some additions to custom that will allow
someone to run customize-face on a face that was not deffaced (or
custom-set-face), yet still retain all the useful information, like
colors, font family, etc.  I'll hopefully get that out early next week.

> -- 
> steve@miranova.com baur
> Unsolicited commercial e-mail will be billed at $250/message.

Hunter


--Multipart_Fri_Mar__7_21:40:20_1997-1
Content-Type: application/octet-stream; type=patch
Content-Disposition: attachment; filename="x-menu.patch"
Content-Transfer-Encoding: 8bit

--- x-menubar.el.orig	Fri Mar  7 21:23:48 1997
+++ x-menubar.el	Fri Mar  7 21:20:33 1997
@@ -1150,7 +1150,7 @@
 	 (cons 'progn
 	       (mapcar #'(lambda (face)
 			   `(make-face ',face))
-		       (face-list))))
+		       (save-options-non-customized-face-list))))
      
      (if options-save-faces
 	 (cons 'progn
@@ -1169,12 +1169,21 @@
 				  (delq 'display-table
 					(copy-sequence
 					 built-in-face-specifiers)))))
-		       (face-list)))))
+		       (save-options-non-customized-face-list)))))
      
      ))
   "The variables to save; or forms to evaluate to get forms to write out.
 This is used by `save-options-menu-settings' and should mirror the
 options listed in the Options menu.")
+
+(defun save-options-non-customized-face-list ()
+  "This function will return a list of all faces that have not been
+'customized'."
+  (delq nil (mapcar '(lambda (face)
+		      (if (not (or (get face 'saved-face)
+				   (get face 'factory-face)))
+			  face))
+		    (face-list))))
 
 (defun save-options-specifier-spec-list (face property)
   (if (not (or (eq property 'font) (eq property 'color)))

--Multipart_Fri_Mar__7_21:40:20_1997-1--

