emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 2ef880c: Don't try to jump to non-existent part (bu


From: Katsumi Yamaoka
Subject: [Emacs-diffs] master 2ef880c: Don't try to jump to non-existent part (bug#28013)
Date: Tue, 8 Aug 2017 19:40:47 -0400 (EDT)

branch: master
commit 2ef880cc75a393ee57c57930d34c9c4b516db4e4
Author: Katsumi Yamaoka <address@hidden>
Commit: Katsumi Yamaoka <address@hidden>

    Don't try to jump to non-existent part (bug#28013)
    
    * lisp/gnus/gnus-art.el (gnus-article-edit-part): Don't try to jump to
    the next part if there is the only one part in the article (bug#28013).
---
 lisp/gnus/gnus-art.el | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 3f384c6..ce0ff2e 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -5058,11 +5058,14 @@ and `gnus-mime-delete-part', and not provided at 
run-time normally."
       (gnus-article-edit-done))
     (gnus-configure-windows 'article)
     (sit-for 0)
-    (when (and current-id (integerp 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)))))))
+    (let ((handles (with-current-buffer gnus-article-buffer
+                    gnus-article-mime-handle-alist)))
+      ;; `handles' will be nil if there is the only one part
+      ;; in the article and is deleted.
+      (when (and handles current-id (integerp gnus-auto-select-part))
+       (gnus-article-jump-to-part
+        (min (max (+ current-id gnus-auto-select-part) 1)
+             (length handles)))))))
 
 (defun gnus-mime-replace-part (file)
   "Replace MIME part under point with an external body."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]