gnus-art.el (gnus-mime-buttonize-attachments-in-header): Number unnumbered MIME handles
authorKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 10 Feb 2014 00:17:50 +0000 (00:17 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 10 Feb 2014 00:17:50 +0000 (00:17 +0000)
gnus-art.el (gnus-article-goto-part): Find a button in the body first.
 (gnus-mime-buttonize-attachments-in-header): Number hidden buttons.

lisp/ChangeLog
lisp/gnus-art.el

index c8d5082..fb165c6 100644 (file)
@@ -1,3 +1,8 @@
+2014-02-10  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-art.el (gnus-article-goto-part): Find a button in the body first.
+       (gnus-mime-buttonize-attachments-in-header): Number hidden buttons.
+
 2014-02-09  Lars Ingebrigtsen  <larsi@gnus.org>
 
        * message.el (message-tab): Mention what happens on normal tabs
index 20b63f7..eb57a55 100644 (file)
@@ -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)