From 0d435d8722f488ba2d160ad4907055476fe65e3f Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Mon, 30 Aug 2010 21:46:04 +0200 Subject: [PATCH] Don't do images on non-graphic displays. --- lisp/ChangeLog | 5 +++-- lisp/gnus-html.el | 34 ++++++++++++++++++---------------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e1341dccb..6471166d2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,12 +1,13 @@ 2010-08-30 Lars Magne Ingebrigtsen * gnus-html.el (gnus-html-put-image): Use gnus-create-image to be - XEmacs-compatible. + XEmacs-compatible. + (gnus-html-put-image): Don't do images on non-graphic displays. * nnslashdot.el: Removed this unused backend. * gnus-undo.el (gnus-undo-register-1): Limit the undo actions to 100 - actions. + actions. (gnus-undo-register-1): Revert last change. * gnus-group.el (gnus-group-completing-read): Protect against not diff --git a/lisp/gnus-html.el b/lisp/gnus-html.el index bbf83d325..cabfe3451 100644 --- a/lisp/gnus-html.el +++ b/lisp/gnus-html.el @@ -162,22 +162,24 @@ (gnus-html-schedule-image-fetching buffer images))))) (defun gnus-html-put-image (file point) - (let ((image (ignore-errors - (gnus-create-image file)))) - (save-excursion - (goto-char point) - (if (and image - ;; Kludge to avoid displaying 30x30 gif images, which - ;; seems to be a signal of a broken image. - (not (and (eq (getf (cdr image) :type) 'gif) - (= (car (image-size image t)) 30) - (= (cdr (image-size image t)) 30)))) - (progn - (gnus-put-image image) - t) - (when (fboundp 'find-image) - (gnus-put-image (find-image '((:type xpm :file "lock-broken.xpm"))))) - nil)))) + (when (display-graphic-p) + (let ((image (ignore-errors + (gnus-create-image file)))) + (save-excursion + (goto-char point) + (if (and image + ;; Kludge to avoid displaying 30x30 gif images, which + ;; seems to be a signal of a broken image. + (not (and (eq (getf (cdr image) :type) 'gif) + (= (car (image-size image t)) 30) + (= (cdr (image-size image t)) 30)))) + (progn + (gnus-put-image image) + t) + (when (fboundp 'find-image) + (gnus-put-image (find-image + '((:type xpm :file "lock-broken.xpm"))))) + nil))))) (defun gnus-html-prune-cache () (let ((total-size 0) -- 2.25.1