diff options
author | Kyle Meyer <kyle@kyleam.com> | 2020-06-06 00:22:21 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2020-06-06 15:17:12 -0400 |
commit | e81d66e455b1917048aabeb341fdf70334531348 (patch) | |
tree | cc5cc5499d648dbce7bb5ca5ea0b5e5c56a62d0d | |
parent | eda0edf3efa9b87b72f9aeb3ac9a905fee0d205a (diff) | |
download | piem-e81d66e455b1917048aabeb341fdf70334531348.tar.gz |
Move regexp for patch subjects into a variable
The piem-{notmuch,gnus}-am-ready-mbox functions will need this regexp
too.
-rw-r--r-- | piem.el | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -312,6 +312,13 @@ the first will be ignored." (plist-put info :base-commit (match-string 1))) info))) +(defvar piem-patch-subject-re + (rx string-start (zero-or-more space) "[" + (zero-or-more (not (any "]" "\n"))) + "PATCH" + (zero-or-more (not (any "]" "\n"))) + "]" (one-or-more space))) + (defun piem--shorten-subject (subject) (let ((words (mapcar #'downcase @@ -321,12 +328,7 @@ the first will be ignored." (rx (any "'\"")) "") (replace-regexp-in-string - (rx string-start (zero-or-more space) "[" - (zero-or-more (not (any "]" "\n"))) - "PATCH" - (zero-or-more (not (any "]" "\n"))) - "]" (one-or-more space)) - "")) + piem-patch-subject-re "")) "\\W+" t))) (ignore-these (list "a" "an" "the")) (num-words 0) |