[PATCH v2 1/2] emacs: create patch filename from subject for inline patch fake parts
Jani Nikula
jani at nikula.org
Mon Dec 26 04:24:42 PST 2011
On Mon, 26 Dec 2011 12:06:02 +0000, David Edmondson <dme at dme.org> wrote:
> 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.
Yes, definitely. I am still very much a beginner in lisp.
> 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?
I'm not sure I follow you here. Could you elaborate what you mean by
"the wrong thing", please?
I don't think the user would want to have an "inline: " prefix in the
filename that would have to be removed every time. I think that kind of
defeats the purpose here. Or where exactly are you proposing to have the
prefix?
BR,
Jani.
More information about the notmuch
mailing list