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 A9272429E2A for ; Sun, 10 Jul 2011 22:40:41 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.699 X-Spam-Level: X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-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 1mYGFpzx0VO8 for ; Sun, 10 Jul 2011 22:40:39 -0700 (PDT) Received: from mail-vw0-f53.google.com (mail-vw0-f53.google.com [209.85.212.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 81C57429E27 for ; Sun, 10 Jul 2011 22:40:37 -0700 (PDT) Received: by vws13 with SMTP id 13so2781812vws.26 for ; Sun, 10 Jul 2011 22:40:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; bh=sVK5KqEekVhhZkWl7UzNKL9lNA2Uksq373pCP0O2bFU=; b=AKMD9neOcLg0E7NmJQaULTpdbdZW0EhWNBAAjCOGzjj4Nu12B1+zcXIZVWaFqIFawU 3V4/oTFn5rkwNjGw+0Gq4/5PRyZrzdmLH/CVaOlwKQcCfjHVurBEYPKsIccV7ceuQhgl BG+Np8z9SiRgksM3YtK3OYElyvCuxFcdZqC+Y= Received: by 10.52.94.46 with SMTP id cz14mr1808980vdb.501.1310362836908; Sun, 10 Jul 2011 22:40:36 -0700 (PDT) Received: from localhost.localdomain (c-98-216-100-90.hsd1.ma.comcast.net [98.216.100.90]) by mx.google.com with ESMTPS id bl2sm5324172vbb.9.2011.07.10.22.40.36 (version=SSLv3 cipher=OTHER); Sun, 10 Jul 2011 22:40:36 -0700 (PDT) Sender: Jason Woofenden From: Jason Woofenden To: notmuch@notmuchmail.org Subject: [PATCH 2/5] vim: fix from list reformatting in search view Date: Mon, 11 Jul 2011 01:40:07 -0400 Message-Id: <1310362810-10926-3-git-send-email-jason@jasonwoof.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1310362810-10926-1-git-send-email-jason@jasonwoof.com> References: <1310362810-10926-1-git-send-email-jason@jasonwoof.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: Mon, 11 Jul 2011 05:40:42 -0000 This patch rewrites the reformatting of the from list so it shows full capitalized names when available (without truncating them as the old code did) and removes the pipe characters that appear between some names. The old code appears to assume from list (the list of senders in the thread) coming from notmuch would be e-mail addresses, but in this version it is mostly full names. Also in this version, the names are sometimes separated by pipe instead of comma. For consistency with old versions, names are still truncated at the first period. Perhaps they shouldn't be though. --- vim/plugin/notmuch.vim | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vim/plugin/notmuch.vim b/vim/plugin/notmuch.vim index d493580..e4b22d3 100644 --- a/vim/plugin/notmuch.vim +++ b/vim/plugin/notmuch.vim @@ -262,12 +262,12 @@ function! s:NM_cmd_search_fmtline(line) return 'ERROR PARSING: ' . a:line endif let max = g:notmuch_search_from_column_width - let flist = [] - for at in split(m[4], ", ") - let p = min([stridx(at, "."), stridx(at, "@")]) - call insert(flist, tolower(at[0:p - 1])) + let flist = {} + for at in split(m[4], '[|,] ') + let p = split(at, '[@.]') + let flist[p[0]] = 1 endfor - let from = join(flist, ", ") + let from = join(keys(flist), ", ") return printf("%-12s %3s %-20.20s | %s (%s)", m[2], m[3], from, m[5], m[6]) endfunction -- 1.7.5.4