Katsumi Yamaoka <yamaoka(a)jpl.org> writes:
In the file lisp/faces.el:
(defun set-face-stipple (face pixmap &optional frame)
"[...]"
(while (not (find-face face))
(setq face (signal 'wrong-type-argument (list 'facep face))))
(locate-file pixmap x-bitmap-file-path '(".xbm" ""))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
why is the line here? It causes an error as follows:
The intention was to search for the file over x-bitmap-file-path.
However, it didn't work out because it was placed before the check
whether PIXMAP is a list.
Also, that line of code doesn't setq anything, meaning it doesn't
really do anything.
Could you try this version, which I think does everything the original
function was intended to do. Kyle, please review.
2000-03-23 Hrvoje Niksic <hniksic(a)iskon.hr>
* faces.el (set-face-stipple): Rewrite to correctly handle PIXMAP
being a list. Actually define `stipple-pixmap-p' which is used as
an error predicate. Correctly handle PIXMAP being either relative
or absolute file name.
--- lisp/faces.el.orig Thu Mar 23 14:39:24 2000
+++ lisp/faces.el Thu Mar 23 14:54:25 2000
@@ -1607,20 +1607,28 @@
in that frame; otherwise change each frame."
(while (not (find-face face))
(setq face (signal 'wrong-type-argument (list 'facep face))))
- (locate-file pixmap x-bitmap-file-path '(".xbm" ""))
- (while (cond ((stringp pixmap)
- (unless (file-readable-p pixmap)
- (setq pixmap `[xbm :file ,pixmap]))
- nil)
- ((and (consp pixmap) (= (length pixmap) 3))
- (setq pixmap `[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))
+ (let (instantiator)
+ (while
+ (null
+ (setq instantiator
+ (cond ((stringp pixmap)
+ (let ((file (if (file-name-absolute-p pixmap)
+ pixmap
+ (locate-file pixmap x-bitmap-file-path
+ '(".xbm" "")))))
+ (and file
+ `[xbm :file ,file])))
+ ((and (listp pixmap) (= (length pixmap) 3))
+ `[xbm :data ,pixmap])
+ (t nil))))
+ (flet ((stipple-pixmap-p (pixmap)
+ (or (stringp pixmap)
+ (and (listp pixmap) (= (length pixmap) 3)))))
+ (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 instantiator frame)))
;; Create the remaining standard faces now. This way, packages that we dump