(gnus-article-set-window-start): Do nothing when the article buffer does not have...
[gnus] / lisp / gnus-ems.el
index dcea8f6..4b49ccc 100644 (file)
@@ -1,6 +1,7 @@
 ;;; gnus-ems.el --- functions for making Gnus work under different Emacsen
-;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
-;;        Free Software Foundation, Inc.
+
+;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+;;   2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news
@@ -19,8 +20,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
 
 (defun gnus-image-type-available-p (type)
   (and (fboundp 'image-type-available-p)
-       (image-type-available-p type)))
+       (image-type-available-p type)
+       (if (fboundp 'display-images-p)
+          (display-images-p)
+        t)))
 
 (defun gnus-create-image (file &optional type data-p &rest props)
   (let ((face (plist-get props :face)))
                    (and (setq start
                               (next-single-property-change start 'display))
                         (setq val (get-text-property start 'display)))))
-      (setq end (next-single-property-change start 'display))
+      (setq end (or (next-single-property-change start 'display)
+                   (point-max)))
       (if (and (equal val image)
               (equal (get-text-property start 'gnus-image-category)
                      category))
            (put-text-property start end 'display nil)
            (when (get-text-property start 'gnus-image-text-deletable)
              (delete-region start end)))
-       (setq start end
-             end nil)))))
+       (unless (= end (point-max))
+         (setq start end
+               end nil))))))
 
 (provide 'gnus-ems)