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

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

Date: Mon, 26 Dec 2011 12:06:02 +0000

To: Jani Nikula, notmuch@notmuchmail.org

Cc:

From: David Edmondson


On Mon, 26 Dec 2011 00:00:05 +0200, Jani Nikula <jani@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.
part-000.sig (application/pgp-signature)

Thread: