[PATCH 2/2] emacs: only strip "re:" in the beginning of subject

Subject: [PATCH 2/2] emacs: only strip "re:" in the beginning of subject

Date: Tue, 5 Jun 2012 18:42:51 +0300

To: notmuch@notmuchmail.org

Cc:

From: Jani Nikula


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


Thread: