X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;ds=sidebyside;f=lisp%2Fgnus-bcklg.el;h=5a9cbf6c10f97ff7bad917b8abdff2129cec38fd;hb=bd5c2da9b674dbe4d52c456ce996481be2e8e687;hp=51c6e7f082fccffa8d7b8d34946763e814438dcc;hpb=92590f3fd3b6fce0c7c5dfaf754c095d586051c1;p=gnus diff --git a/lisp/gnus-bcklg.el b/lisp/gnus-bcklg.el index 51c6e7f08..5a9cbf6c1 100644 --- a/lisp/gnus-bcklg.el +++ b/lisp/gnus-bcklg.el @@ -1,5 +1,5 @@ ;;; gnus-bcklg.el --- backlog functions for Gnus -;; Copyright (C) 1996,97,98 Free Software Foundation, Inc. +;; Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen ;; Keywords: news @@ -82,7 +82,9 @@ (setq b (point)) (insert-buffer-substring buffer) ;; Tag the beginning of the article with the ident. - (gnus-put-text-property b (1+ b) 'gnus-backlog ident)))))) + (if (> (point-max) b) + (gnus-put-text-property b (1+ b) 'gnus-backlog ident) + (gnus-error 3 "Article %d is blank" number))))))) (defun gnus-backlog-remove-oldest-article () (save-excursion @@ -124,7 +126,7 @@ t)) (setq gnus-backlog-articles (delq ident gnus-backlog-articles))))))) -(defun gnus-backlog-request-article (group number buffer) +(defun gnus-backlog-request-article (group number &optional buffer) (when (numberp number) (gnus-backlog-setup) (let ((ident (intern (concat group ":" (int-to-string number)) @@ -144,10 +146,12 @@ (setq end (next-single-property-change (1+ beg) 'gnus-backlog (current-buffer) (point-max))))) - (let ((buffer-read-only nil)) - (erase-buffer) - (insert-buffer-substring gnus-backlog-buffer beg end) - t))))) + (save-excursion + (and buffer (set-buffer buffer)) + (let ((buffer-read-only nil)) + (erase-buffer) + (insert-buffer-substring gnus-backlog-buffer beg end))) + t)))) (provide 'gnus-bcklg)