HTML + multipart/related support
[gnus] / lisp / gnus-art.el
index 20b63f7..06792b8 100644 (file)
@@ -4696,9 +4696,6 @@ If ALL-HEADERS is non-nil, no headers are hidden."
            (when (or (numberp article)
                      (stringp article))
              (gnus-article-prepare-display)
-             ;; Add attachment buttons to the header.
-             (when gnus-mime-display-attachment-buttons-in-header
-               (gnus-mime-buttonize-attachments-in-header))
              ;; Do page break.
              (goto-char (point-min))
              (when gnus-break-pages
@@ -4729,7 +4726,10 @@ If ALL-HEADERS is non-nil, no headers are hidden."
          gnus-article-image-alist nil)
     (gnus-run-hooks 'gnus-tmp-internal-hook)
     (when gnus-display-mime-function
-      (funcall gnus-display-mime-function))))
+      (funcall gnus-display-mime-function))
+    ;; Add attachment buttons to the header.
+    (when gnus-mime-display-attachment-buttons-in-header
+      (gnus-mime-buttonize-attachments-in-header))))
 
 ;;;
 ;;; Gnus Sticky Article Mode
@@ -5678,8 +5678,11 @@ all parts."
   "Go to MIME part N."
   (when gnus-break-pages
     (widen))
+  (article-goto-body)
   (prog1
-      (let ((start (text-property-any (point-min) (point-max) 'gnus-part n))
+      (let ((start (or (text-property-any (point) (point-max) 'gnus-part n)
+                      ;; There may be header buttons.
+                      (text-property-any (point-min) (point) 'gnus-part n)))
            part handle end next handles)
        (when start
          (goto-char start)
@@ -6252,8 +6255,13 @@ in the body.  Use `gnus-header-face-alist' to highlight buttons."
                                                     (cdr handle)))))))
              (setq flat (cdr flat))
              (mapc (lambda (handle)
-                     (setcar handle (mapconcat 'number-to-string (car handle)
-                                               ".")))
+                     (if (cdar handle)
+                         ;; This is a hidden (i.e. unnumbered) handle.
+                         (progn
+                           (setcar handle
+                                   (1+ (caar gnus-article-mime-handle-alist)))
+                           (push handle gnus-article-mime-handle-alist))
+                       (setcar handle (caar handle))))
                    flat)
              flat))))
       (let ((case-fold-search t) buttons st)