From b3a707a161f8c6f25888a5badf13c816f17ab919 Mon Sep 17 00:00:00 2001 From: "Kirill A. Shutemov" Date: Mon, 28 Jan 2013 17:52:16 +0200 Subject: [PATCH] [PATCH 1/5] open_reply: fallback to use addr.local if addr.name is nil --- bb/ab682f79b046dfa713ecdf7f4286413095e29e | 80 +++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 bb/ab682f79b046dfa713ecdf7f4286413095e29e diff --git a/bb/ab682f79b046dfa713ecdf7f4286413095e29e b/bb/ab682f79b046dfa713ecdf7f4286413095e29e new file mode 100644 index 000000000..e34cbe2dc --- /dev/null +++ b/bb/ab682f79b046dfa713ecdf7f4286413095e29e @@ -0,0 +1,80 @@ +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 D00F1431FAF + for ; Mon, 28 Jan 2013 07:57:08 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + 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 iSOU33VkFZT4 for ; + Mon, 28 Jan 2013 07:57:08 -0800 (PST) +X-Greylist: delayed 380 seconds by postgrey-1.32 at olra; + Mon, 28 Jan 2013 07:57:08 PST +Received: from shutemov.name (shutemov.name [204.155.152.216]) + by olra.theworths.org (Postfix) with ESMTP id 1E6C0431FAE + for ; Mon, 28 Jan 2013 07:57:08 -0800 (PST) +Received: by shutemov.name (Postfix, from userid 1000) + id 23CD0333D9; Mon, 28 Jan 2013 17:52:25 +0200 (EET) +From: "Kirill A. Shutemov" +To: Felipe Contreras +Subject: [PATCH 1/5] open_reply: fallback to use addr.local if addr.name is + nil +Date: Mon, 28 Jan 2013 17:52:16 +0200 +Message-Id: <1359388340-27136-2-git-send-email-kirill@shutemov.name> +X-Mailer: git-send-email 1.7.10.4 +In-Reply-To: <1359388340-27136-1-git-send-email-kirill@shutemov.name> +References: <1359388340-27136-1-git-send-email-kirill@shutemov.name> +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: Mon, 28 Jan 2013 15:57:09 -0000 + +From: "Kirill A. Shutemov" + +If address doesn't contain name we end up with " wrote:" as a reply +header. It doesn't look nice. + +Let's use addr.local + "@" if name is not defined. If addr.local is not +defined too, let's just use "somebody". + +Signed-off-by: Kirill A. Shutemov +--- + notmuch-ruby.vim | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/notmuch-ruby.vim b/notmuch-ruby.vim +index 761c87f..d8a9878 100644 +--- a/notmuch-ruby.vim ++++ b/notmuch-ruby.vim +@@ -492,7 +492,11 @@ ruby << EOF + lines << '' + + body_lines = [] +- body_lines << "%s wrote:" % Mail::Address.new(orig[:from].value).name ++ addr = Mail::Address.new(orig[:from].value) ++ name = addr.name ++ name = addr.local + "@" if name.nil? && !addr.local.nil? ++ name = "somebody" if name.nil? ++ body_lines << "%s wrote:" % name + part = orig.find_first_text + part.convert.each_line do |l| + body_lines << "> %s" % l.chomp +-- +1.7.10.4 + -- 2.26.2