import xemacs-21.2.37
[chise/xemacs-chise.git.1] / lisp / x-faces.el
index 46677cf..aabfe87 100644 (file)
@@ -3,7 +3,7 @@
 ;; Copyright (C) 1992-4, 1997 Free Software Foundation, Inc.
 ;; Copyright (C) 1995, 1996 Ben Wing.
 
-;; Author: Jamie Zawinski <jwz@netscape.com>
+;; Author: Jamie Zawinski <jwz@jwz.org>
 ;; Maintainer: XEmacs Development Team
 ;; Keywords: extensions, internal, dumped
 
       (encoding        "[^-]+")                ; false!
       )
   (setq x-font-regexp
-       (purecopy
-        (concat "\\`\\*?[-?*]"
-                foundry - family - weight\? - slant\? - swidth - adstyle -
-                pixelsize - pointsize - resx - resy - spacing - avgwidth -
-                registry - encoding "\\'"
-                )))
+       (concat "\\`\\*?[-?*]"
+               foundry - family - weight\? - slant\? - swidth - adstyle -
+               pixelsize - pointsize - resx - resy - spacing - avgwidth -
+               registry - encoding "\\'"
+               ))
   (setq x-font-regexp-head
-       (purecopy
-          (concat "\\`[-?*]" foundry - family - weight\? - slant\?
-                 "\\([-*?]\\|\\'\\)")))
+       (concat "\\`[-?*]" foundry - family - weight\? - slant\?
+               "\\([-*?]\\|\\'\\)"))
   (setq x-font-regexp-head-2
-       (purecopy
-          (concat "\\`[-?*]" foundry - family - weight\? - slant\?
-                 - swidth - adstyle - pixelsize - pointsize
-                 "\\([-*?]\\|\\'\\)")))
-  (setq x-font-regexp-slant (purecopy (concat - slant -)))
-  (setq x-font-regexp-weight (purecopy (concat - weight -)))
+       (concat "\\`[-?*]" foundry - family - weight\? - slant\?
+               - swidth - adstyle - pixelsize - pointsize
+               "\\([-*?]\\|\\'\\)"))
+  (setq x-font-regexp-slant (concat - slant -))
+  (setq x-font-regexp-weight (concat - weight -))
   ;; if we can't match any of the more specific regexps (unfortunate) then
   ;; look for digits; assume 2+ digits is 10ths of points, and 1-2 digits
   ;; is pixels.  Bogus as hell.
-  (setq x-font-regexp-pixel (purecopy "[-?*]\\([0-9][0-9]?\\)[-?*]"))
-  (setq x-font-regexp-point (purecopy "[-?*]\\([0-9][0-9]+\\)[-?*]"))
+  (setq x-font-regexp-pixel "[-?*]\\([0-9][0-9]?\\)[-?*]")
+  (setq x-font-regexp-point "[-?*]\\([0-9][0-9]+\\)[-?*]")
   ;; the following two are used by x-font-menu.el.
   (setq x-font-regexp-foundry-and-family
-       (purecopy (concat "\\`[-?*]" foundry - "\\(" family "\\)" -)))
+       (concat "\\`[-?*]" foundry - "\\(" family "\\)" -))
   (setq x-font-regexp-registry-and-encoding
-       (purecopy (concat - "\\(" registry "\\)" - "\\(" encoding "\\)\\'")))
+       (concat - "\\(" registry "\\)" - "\\(" encoding "\\)\\'"))
   (setq x-font-regexp-spacing
-       (purecopy (concat - "\\(" spacing "\\)" - avgwidth
-                         - registry - encoding "\\'")))
+       (concat - "\\(" spacing "\\)" - avgwidth
+                         - registry - encoding "\\'"))
   )
 
 ;; A "loser font" is something like "8x13" -> "8x13bold".
 ;; These are supported only through extreme generosity.
-(defconst x-loser-font-regexp (purecopy "\\`[0-9]+x[0-9]+\\'"))
+(defconst x-loser-font-regexp "\\`[0-9]+x[0-9]+\\'")
 
 (defun x-frob-font-weight (font which)
   (if (font-instance-p font) (setq font (font-instance-name font)))
@@ -203,7 +200,7 @@ If it fails, it returns nil."
   "Given an X font specification, this attempts to make a `bold-italic' font.
 If it fails, it returns nil."
   ;; This is haired up to avoid loading the "intermediate" fonts.
-  (if *try-oblique-before-italic-fonts*
+  (if try-oblique-before-italic-fonts
       (or (try-font-name
           (x-frob-font-slant (x-frob-font-weight font "bold") "o") device)
          (try-font-name
@@ -492,11 +489,13 @@ Otherwise, it returns the next larger version of this font that is defined."
             (or (null locale) (eq locale 'global)))
        (progn
          (or fn (setq fn (x-get-resource
-                          "font" "Font" 'string locale)))
+                          "font" "Font" 'string locale nil 'warn)))
          (or fg (setq fg (x-get-resource
-                          "foreground" "Foreground" 'string locale)))
+                          "foreground" "Foreground" 'string locale nil
+                          'warn)))
          (or bg (setq bg (x-get-resource
-                          "background" "Background" 'string locale)))))
+                          "background" "Background" 'string locale nil
+                          'warn)))))
     ;;
     ;; "*cursorColor: foo" is equivalent to setting the background of the
     ;; text-cursor face.
@@ -504,7 +503,8 @@ Otherwise, it returns the next larger version of this font that is defined."
     (if (and (eq (face-name face) 'text-cursor)
             (or (null locale) (eq locale 'global)))
        (setq bg (or (x-get-resource
-                     "cursorColor" "CursorColor" 'string locale) bg)))
+                     "cursorColor" "CursorColor" 'string locale nil 'warn)
+                    bg)))
     ;; #### should issue warnings?  I think this should be
     ;; done when the instancing actually happens, but I'm not
     ;; sure how it should actually be dealt with.
@@ -735,7 +735,8 @@ Otherwise, it returns the next larger version of this font that is defined."
   ;; If reverseVideo was specified, swap the foreground and background
   ;; of the default and modeline faces.
   ;;
-  (cond ((car (x-get-resource "reverseVideo" "ReverseVideo" 'boolean frame))
+  (cond ((car (x-get-resource "reverseVideo" "ReverseVideo" 'boolean frame
+                             nil 'warn))
         ;; First make sure the modeline has fg and bg, inherited from the
         ;; current default face - for the case where only one is specified,
         ;; so that invert-face doesn't do something weird.