aboutsummaryrefslogtreecommitdiff
path: root/piem-lei.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2021-06-05 17:13:56 -0400
committerKyle Meyer <kyle@kyleam.com>2021-06-07 00:12:07 -0400
commit653326e51503ba0bddcf9dc365003886527edbe2 (patch)
tree41c206759afea8790ab4312ce03bff4d88b3d272 /piem-lei.el
parentdf741cd4254c274903dac9390d2b158558e6efa6 (diff)
downloadpiem-653326e51503ba0bddcf9dc365003886527edbe2.tar.gz
piem-lei-query-thread: Add bug#NNN special case when eliding subject
In debbugs threads, it's not uncommon for a leading "[bug#NNN]" in the subject to be converted to "bug#NNN:" [*]. I'm not sure what the source of this is, but it prevents the suppression of an otherwise identical subject. It's probably not worth normalizing before the comparison to get full suppression, but it'd be nice to at least elide the main part of the subject so it's more obvious that it didn't change. Add a special case so that "bug#NNN:" prefix is treated the same as a bracketed prefix. [*] example: https://yhetil.org/guix-patches/20201128051435.30580-1-kyle@kyleam.com Message-Id: <20210605211402.20304-13-kyle@kyleam.com>
Diffstat (limited to 'piem-lei.el')
-rw-r--r--piem-lei.el14
1 files changed, 12 insertions, 2 deletions
diff --git a/piem-lei.el b/piem-lei.el
index f7ccc6e..3760176 100644
--- a/piem-lei.el
+++ b/piem-lei.el
@@ -345,8 +345,18 @@ Return a list with a `piem-lei-msg' object for each root."
(rx string-start
;; Prefix.
(group (zero-or-more space)
- (one-or-more "[" (one-or-more (not (any "]" "\n"))) "]"
- (one-or-more space)))
+ (or (and (one-or-more (and "bug#" (one-or-more digit) ":"))
+ (one-or-more space)
+ (zero-or-more
+ ;; This pattern...
+ "[" (one-or-more (not (any "]" "\n"))) "]"
+ (one-or-more space)))
+ (one-or-more
+ ;; ... is repeated here. Extract it to an rx-let
+ ;; binding once minimum Emacs version is at least
+ ;; 27.
+ "[" (one-or-more (not (any "]" "\n"))) "]"
+ (one-or-more space))))
;; Main subject. A match consists of at least two islands of
;; non-space characters because there's not much point in
;; eliding one word.