[PATCH v2 1/2] emacs: create patch filename from subject for inline patch fake parts

David Edmondson dme at dme.org
Mon Dec 26 04:06:02 PST 2011


On Mon, 26 Dec 2011 00:00:05 +0200, Jani Nikula <jani at nikula.org> wrote:
> +(defun notmuch-wash-subject-to-patch-filename (subject)
> +  "Convert a patch mail SUBJECT into a filename.
> +
> +The resulting filename is similar to the names generated by \"git
> +format-patch\". If the patch mail was generated and sent using
> +\"git format-patch/send-email\", this should re-create the
> +original filename the sender had."
> +  (let* ((n (notmuch-wash-subject-to-patch-sequence-number subject))
> +	 (n (if n n 1)))
> +    (format "%04d-%s.patch" n (notmuch-wash-subject-to-filename subject 52))))
> +

(format "%04d-%s.patch"
  (or (notmuch-wash-subject-to-patch-sequence-number subject) 1)
  (notmuch-wash-subject-to-filename subject 52))

or something would be more lispy.

Clicking on the button for the part saves the wrong thing, though,
because it's not a real MIME part. That looks a bit awkward to fix, so
perhaps you could still prefix the name with "inline: " to indicate that
it's odd?

Otherwise, looks good.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20111226/d30f7c14/attachment.pgp>


More information about the notmuch mailing list