-If `uncompface-use-external' is non-nil, it requires the external
-programs `uncompface', and `icontopbm'. On a GNU/Linux system these
-might be in packages with names like `compface' or `faces-xface' and
-`netpbm' or `libgr-progs', for instance."
- (if uncompface-use-external
- (with-temp-buffer
- (insert face)
- (and (eq 0 (apply 'call-process-region (point-min) (point-max)
- "uncompface"
- 'delete '(t nil) nil))
- (progn
- (goto-char (point-min))
- (insert "/* Width=48, Height=48 */\n")
- ;; I just can't get "icontopbm" to work correctly on its
- ;; own in XEmacs. And Emacs doesn't understand un-raw pbm
- ;; files.
- (if (not (featurep 'xemacs))
- (eq 0 (call-process-region (point-min) (point-max)
- "icontopbm"
- 'delete '(t nil)))
- (shell-command-on-region (point-min) (point-max)
- "icontopbm | pnmnoraw"
- (current-buffer) t)
- t))
- (buffer-string)))
- (uncompface-internal face)))
+If `uncompface-use-external' is t, it requires the external programs
+`uncompface', and `icontopbm'. On a GNU/Linux system these might be
+in packages with names like `compface' or `faces-xface' and `netpbm'
+or `libgr-progs', for instance."
+ (cond ((eq uncompface-use-external nil)
+ (uncompface-internal face))
+ ((eq uncompface-use-external t)
+ (with-temp-buffer
+ (insert face)
+ (and (eq 0 (apply 'call-process-region (point-min) (point-max)
+ "uncompface"
+ 'delete '(t nil) nil))
+ (progn
+ (goto-char (point-min))
+ (insert "/* Width=48, Height=48 */\n")
+ ;; I just can't get "icontopbm" to work correctly on its
+ ;; own in XEmacs. And Emacs doesn't understand un-raw pbm
+ ;; files.
+ (if (not (featurep 'xemacs))
+ (eq 0 (call-process-region (point-min) (point-max)
+ "icontopbm"
+ 'delete '(t nil)))
+ (shell-command-on-region (point-min) (point-max)
+ "icontopbm | pnmnoraw"
+ (current-buffer) t)
+ t))
+ (buffer-string))))
+ (t
+ (let* ((gc-cons-threshold (eval '(lsh -1 -1)))
+ (start (current-time)))
+ (prog1
+ (uncompface-internal face)
+ (setq uncompface-use-external
+ (and (> (- (uncompface-float-time (current-time))
+ (uncompface-float-time start))
+ uncompface-use-external-threshold)
+ (executable-find "uncompface")
+ (executable-find "icontopbm")
+ t))
+ (message "Setting `uncompface-use-external' to `%s'"
+ uncompface-use-external))))))