From: hayashi Date: Thu, 7 Oct 1999 10:10:08 +0000 (+0000) Subject: * lisp/gnus.el (gnus-revision-number): Increment to 05. X-Git-Tag: t-gnus-6_13_2-05 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1184ed3ccaa26a6aebd1cf67736248dffc7244af;p=elisp%2Fgnus.git- * lisp/gnus.el (gnus-revision-number): Increment to 05. * gnus-art.el (gnus-treat-predicate): Examine whether the argument is list or not before condition. * gnus-art.el (gnus-treat-predicate): Work for (typep "something"). * lisp/gnus-art.el (gnus-article-prepare-display): Pass argument nil as a condition to gnus-treat-article. * lisp/gnus-art.el (gnus-article-prepare-mime-display):Ditto. Also, treat last part of multipart article correctly. --- diff --git a/ChangeLog b/ChangeLog index 209756b..c66b822 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +1999-10-07 Yoshiki Hayashi + + * lisp/gnus.el (gnus-revision-number): Increment to 05. + +1999-10-07 Katsumi Yamaoka + + * gnus-art.el (gnus-treat-predicate): Examine whether the argument + is list or not before condition. + +1999-10-07 Yoshiki Hayashi + + * gnus-art.el (gnus-treat-predicate): Work for (typep "something"). + +1999-10-07 Yoshiki Hayashi + + * lisp/gnus-art.el (gnus-article-prepare-display): + Pass argument nil as a condition to gnus-treat-article. + * lisp/gnus-art.el (gnus-article-prepare-mime-display): + Ditto. Also, treat last part of multipart article correctly. + 1999-10-06 Katsumi Yamaoka * lisp/gnus.el (gnus-revision-number): Increment to 04. diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 95ccf95..1f90a78 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -2922,8 +2922,12 @@ If ALL-HEADERS is non-nil, no headers are hidden." (let* ((entity (if (eq 1 (point-min)) (get-text-property 1 'mime-view-entity) (get-text-property (point) 'mime-view-entity))) - (number (or number 0)) - next type ids) + last-entity child-entity next type) + (setq child-entity (mime-entity-children entity)) + (if child-entity + (setq last-entity (nth (1- (length child-entity)) + child-entity)) + (setq last-entity entity)) (save-restriction (narrow-to-region (point) (if (search-forward "\n\n" nil t) @@ -2934,8 +2938,10 @@ If ALL-HEADERS is non-nil, no headers are hidden." (goto-char (point-max))) (while (and (not (eobp)) entity - (setq next (next-single-property-change (point) - 'mime-view-entity))) + (setq next + (or (next-single-property-change (point) + 'mime-view-entity) + (point-max)))) (let ((types (mime-entity-content-type entity))) (while (eq 'multipart (mime-content-type-primary-type types)) (setq entity (car (mime-entity-children entity)) @@ -2945,34 +2951,37 @@ If ALL-HEADERS is non-nil, no headers are hidden." (mime-content-type-primary-type types) (mime-content-type-subtype types))))) (if (string-equal type "message/rfc822") - (save-restriction - (narrow-to-region (point) (point-max)) - (gnus-article-prepare-mime-display number) - (goto-char (point-max))) - (setq ids (length (mime-entity-node-id entity)) - entity (get-text-property next 'mime-view-entity) - number (1+ number)) + (let ((start (point)) last-children) + (setq last-children + (nth (1- (length (mime-entity-children entity))) + (mime-entity-children entity))) + (while (and + (not (eq last-children + (get-text-property (point) 'mime-view-entity))) + (setq next + (next-single-property-change (point) + 'mime-view-entity))) + (goto-char next)) + (setq next + (1- (or (next-single-property-change (point) + 'mime-view-entity) + (point-max)))) + (goto-char start) + (save-restriction + (narrow-to-region start next ) + (gnus-article-prepare-mime-display)) + (goto-char (1+ next)) + (setq entity (get-text-property (point) 'mime-view-entity))) (save-restriction (narrow-to-region (point) next) - (if (or (null entity) - (< (length (mime-entity-node-id entity)) ids)) - (gnus-treat-article 'last number number type) - (gnus-treat-article t number nil type)) - (goto-char (point-max))))) - (unless (eobp) - (save-restriction - (narrow-to-region (point) (point-max)) - (if entity - (progn - (setq type (mime-entity-content-type entity) - type (format "%s/%s" - (mime-content-type-primary-type type) - (mime-content-type-subtype type))) - (if (string-equal type "message/rfc822") - (gnus-article-prepare-mime-display number) - (incf number) - (gnus-treat-article 'last number number type))) - (gnus-treat-article t)))))) + ;; Kludge. We have to count true number, but for now, + ;; part number is here only to achieve `last'. + (gnus-treat-article nil 1 + (if (eq entity last-entity) + 1 2) + type) + (setq entity (get-text-property next 'mime-view-entity)) + (goto-char (point-max))))))) ;;;###autoload (defun gnus-article-prepare-display () @@ -3013,7 +3022,7 @@ If ALL-HEADERS is non-nil, no headers are hidden." (goto-char (point-max)) (widen) (narrow-to-region (point) (point-max)) - (gnus-treat-article t)) + (gnus-treat-article nil)) (put-text-property (point-min) (point-max) 'read-only nil))) ;; Perform the article display hooks. Incidentally, this hook is ;; an obsolete variable by now. @@ -4973,10 +4982,13 @@ For example: (defvar length) (defun gnus-treat-predicate (val) (cond - ((eq val 'mime) - (not (not gnus-show-mime))) ((null val) nil) + ((and (listp val) + (stringp (car val))) + (apply 'gnus-or (mapcar `(lambda (s) + (string-match s ,(or gnus-newsgroup-name ""))) + val))) ((listp val) (let ((pred (pop val))) (cond @@ -4987,24 +4999,21 @@ For example: ((eq pred 'not) (not (gnus-treat-predicate (car val)))) ((eq pred 'typep) - (equal (cadr val) type)) + (equal (car val) type)) (t - (gnus-treat-predicate pred))))) - ((eq val t) - t) + (error "%S is not a valid predicate" pred))))) + ((eq val 'mime) + gnus-show-mime) (condition (eq condition val)) + ((eq val t) + t) ((eq val 'head) nil) ((eq val 'last) (eq part-number total-parts)) ((numberp val) (< length val)) - ((and (listp val) - (stringp (car val))) - (apply 'gnus-or (mapcar `(lambda (s) - (string-match s ,(or gnus-newsgroup-name ""))) - val))) (t (error "%S is not a valid value" val)))) diff --git a/lisp/gnus.el b/lisp/gnus.el index 614dcdb..c6c9f75 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -4,7 +4,7 @@ ;; Author: Masanobu UMEDA ;; Lars Magne Ingebrigtsen ;; Tatsuya Ichikawa -;; Yoshiki Hayashi +;; Yoshiki Hayashi ;; Keywords: news, mail ;; This file is part of GNU Emacs. @@ -269,7 +269,7 @@ is restarted, and sometimes reloaded." (defconst gnus-version-number "6.13.2" "Version number for this version of gnus.") -(defconst gnus-revision-number "04" +(defconst gnus-revision-number "05" "Revision number for this version of gnus.") (defconst gnus-original-version-number "0.97"