diff options
Diffstat (limited to 'piem.el')
-rw-r--r-- | piem.el | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -561,10 +561,14 @@ This function depends on :url being configured for entries in ;;;; Patch handling -(defun piem-am-patch-attachment-p (type) +(defun piem-am-patch-attachment-p (type filename) "Return non-nil if an attachment should be treated as a patch. -TYPE is a media type such as \"text/x-patch\"." - (member type '("text/x-diff" "text/x-patch"))) +TYPE is a media type such as \"text/x-patch\". FILENAME is the +attachment file name, if any." + (or (member type '("text/x-diff" "text/x-patch")) + (and filename + (equal type "text/plain") + (string-match-p "\\.patch\\'" filename)))) (defun piem-extract-mbox-info (&optional buffer) "Collect information from message in BUFFER. |