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 CFF50431FBD for ; Tue, 2 Mar 2010 22:21:01 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.228 X-Spam-Level: X-Spam-Status: No, score=-2.228 tagged_above=-999 required=5 tests=[AWL=0.371, BAYES_00=-2.599] autolearn=ham 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 VNM6MrPcOCFn for ; Tue, 2 Mar 2010 22:21:00 -0800 (PST) Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) by olra.theworths.org (Postfix) with ESMTP id 84B1F431FAE for ; Tue, 2 Mar 2010 22:21:00 -0800 (PST) Received: from localhost (unknown [192.168.200.4]) by max.feld.cvut.cz (Postfix) with ESMTP id 6EEB619F3439; Wed, 3 Mar 2010 07:20:50 +0100 (CET) X-Virus-Scanned: IMAP AMAVIS Received: from max.feld.cvut.cz ([192.168.200.1]) by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new, port 10044) with ESMTP id CALjbjm4JaM7; Wed, 3 Mar 2010 07:20:49 +0100 (CET) Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by max.feld.cvut.cz (Postfix) with ESMTP id 1092419F3438; Wed, 3 Mar 2010 07:20:49 +0100 (CET) Received: from steelpick.localdomain (k335-30.felk.cvut.cz [147.32.86.30]) (Authenticated sender: sojkam1) by imap.feld.cvut.cz (Postfix) with ESMTPSA id E6E13FA003; Wed, 3 Mar 2010 07:20:48 +0100 (CET) Received: from wsh by steelpick.localdomain with local (Exim 4.71) (envelope-from ) id 1Nmhwu-0003rL-7I; Wed, 03 Mar 2010 07:20:48 +0100 From: Michal Sojka To: Sebastian Spaeth , notmuch@notmuchmail.org In-Reply-To: <1267533462-15682-1-git-send-email-Sebastian@SSpaeth.de> References: <1267533462-15682-1-git-send-email-Sebastian@SSpaeth.de> Date: Wed, 03 Mar 2010 07:20:47 +0100 Message-ID: <878waaexj4.fsf@steelpick.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [notmuch] [PATCH] notmuch-reply: Use a shorter 'On, X Y wrote:' line 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: Wed, 03 Mar 2010 06:21:02 -0000 On Tue, 2 Mar 2010 13:37:42 +0100, Sebastian Spaeth wrote: > Previously, we would output: > 'On Thu, 25 Feb 2010 14:32:54 +0100, Sebastian Spaeth wrote:' now it is: > 'On 2010-02-25, Sebastian Spaeth wrote:' > > In case we don't find a '<' (as indicator for 'Realname '), we still use the whole from address. > > Signed-off-by: Sebastian Spaeth > --- > This probably shows my lack of C skills quite nicely but it does the job for me. > > notmuch-reply.c | 21 ++++++++++++++++++--- > 1 files changed, 18 insertions(+), 3 deletions(-) > > diff --git a/notmuch-reply.c b/notmuch-reply.c > index 98f6442..929572f 100644 > --- a/notmuch-reply.c > +++ b/notmuch-reply.c > @@ -288,9 +288,12 @@ notmuch_reply_format_default(void *ctx, notmuch_config_t *config, notmuch_query_ > GMimeMessage *reply; > notmuch_messages_t *messages; > notmuch_message_t *message; > - const char *subject, *from_addr = NULL; > + const char *subject, *from_addr = NULL, *short_from; > const char *in_reply_to, *orig_references, *references; > char *reply_headers; > + time_t date; > + struct tm *datetm; > + char *datestr; > > for (messages = notmuch_query_search_messages (query); > notmuch_messages_has_more (messages); > @@ -346,10 +349,21 @@ notmuch_reply_format_default(void *ctx, notmuch_config_t *config, notmuch_query_ > g_object_unref (G_OBJECT (reply)); > reply = NULL; > > + date = notmuch_message_get_date(message); > + datetm = gmtime( &date ); > + datestr = talloc_array(ctx, char, 11); > + strftime(datestr, 11, "%Y-%m-%d", datetm); > + > + /* If from contains '<' (not as first char), > + * only use the preceding real name */ > + short_from = talloc_strdup(ctx, from_addr); I do not see, where do you assign a value to from_addr (besides the initial NULL). Michal