From 2f1ccd039ec0b1c4f33d682afc51d6dc6993eb63 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 5 May 2020 07:49:50 -0700 Subject: mailscripts.el: notmuch-extract-message-patches: improve regexp Signed-off-by: Sean Whitton --- debian/changelog | 2 ++ mailscripts.el | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 53a9be1..e5a1452 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,8 @@ mailscripts (0.20-1) UNRELEASED; urgency=medium - Add mailscripts-detach-head-from-existing-branch defcustom. - notmuch-extract-message-patches: set NO-STRICT-MIME argument of `mm-dissect-buffer' to enable extracting patches from more messages. + - notmuch-extract-message-patches: attempt to improve regexp to + extract more wanted patches. * maildir-import-patch: Prepend "[PATCH fooproject imported]" to the subject lines of patches, unless the user supplies a --subject-prefix option to be passed on to git-format-patch(1). diff --git a/mailscripts.el b/mailscripts.el index 193ca5c..2280f5a 100644 --- a/mailscripts.el +++ b/mailscripts.el @@ -1,7 +1,7 @@ ;;; mailscripts.el --- functions to access tools in the mailscripts package ;; Author: Sean Whitton -;; Version: 0.18 +;; Version: 0.20 ;; Package-Requires: (notmuch projectile) ;; Copyright (C) 2018, 2019 Sean Whitton @@ -130,8 +130,8 @@ git-format-patch(1)." (let* ((disposition (mm-handle-disposition p)) (filename (cdr (assq 'filename disposition)))) (and filename - (string-match - "^\\(v[0-9]+-\\)?[0-9]+-.+\.\\(patch\\|diff\\|txt\\)$" filename) + (string-match "^\\(v?[0-9]+\\)-.+\\.\\(patch\\|diff\\|txt\\)$" + filename) (mm-pipe-part p "git am")))) mm-handle)))) -- cgit v1.2.3