diff lisp/gnus/mm-decode.el @ 81154:27cf42dce35e

Merge from gnus--rel--5.10 Patches applied: * gnus--rel--5.10 (patch 226) - Update from CVS 2007-06-04 Katsumi Yamaoka <yamaoka@jpl.org> * lisp/gnus/gnus-art.el (gnus-mime-view-part-externally) (gnus-mime-view-part-internally): Fix predicate function passed to completing-read. * lisp/gnus/mm-decode.el (mm-image-fit-p): Return t if argument is not an image; return t if image size is just the same as window size. Revision: emacs@sv.gnu.org/emacs--devo--0--patch-786
author Miles Bader <miles@gnu.org>
date Wed, 06 Jun 2007 02:19:13 +0000
parents e3694f1cb928
children 24202b793a08 e9f94688a064
line wrap: on
line diff
--- a/lisp/gnus/mm-decode.el	Tue Jun 05 18:29:37 2007 +0000
+++ b/lisp/gnus/mm-decode.el	Wed Jun 06 02:19:13 2007 +0000
@@ -1371,18 +1371,19 @@
 (defun mm-image-fit-p (handle)
   "Say whether the image in HANDLE will fit the current window."
   (let ((image (mm-get-image handle)))
-    (if (fboundp 'glyph-width)
-	;; XEmacs' glyphs can actually tell us about their width, so
-	;; lets be nice and smart about them.
-	(or mm-inline-large-images
-	    (and (< (glyph-width image) (window-pixel-width))
-		 (< (glyph-height image) (window-pixel-height))))
-      (let* ((size (image-size image))
-	     (w (car size))
-	     (h (cdr size)))
-	(or mm-inline-large-images
-	    (and (< h (1- (window-height))) ; Don't include mode line.
-		 (< w (window-width))))))))
+    (or (not image)
+	(if (fboundp 'glyph-width)
+	    ;; XEmacs' glyphs can actually tell us about their width, so
+	    ;; lets be nice and smart about them.
+	    (or mm-inline-large-images
+		(and (<= (glyph-width image) (window-pixel-width))
+		     (<= (glyph-height image) (window-pixel-height))))
+	  (let* ((size (image-size image))
+		 (w (car size))
+		 (h (cdr size)))
+	    (or mm-inline-large-images
+		(and (<= h (1- (window-height))) ; Don't include mode line.
+		     (<= w (window-width)))))))))
 
 (defun mm-valid-image-format-p (format)
   "Say whether FORMAT can be displayed natively by Emacs."