From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 88FB4431FD0 for ; Mon, 26 Dec 2011 04:24:50 -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 kN8LnR-moUDr for ; Mon, 26 Dec 2011 04:24:50 -0800 (PST) Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com [74.125.83.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id BAA52431FB6 for ; Mon, 26 Dec 2011 04:24:49 -0800 (PST) Received: by eekd41 with SMTP id d41so13305627eek.26 for ; Mon, 26 Dec 2011 04:24:47 -0800 (PST) Received: by 10.213.11.12 with SMTP id r12mr1197231ebr.87.1324902286891; Mon, 26 Dec 2011 04:24:46 -0800 (PST) Received: from localhost (dsl-hkibrasgw4-fe5cdc00-23.dhcp.inet.fi. [80.220.92.23]) by mx.google.com with ESMTPS id 13sm91183655eeu.1.2011.12.26.04.24.44 (version=SSLv3 cipher=OTHER); Mon, 26 Dec 2011 04:24:45 -0800 (PST) From: Jani Nikula To: David Edmondson , 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+129~g311bcf8 (http://notmuchmail.org) Emacs/23.3.1 (i686-pc-linux-gnu) Date: Mon, 26 Dec 2011 14:24:42 +0200 Message-ID: <87wr9ja5bp.fsf@nikula.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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:24:50 -0000 On Mon, 26 Dec 2011 12:06:02 +0000, David Edmondson wrote: > 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. 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.