From: ShengHuo ZHU Date: Fri, 23 Feb 2001 13:39:11 +0000 (+0000) Subject: 2001-02-23 08:00:00 ShengHuo ZHU X-Git-Url: http://cgit.sxemacs.org/?a=commitdiff_plain;h=c9a50707cf29a345e2538a1c193d98f9a67734eb;p=gnus 2001-02-23 08:00:00 ShengHuo ZHU * nneething.el (nneething-get-head): Insert unreadable file too. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1abd23223..d3dcd36a6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2001-02-23 08:00:00 ShengHuo ZHU + + * nneething.el (nneething-get-head): Insert unreadable file too. + 2001-02-22 23:00:00 ShengHuo ZHU * gnus-sum.el (gnus-summary-insert-articles): Remove fetched headers. diff --git a/lisp/nneething.el b/lisp/nneething.el index a9c3bb62e..1d83717a8 100644 --- a/lisp/nneething.el +++ b/lisp/nneething.el @@ -1,6 +1,6 @@ ;;; nneething.el --- arbitrary file access for Gnus -;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 +;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001 ;; Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen @@ -272,11 +272,11 @@ included.") (insert-buffer-substring nneething-work-buffer) (goto-char (point-max)))) -(defun nneething-make-head (file &optional buffer) +(defun nneething-make-head (file &optional buffer extra-msg) "Create a head by looking at the file attributes of FILE." (let ((atts (file-attributes file))) (insert - "Subject: " (file-name-nondirectory file) "\n" + "Subject: " (file-name-nondirectory file) (or extra-msg "") "\n" "Message-ID: \n" @@ -344,18 +344,22 @@ included.") (nneething-make-head file) t) (t ;; We examine the file. - (nnheader-insert-head file) - (if (nnheader-article-p) - (delete-region - (progn - (goto-char (point-min)) - (or (and (search-forward "\n\n" nil t) + (condition-case () + (progn + (nnheader-insert-head file) + (if (nnheader-article-p) + (delete-region + (progn + (goto-char (point-min)) + (or (and (search-forward "\n\n" nil t) (1- (point))) - (point-max))) - (point-max)) - (goto-char (point-min)) - (nneething-make-head file (current-buffer)) - (delete-region (point) (point-max))) + (point-max))) + (point-max)) + (goto-char (point-min)) + (nneething-make-head file (current-buffer)) + (delete-region (point) (point-max)))) + (file-error + (nneething-make-head file (current-buffer) " (unreadable)"))) t)))) (defun nneething-file-name (article)