]> git.notmuchmail.org Git - notmuch/commitdiff
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)
committerDavid Bremner <bremner@debian.org>
Fri, 8 Jun 2012 02:28:17 +0000 (23:28 -0300)
Fix notmuch-show-strip-re by matching "re:" only in the beginning of
the input string.

emacs/notmuch-show.el
test/emacs-show

index d318430cdc842c71acf8acab6262c46d066d732b..36cad93319776491b73019060919c98d3b03f3e2 100644 (file)
@@ -819,7 +819,7 @@ message at DEPTH in the current thread."
   (make-symbol (concat "notmuch-show-" type)))
 
 (defun notmuch-show-strip-re (string)
   (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)
 
 (defvar notmuch-show-previous-subject "")
 (make-variable-buffer-local 'notmuch-show-previous-subject)
index 1ddb28eb2d1ba47644c4a870ff21a4aa33d51d92..e9a714fa228720901a90b3b83d60fd33c9be6095 100755 (executable)
@@ -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_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"'
 
 output=$(test_emacs '(notmuch-show-strip-re "the cure: fix the regexp")')
 test_expect_equal "$output" '"the cure: fix the regexp"'