summaryrefslogtreecommitdiffhomepage
path: root/lib/eos
diff options
context:
space:
mode:
Diffstat (limited to 'lib/eos')
-rw-r--r--lib/eos/jao-tracking.el18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/eos/jao-tracking.el b/lib/eos/jao-tracking.el
index 29a60a8..f695b3e 100644
--- a/lib/eos/jao-tracking.el
+++ b/lib/eos/jao-tracking.el
@@ -30,16 +30,16 @@
(defun jao-shorten-modes (&rest modes)
(dolist (m modes) (add-to-list 'tracking-shorten-modes m)))
+(defvar jao-tracking-cleaners '(("^[^a-zA-Z#@]+" . "#")))
+
+(defun jao-tracking-cleaner (rx subst)
+ (add-to-list 'jao-tracking-cleaners (cons rx subst)))
+
(defun jao-tracking--clean-slack (s)
- (let* ((s (replace-regexp-in-string
- "^\\*Slack - .*? : \\(mpdm-\\)?\\([^ ]+\\)\\( \\(T\\)\\)?.*"
- "\\2\\4"
- s))
- (s (replace-regexp-in-string "^\\*Ement Room: \\(.+\\)\\*" "\\1" s))
- (s (replace-regexp-in-string "logstash-\\([^-]+\\)-\\(.+\\)"
- "\\2-\\1"
- s)))
- (replace-regexp-in-string "^[^a-zA-Z#]+" "#" s)))
+ (dolist (cln jao-tracking-cleaners)
+ (when (string-match (car cln) s)
+ (setq s (replace-match (cdr cln) nil nil s))))
+ s)
(defun jao-tracking-shorten-aggressively (lst tail-count)
(let* ((s (shorten-join-sans-tail lst tail-count)))