From xemacs-m  Sat Mar 29 17:52:31 1997
Received: from crystal.WonderWorks.COM (crystal.WonderWorks.com [192.203.206.1])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id RAA19630
	for <xemacs-beta@xemacs.org>; Sat, 29 Mar 1997 17:52:30 -0600 (CST)
Received: by crystal.WonderWorks.COM 
	id QQcjal20698; Sat, 29 Mar 1997 18:52:25 -0500 (EST)
Date: Sat, 29 Mar 1997 18:52:25 -0500 (EST)
Message-Id: <QQcjal20698.199703292352@crystal.WonderWorks.COM>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From: Kyle Jones <kyle_jones@wonderworks.com>
To: <xemacs-beta@xemacs.org>
Subject: Re: set-face-stipple (was: Re: migrating from .xemacs-options to customize)
In-Reply-To: <rjsp1ezb09.fsf@zuse.dina.kvl.dk>
References: <199703280336.UAA20369@branagh.ta52.lanl.gov>
	<rjiv2c5pnv.fsf@zuse.dina.kvl.dk>
	<rvybb74xee.fsf@sdnp5.ucsd.edu>
	<199703282119.OAA22181@branagh.ta52.lanl.gov>
	<199703282133.QAA29669@amber.vis-av.com>
	<rjzpvn3csu.fsf@zuse.dina.kvl.dk>
	<199703290019.QAA04650@bittersweet.inetarena.com>
	<rjpvwj2d26.fsf_-_@zuse.dina.kvl.dk>
	<QQcizy17636.199703292032@crystal.WonderWorks.COM>
	<rjsp1ezb09.fsf@zuse.dina.kvl.dk>
X-Mailer: VM 6.23 under 19.15 XEmacs Lucid
X-Face: /cA45WHG7jWq>(O3&Z57Y<"WsX5ddc,4c#w0F*zrV#=M
        0@~@,s;b,aMtR5Sqs"+nU.z^CSFQ9t`z2>W,S,]:[+2^
        Nbf6v4g>!&,7R4Ot4Wg{&tm=WX7P["9%a)_da48-^tGy
        ,qz]Z,Zz\{E.,]'EO+F)@$KtF&V

Per Abrahamsen writes:
 > 
 > Kyle Jones <kyle_jones@wonderworks.com> writes:
 > 
 > > What does set-face-background-pixmap do that makes it unsuitable
 > > for use in places where set-face-stipple would be used?
 > 
 > `set-face-background-pixmap' does not look in `x-bitmap-file-path'.
 > 
 > One could write a wrapper that did just that, but a full emulation of
 > `set-face-stipple' would be more generally useful.

Try this.  Make sure x-bitmap-file-path is set to the proper
directory on your system; it isn't on mine.

(defun set-face-stipple (face pixmap &optional frame)
  "Change the stipple pixmap of face FACE to PIXMAP.
PIXMAP should be a string, the name of a file of pixmap data.
The directories listed in the `x-bitmap-file-path' variable are searched.

Alternatively, PIXMAP may be a list of the form (WIDTH HEIGHT DATA)
where WIDTH and HEIGHT are the size in pixels,
and DATA is a string, containing the raw bits of the bitmap.  

If the optional FRAME argument is provided, change only
in that frame; otherwise change each frame."
  (while (not (find-face face))
    (setq face (signal 'wrong-type-argument (list 'facep face))))
  (while (cond ((stringp pixmap)
		(setq pixmap (vector 'xbm ':file pixmap))
		nil)
	       ((and (consp pixmap) (= (length pixmap) 3))
		(setq pixmap (vector 'xbm ':data pixmap))
		nil)
	       (t t))
    (setq pixmap (signal 'wrong-type-argument
			 (list 'stipple-pixmap-p pixmap))))
  (while (and frame (not (framep frame)))
    (setq frame (signal 'wrong-type-argument (list 'framep frame))))
  (set-face-background-pixmap face pixmap frame))

