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 59063431FBD for ; Tue, 15 Jul 2014 00:35:43 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.099 X-Spam-Level: X-Spam-Status: No, score=-0.099 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, UNPARSEABLE_RELAY=0.001] 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 AMRCn3e33ylZ for ; Tue, 15 Jul 2014 00:35:38 -0700 (PDT) Received: from smtp.pobox.com (smtp.pobox.com [208.72.237.35]) by olra.theworths.org (Postfix) with ESMTP id 8FC86431FBC for ; Tue, 15 Jul 2014 00:35:38 -0700 (PDT) Received: from smtp.pobox.com (unknown [127.0.0.1]) by pb-smtp0.pobox.com (Postfix) with ESMTP id 91CB6220C5; Tue, 15 Jul 2014 03:35:20 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=date :message-id:from:subject:to:cc:in-reply-to:references; s=sasl; bh=MiD5mCraUGQ7csJ39G8cniz20Bw=; b=WWrgXuZPNbalCewKlN+gLvPdWIl+ 6P1RR+/8gySr+JNNXGbNDhSKbCBDjfiSC4SLCSlUiYkz6s6cH3IrVuWzNY9xjADE tqXX2uy5jj64CGbqX/MoRT3p5AvCdBZHzIRK7AGgEM+DIj+zcESGbx0rcXqaEh3B DatbxmlRyXog/vM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=date:message-id :from:subject:to:cc:in-reply-to:references; q=dns; s=sasl; b=IyQ 352aWJnn07cwF+ES5Dcj13okUmIRuCZ8G5JKp3/y1J4NirgabYpaAWHluugHLekG BupIYpb3eA4PUkUQqNQ6QhGmjgoDyzTDfA2Wp4XphBD10+4yK3FkDCDXvqINGw0q wTZzSy+u4Fk1Y99b4xKZioh1EX7YNOblLoQqhbUA= Received: from pb-smtp0.int.icgroup.com (unknown [127.0.0.1]) by pb-smtp0.pobox.com (Postfix) with ESMTP id 85C1F220C4; Tue, 15 Jul 2014 03:35:20 -0400 (EDT) Received: from ouroboros.ramov.inet (unknown [178.218.165.9]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-smtp0.pobox.com (Postfix) with ESMTPSA id 979BA220BF; Tue, 15 Jul 2014 03:35:14 -0400 (EDT) Received: from localhost (1000@localhost [local]); by localhost (OpenSMTPD) with ESMTPA id f57c85c6; Tue, 15 Jul 2014 09:35:30 +0200 (CEST) Date: Tue, 15 Jul 2014 09:35:30 +0200 (CEST) Message-Id: <702358554056882337.enqueue@ouroboros.ramov.inet> From: Sime Ramov Subject: Re: notmuch-reply date format To: Austin Clements In-Reply-To: <20140714130431.GB4660@mit.edu> References: <1722345767858996112.enqueue@ouroboros.ramov.inet> <20140714130431.GB4660@mit.edu> X-Pobox-Relay-ID: 8FB27B22-0BF2-11E4-BBE4-9903E9FBB39C-45584858!pb-smtp0.pobox.com Cc: notmuch@notmuchmail.org 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: Tue, 15 Jul 2014 07:35:43 -0000 Hello, * Austin Clements [Mon, 14 Jul 2014 09:04:31 -0400]: > Assuming the CLI is the right place for you to change this, you > probably want to call notmuch_message_get_date, then localtime, then > strftime. Tried to get this working to no avail. Not a programmer obviously :) I cobbled this together from various online sources: diff --git a/notmuch-reply.c b/notmuch-reply.c index 7c1c809..16cf19c 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -44,9 +44,15 @@ format_part_reply (mime_node_t *node) int i; if (node->envelope_file) { - printf ("On %s, %s wrote:\n", - notmuch_message_get_header (node->envelope_file, "date"), - notmuch_message_get_header (node->envelope_file, "from")); + struct tm *info; + char dbuf[30]; + + info = localtime(notmuch_message_get_date(node->envelope_file)); + + strftime(dbuf, sizeof(dbuf), "%F %R %z", info); + printf ("* %s [%s]:\n", + notmuch_message_get_header(node->envelope_file, "from"), dbuf); + } else if (GMIME_IS_MESSAGE (node->part)) { GMimeMessage *message = GMIME_MESSAGE (node->part); InternetAddressList *recipients; When compiling I get this warning: notmuch-reply.c: In function 'format_part_reply': notmuch-reply.c:50: warning: passing argument 1 of 'localtime' makes pointer from integer without a cast And a core dump when notmuch reply is invoked on a message. Am I even close? :) Thanks