This commit was generated by cvs2svn to compensate for changes in r4995,
[chise/xemacs-chise.git.1] / lisp / font.el
index b6baa29..db52f88 100644 (file)
@@ -299,7 +299,7 @@ for use in the 'weight' field of an X font string.")
       w2))))
 
 (defun font-spatial-to-canonical (spec &optional device)
-  "Convert SPEC (in inches, millimeters, points, or picas) into points"
+  "Convert SPEC (in inches, millimeters, points, or picas) into points."
   ;; 1 in = 6 pa = 25.4 mm = 72 pt
   (cond
    ((numberp spec)
@@ -596,9 +596,10 @@ for use in the 'weight' field of an X font string.")
 ;;;###autoload
 (defun font-default-object-for-device (&optional device)
   (let ((font (font-default-font-for-device device)))
-    (unless (cdr-safe (assoc font font-default-cache))
-      (push (cons font (font-create-object font)) font-default-cache)
-      (cdr-safe (assoc font font-default-cache)))))
+    (or (cdr-safe (assoc font font-default-cache))
+       (let ((object (font-create-object font)))
+         (push (cons font object) font-default-cache)
+         object))))
 
 ;;;###autoload
 (defun font-default-family-for-device (&optional device)