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 E3C54431FDB for ; Sat, 2 Nov 2013 07:03:03 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, 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 v7rO-hxoAhkU for ; Sat, 2 Nov 2013 07:02:59 -0700 (PDT) Received: from mail-ob0-f181.google.com (mail-ob0-f181.google.com [209.85.214.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 5025F431FD0 for ; Sat, 2 Nov 2013 07:02:50 -0700 (PDT) Received: by mail-ob0-f181.google.com with SMTP id wp4so5521549obc.26 for ; Sat, 02 Nov 2013 07:02:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1Sgp2+h0xqGl1bwmFSUE0r6eGqS/MhJs59Kv9sxdF9Y=; b=ksE0KstSZAf60rm/Tw0Vm5qkOXqGxiUnhwf1xqT76fUz/8aIMH7Plw/Y+BRTc2vd23 BKZE2I/ebUDbYGnPrjj2lQajEkn3krmeOHuvQlJc450d300DI3DmPXQxgofeKC1Ah6dj 5e8ru6sDIWXFciwzOIm7bvGSYPHWOLTY1x8V2fgOwWUAC7CgCZMfRuXQXe2/6xPWtEmN YI+CDNEnqeXYDXezHEIylH8XiZRikUHmfLOlMnYW/KK4q+fgvsh/mrBYLqWE6Us8+5Q8 m1QSnECynaKPGauORxejd85H+ERL0z790txUEe9YJwFZTMyyMj0V/jt3s7SN1aPYWh9s YKcA== X-Received: by 10.60.58.166 with SMTP id s6mr6509456oeq.40.1383400969803; Sat, 02 Nov 2013 07:02:49 -0700 (PDT) Received: from localhost (187-162-140-241.static.axtel.net. [187.162.140.241]) by mx.google.com with ESMTPSA id z5sm19911864obg.13.2013.11.02.07.02.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Nov 2013 07:02:49 -0700 (PDT) From: Felipe Contreras To: notmuch@notmuchmail.org Subject: [PATCH 05/21] vim: show first message of the thread Date: Sat, 2 Nov 2013 07:55:38 -0600 Message-Id: <1383400554-1832-6-git-send-email-felipe.contreras@gmail.com> X-Mailer: git-send-email 1.8.4.2+fc1 In-Reply-To: <1383400554-1832-1-git-send-email-felipe.contreras@gmail.com> References: <1383400554-1832-1-git-send-email-felipe.contreras@gmail.com> 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: Sat, 02 Nov 2013 14:03:04 -0000 Signed-off-by: Felipe Contreras --- vim/notmuch.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vim/notmuch.vim b/vim/notmuch.vim index 72bf73b..11ea4fd 100644 --- a/vim/notmuch.vim +++ b/vim/notmuch.vim @@ -557,6 +557,7 @@ ruby << EOF def search_render(search) date_fmt = VIM::evaluate('g:notmuch_rb_date_format') q = $curbuf.query(search) + q.sort = Notmuch::SORT_NEWEST_FIRST $threads.clear t = q.search_threads @@ -564,10 +565,11 @@ ruby << EOF items.each do |e| authors = e.authors.to_utf8.split(/[,|]/).map { |a| author_filter(a) }.join(",") date = Time.at(e.newest_date).strftime(date_fmt) + subject = e.messages.first['subject'] if $mail_installed - subject = Mail::Field.new("Subject: " + e.subject).to_s + subject = Mail::Field.new("Subject: " + subject).to_s else - subject = e.subject.force_encoding('utf-8') + subject = subject.force_encoding('utf-8') end b << "%-12s %3s %-20.20s | %s (%s)" % [date, e.matched_messages, authors, subject, e.tags] $threads << e.thread_id -- 1.8.4.2+fc1