emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/gnorb fc9b6cf 153/449: Use existing functions for mime


From: Stefan Monnier
Subject: [elpa] externals/gnorb fc9b6cf 153/449: Use existing functions for mime handles
Date: Fri, 27 Nov 2020 23:15:29 -0500 (EST)

branch: externals/gnorb
commit fc9b6cfbd7c942d52c6d9ef6e3b964d57b47e003
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>

    Use existing functions for mime handles
    
    * lisp/gnorb-gnus.el (gnorb-gnus-collect-all-attachments): Don't use
      random list access functions, there are proper functions for accessing
      mime info. They work better, use them.
---
 lisp/gnorb-gnus.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/lisp/gnorb-gnus.el b/lisp/gnorb-gnus.el
index 68aee81..124fb84 100644
--- a/lisp/gnorb-gnus.el
+++ b/lisp/gnorb-gnus.el
@@ -172,7 +172,7 @@ save them into `gnorb-tmp-dir'."
     (when capture-p
       (set-buffer (org-capture-get :original-buffer)))
     (unless (memq major-mode '(gnus-summary-mode gnus-article-mode))
-       (error "Only works in Gnus summary or article buffers"))
+      (error "Only works in Gnus summary or article buffers"))
     (let ((article (gnus-summary-article-number)) 
          mime-handles)
       (when (or (null gnus-current-article)
@@ -182,9 +182,12 @@ save them into `gnorb-tmp-dir'."
        (gnus-summary-display-article article))
       (gnus-eval-in-buffer-window gnus-article-buffer
        (setq mime-handles (cl-remove-if-not
-                           (lambda (h) (and (member (car (nth 5 h)) '("inline" 
"attachment") )
-                                            (eq (caadr (nth 5 h)) 'filename)))
-                           gnus-article-mime-handle-alist) ))
+                           (lambda (h)
+                             (let ((disp (mm-handle-disposition (cdr h))))
+                               (and (member (car disp)
+                                            '("inline" "attachment"))
+                                    (mail-content-type-get disp 'filename))))
+                           gnus-article-mime-handle-alist)))
       (when mime-handles
        (dolist (h mime-handles)
          (let ((filename



reply via email to

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