[PATCH 2/2] emacs: only strip "re:" in the beginning of subject
authorJani Nikula <jani@nikula.org>
Tue, 5 Jun 2012 15:42:51 +0000 (18:42 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:47:37 +0000 (09:47 -0800)
19/35a2a05e73430391b44c3e0fbe88640348957d [new file with mode: 0644]

diff --git a/19/35a2a05e73430391b44c3e0fbe88640348957d b/19/35a2a05e73430391b44c3e0fbe88640348957d
new file mode 100644 (file)
index 0000000..470b27a
--- /dev/null
@@ -0,0 +1,107 @@
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id B0318431FC3\r
+       for <notmuch@notmuchmail.org>; Tue,  5 Jun 2012 08:43:01 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id dLFbXFh54fV0 for <notmuch@notmuchmail.org>;\r
+       Tue,  5 Jun 2012 08:43:00 -0700 (PDT)\r
+Received: from mail-lpp01m010-f53.google.com (mail-lpp01m010-f53.google.com\r
+       [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 89020431FB6\r
+       for <notmuch@notmuchmail.org>; Tue,  5 Jun 2012 08:43:00 -0700 (PDT)\r
+Received: by lagu2 with SMTP id u2so4394767lag.26\r
+       for <notmuch@notmuchmail.org>; Tue, 05 Jun 2012 08:42:57 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=google.com; s=20120113;\r
+       h=from:to:subject:date:message-id:x-mailer:in-reply-to:references\r
+       :in-reply-to:references:x-gm-message-state;\r
+       bh=UbLK1i0uVqLvUX/ibVikyB/UkqUlJUYRVzL37x99tAU=;\r
+       b=CEERzPXpKhHB1VNGlmq9nqHVPhzJDhGcOnlqdcI0BeTxVuzI1R/QYaCUqDcKkhwGcz\r
+       6nYPiobn1c10wfZ0yQv89BHXiWIZWbll09r1rtsmurE/QKL6hNwLZGu0K6nltUzsyEqD\r
+       TwxTewOY27am0Vl1SsLVNwEdb2dRdLTfjkfisYDvE8pJfkMFKixxhk6FI4QNHhldzBf4\r
+       DUlyC1UTxPhcdh1xqfZN3CFaeDBmnPcjY2cZODyiE1STuefrzcsvlPuoSV3FbO5YgRLn\r
+       vWfQwC62CTVOGW+sD9Fovw8oUOZZaUJDS8h3FvaU3LLEkzqmVTSatfl79K5OiSTi1k5E\r
+       ZtZg==\r
+Received: by 10.112.102.136 with SMTP id fo8mr8354919lbb.106.1338910977647;\r
+       Tue, 05 Jun 2012 08:42:57 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw4-fe50dc00-68.dhcp.inet.fi.\r
+       [80.220.80.68])\r
+       by mx.google.com with ESMTPS id sm7sm3148732lab.5.2012.06.05.08.42.56\r
+       (version=SSLv3 cipher=OTHER); Tue, 05 Jun 2012 08:42:56 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 2/2] emacs: only strip "re:" in the beginning of subject\r
+Date: Tue,  5 Jun 2012 18:42:51 +0300\r
+Message-Id:\r
+ <505a22a469143e310b1af8965161b6a008a3c527.1338910938.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.9.5\r
+In-Reply-To:\r
+ <3a9ce3cd2074e311f86f3e416644b2879516ffbf.1338910938.git.jani@nikula.org>\r
+References:\r
+ <3a9ce3cd2074e311f86f3e416644b2879516ffbf.1338910938.git.jani@nikula.org>\r
+In-Reply-To:\r
+ <3a9ce3cd2074e311f86f3e416644b2879516ffbf.1338910938.git.jani@nikula.org>\r
+References:\r
+ <3a9ce3cd2074e311f86f3e416644b2879516ffbf.1338910938.git.jani@nikula.org>\r
+X-Gm-Message-State:\r
+ ALoCoQnAGkFnqSGYbe64my4iSqVlqri7ufmwulcmF347bP7iTOkK//LaijYSFKFE/K5UB/jccElI\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 05 Jun 2012 15:43:02 -0000\r
+\r
+Fix notmuch-show-strip-re by matching "re:" only in the beginning of\r
+the input string.\r
+---\r
+ emacs/notmuch-show.el |    2 +-\r
+ test/emacs-show       |    1 -\r
+ 2 files changed, 1 insertion(+), 2 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index d318430..36cad93 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -819,7 +819,7 @@ message at DEPTH in the current thread."\r
+   (make-symbol (concat "notmuch-show-" type)))\r
+ \r
+ (defun notmuch-show-strip-re (string)\r
+-  (replace-regexp-in-string "\\([Rr]e: *\\)+" "" string))\r
++  (replace-regexp-in-string "^\\([Rr]e: *\\)+" "" string))\r
+ \r
+ (defvar notmuch-show-previous-subject "")\r
+ (make-variable-buffer-local 'notmuch-show-previous-subject)\r
+diff --git a/test/emacs-show b/test/emacs-show\r
+index 1ddb28e..e9a714f 100755\r
+--- a/test/emacs-show\r
++++ b/test/emacs-show\r
+@@ -33,7 +33,6 @@ output=$(test_emacs '(notmuch-show-strip-re "re:Re: re:  Re:  re:subject")')\r
+ test_expect_equal "$output" '"subject"'\r
+ \r
+ test_begin_subtest "Bare subject #3"\r
+-test_subtest_known_broken\r
+ output=$(test_emacs '(notmuch-show-strip-re "the cure: fix the regexp")')\r
+ test_expect_equal "$output" '"the cure: fix the regexp"'\r
+ \r
+-- \r
+1.7.9.5\r
+\r