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