[gnus git] branch master updated: m0-11-20-g1c2ed0c =1= gnus-art.el (gnus-mime-buttonize-attachments-in-header): Improve criterion that finds parts to display

Katsumi Yamaoka <[email protected]> Fri, 06 Jun 2014 00:43:30 +0200
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  1c2ed0ce5abe2181e51f777171f8cd40a547e5a9 (commit)
      from  dd9fdb9123576f1c0fa65094365f2ba83937b044 (commit)


- Log -----------------------------------------------------------------
commit 1c2ed0ce5abe2181e51f777171f8cd40a547e5a9
Author: Katsumi Yamaoka <[email protected]>
Date:   Thu Jun 5 22:43:21 2014 +0000

    gnus-art.el (gnus-mime-buttonize-attachments-in-header): Improve criterion that finds parts to display

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 27e5fb3..662557a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -3,6 +3,8 @@
 	* gnus-art.el (gnus-article-edit-part): Don't modifiy markers.
 	(gnus-article-read-summary-keys):
 	Don't bug out when there is no article in the summary buffer.
+	(gnus-mime-buttonize-attachments-in-header):
+	Improve criterion that finds parts to display.
 
 	* gnus-art.el (gnus-mm-display-part):
 	* mm-decode.el (mm-shr):
diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el
index 183e219..36bb79c 100644
--- a/lisp/gnus-art.el
+++ b/lisp/gnus-art.el
@@ -4995,6 +4995,9 @@ and `gnus-mime-delete-part', and not provided at run-time normally."
 		   ',gnus-newsgroup-ignored-charsets))
 	      (mbl mml-buffer-list))
 	  (setq mml-buffer-list nil)
+	  ;; A new text must be inserted before deleting existing ones
+	  ;; at the end so as not to move existing markers of which
+	  ;; the insertion type is t.
 	  (delete-region
 	   (point-min)
 	   (prog1
@@ -6371,7 +6374,7 @@ in the body.  Use `gnus-header-face-alist' to highlight buttons."
 			(setcar handle (caar handle))))
 		    flat)
 	      flat))))
-      (let ((case-fold-search t) buttons st handle)
+      (let ((case-fold-search t) buttons handle type st)
 	(save-excursion
 	  (save-restriction
 	    (widen)
@@ -6391,14 +6394,24 @@ in the body.  Use `gnus-header-face-alist' to highlight buttons."
 	    (unless (and interactive buttons)
 	      ;; Find buttons.
 	      (setq buttons nil)
-	      (dolist (handle (flattened-alist))
-		(when (and (not (stringp (cadr handle)))
-			   (or (equal (car (mm-handle-disposition
-					    (cdr handle)))
-				      "attachment")
-			       (not (and (mm-inlinable-p (cdr handle))
-					 (mm-inlined-p (cdr handle))))))
-		  (push handle buttons)))
+	      (dolist (button (flattened-alist))
+		(setq handle (cdr button)
+		      type (mm-handle-media-type handle))
+		(when (or (and (if (gnus-buffer-live-p gnus-summary-buffer)
+				   (with-current-buffer gnus-summary-buffer
+				     gnus-inhibit-images)
+				 gnus-inhibit-images)
+			       (string-match "\\`image/" type))
+			  (mm-inline-override-p handle)
+			  (and (mm-handle-disposition handle)
+			       (not (equal (car (mm-handle-disposition handle))
+					   "inline"))
+			       (not (mm-attachment-override-p handle)))
+			  (not (mm-automatic-display-p handle))
+			  (not (or (and (mm-inlinable-p handle)
+					(mm-inlined-p handle))
+				   (mm-automatic-external-display-p type))))
+		  (push button buttons)))
 	      (when buttons
 		;; Add header buttons.
 		(article-goto-body)

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog   |    2 ++
 lisp/gnus-art.el |   31 ++++++++++++++++++++++---------
 2 files changed, 24 insertions(+), 9 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project