# HG changeset patch # User Katsumi Yamaoka # Date 1276149265 0 # Node ID 35ec0301a7514ae7520b76b4087b6513bbf50b42 # Parent 43f8ac6763d99479fce5ba02945b7efe77f736af# Parent 98ae5d8b7b7298aa730456bc6e4aa18d6ddc0d59 Synch with Gnus trunk. (gnus-mime-buttonized-part-id): New internal variable. (gnus-article-edit-part): Bind it to make last part that is substituted or deleted visible. (gnus-mime-display-single): Buttonize part of which id equals to gnus-mime-buttonized-part-id. diff -r 43f8ac6763d9 -r 35ec0301a751 lisp/gnus/ChangeLog --- a/lisp/gnus/ChangeLog Wed Jun 09 22:42:55 2010 -0700 +++ b/lisp/gnus/ChangeLog Thu Jun 10 05:54:25 2010 +0000 @@ -1,3 +1,11 @@ +2010-06-10 Katsumi Yamaoka + + * gnus-art.el (gnus-mime-buttonized-part-id): New internal variable. + (gnus-article-edit-part): Bind it to make last part that is substituted + or deleted visible. + (gnus-mime-display-single): Buttonize part of which id equals to + gnus-mime-buttonized-part-id. + 2010-06-10 Dan Christensen * gnus-util.el (gnus-user-date): Use gnus-date-get-time. diff -r 43f8ac6763d9 -r 35ec0301a751 lisp/gnus/gnus-art.el --- a/lisp/gnus/gnus-art.el Wed Jun 09 22:42:55 2010 -0700 +++ b/lisp/gnus/gnus-art.el Thu Jun 10 05:54:25 2010 +0000 @@ -4896,6 +4896,10 @@ (t (gnus-article-goto-part n))))) +(defvar gnus-mime-buttonized-part-id nil + "ID of a mime part that should be buttonized. +`gnus-mime-save-part-and-strip' and `gnus-mime-delete-part' bind it.") + (eval-when-compile (defsubst gnus-article-edit-part (handles &optional current-id) "Edit an article in order to delete a mime part. @@ -4938,10 +4942,15 @@ ,(gnus-group-read-only-p) ,gnus-summary-buffer no-highlight)) t) - (gnus-article-edit-done) + ;; Force buttonizing this part. + (let ((gnus-mime-buttonized-part-id current-id)) + (gnus-article-edit-done)) (gnus-configure-windows 'article) (when (and current-id (integerp gnus-auto-select-part)) - (gnus-article-jump-to-part (+ current-id gnus-auto-select-part))))) + (gnus-article-jump-to-part + (min (max (+ current-id gnus-auto-select-part) 1) + (with-current-buffer gnus-article-buffer + (length gnus-article-mime-handle-alist))))))) (defun gnus-mime-replace-part (file) "Replace MIME part under point with an external body." @@ -5844,7 +5853,8 @@ ((or (bobp) (eq (char-before (1- (point))) ?\n)) 0) (t 1)))) (when (or (not display) - (not (gnus-unbuttonized-mime-type-p type))) + (not (gnus-unbuttonized-mime-type-p type)) + (eq id gnus-mime-buttonized-part-id)) (gnus-insert-mime-button handle id (list (or display (and not-attachment text)))) (gnus-article-insert-newline)