Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 7D925431FD0 for ; Mon, 26 Dec 2011 04:06:13 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3MgyOCSUMBbW for ; Mon, 26 Dec 2011 04:06:13 -0800 (PST) Received: from mail-we0-f181.google.com (mail-we0-f181.google.com [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id C3BD2431FB6 for ; Mon, 26 Dec 2011 04:06:12 -0800 (PST) Received: by werm12 with SMTP id m12so6186739wer.26 for ; Mon, 26 Dec 2011 04:06:11 -0800 (PST) Received: by 10.216.139.222 with SMTP id c72mr19413176wej.4.1324901171545; Mon, 26 Dec 2011 04:06:11 -0800 (PST) Received: from hotblack-desiato.hh.sledj.net (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25]) by mx.google.com with ESMTPS id ei9sm56506986wid.0.2011.12.26.04.06.08 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 26 Dec 2011 04:06:10 -0800 (PST) Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000) id AA52EA0765; Mon, 26 Dec 2011 12:06:06 +0000 (GMT) To: Jani Nikula , notmuch@notmuchmail.org Subject: Re: [PATCH v2 1/2] emacs: create patch filename from subject for inline patch fake parts In-Reply-To: References: <1321657368-13872-1-git-send-email-jani@nikula.org> User-Agent: Notmuch/0.10.2+107~ga2d0215 (http://notmuchmail.org) Emacs/24.0.92.1 (x86_64-pc-linux-gnu) From: David Edmondson Date: Mon, 26 Dec 2011 12:06:02 +0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2011 12:06:13 -0000 --=-=-= Content-Type: text/plain On Mon, 26 Dec 2011 00:00:05 +0200, Jani Nikula 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. --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk74YyoACgkQaezQq/BJZRarEgCePK2RJpFrgdpUt0PWPmvg9xIn TjMAn1e8sUzwxk4qY/tPvwJQpRKtD1Su =l/h/ -----END PGP SIGNATURE----- --=-=-=--