gnus-art.el (gnus-article-goto-part): Fix last change
authorKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 29 Oct 2010 07:19:07 +0000 (07:19 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 29 Oct 2010 07:19:07 +0000 (07:19 +0000)
lisp/gnus-art.el

index 235aa87..551c7ab 100644 (file)
@@ -5563,36 +5563,39 @@ all parts."
   "Go to MIME part N."
   (when gnus-break-pages
     (widen))
-  (let ((start (text-property-any (point-min) (point-max) 'gnus-part n))
-       part handle end next handles)
-    (when start
-      (goto-char start)
-      (unless (setq handle (get-text-property start 'gnus-data))
-       ;; Go to the displayed subpart, assuming this is multipart/alternative.
-       (setq part start
-             end (point-at-eol))
-       (while (and (not handle)
-                   part
-                   (< part end)
-                   (setq next (text-property-not-all part end
-                                                     'gnus-data nil)))
-         (setq part next
-               handle (get-text-property part 'gnus-data))
-         (push (cons handle part) handles)
-         (unless (mm-handle-displayed-p handle)
-           (setq handle nil
-                 part (text-property-any part end 'gnus-data nil))))
-       (unless handle
-         ;; No subpart is displayed, so we find preferred one.
-         (setq part
-               (cdr (assq (mm-preferred-alternative
-                           (nreverse (mapcar 'car handles)))
-                          handles)))))
-      (when gnus-break-pages
-       (gnus-narrow-to-page))
-      (if part
-         (goto-char (1+ part))
-       start))))
+  (prog1
+      (let ((start (text-property-any (point-min) (point-max) 'gnus-part n))
+           part handle end next handles)
+       (when start
+         (goto-char start)
+         (if (setq handle (get-text-property start 'gnus-data))
+             start
+           ;; Go to the displayed subpart, assuming this is
+           ;; multipart/alternative.
+           (setq part start
+                 end (point-at-eol))
+           (while (and (not handle)
+                       part
+                       (< part end)
+                       (setq next (text-property-not-all part end
+                                                         'gnus-data nil)))
+             (setq part next
+                   handle (get-text-property part 'gnus-data))
+             (push (cons handle part) handles)
+             (unless (mm-handle-displayed-p handle)
+               (setq handle nil
+                     part (text-property-any part end 'gnus-data nil))))
+           (unless handle
+             ;; No subpart is displayed, so we find preferred one.
+             (setq part
+                   (cdr (assq (mm-preferred-alternative
+                               (nreverse (mapcar 'car handles)))
+                              handles)))))
+         (if part
+             (goto-char (1+ part))
+           start)))
+    (when gnus-break-pages
+      (gnus-narrow-to-page))))
 
 (defun gnus-insert-mime-button (handle gnus-tmp-id &optional displayed)
   (let ((gnus-tmp-name