bongo-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bongo-patches] Check calls to `face-font' and `font-info' for nil retur


From: Daniel Brockman
Subject: [bongo-patches] Check calls to `face-font' and `font-info' for nil return values
Date: Sun, 31 Dec 2006 11:21:01 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Romain says the call to `face-font' returns nil on Emacs 21.

Sun Dec 31 11:19:15 CET 2006  Daniel Brockman <address@hidden>

 * Check calls to `face-font' and `font-info' for nil
   return values.

diff -rN -u old-bongo/bongo.el new-bongo/bongo.el
--- old-bongo/bongo.el  2006-12-31 11:19:56.000000000 +0100
+++ new-bongo/bongo.el  2006-12-31 11:19:56.000000000 +0100
@@ -1188,7 +1188,10 @@
 
 (defun bongo-mode-line-icon-size ()
   "Return the size to use for mode line icons."
-  (let ((font-size (aref (font-info (face-font 'mode-line)) 3)))
+  (let ((font-size (catch 'abort
+                     (aref (or (font-info (or (face-font 'mode-line)
+                                              (throw 'abort 0)))
+                               (throw 'abort 0)) 3))))
     (if (>= font-size 18) 18 11)))
 
 (defun bongo-mode-line-start-button ()
-- 
Daniel Brockman <address@hidden>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]