about summary refs log tree commit diff
path: root/users/tazjin
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2020-09-14T12·12+0100
committertazjin <mail@tazj.in>2020-09-14T15·31+0000
commit4a29942b06798bae94fe71fc476088ef284e1b71 (patch)
tree15a7200c81efedf66b14af8376a301cc52045414 /users/tazjin
parent20e88b0dd68b7ff39815a0145a38e31a6e57b9a3 (diff)
fix(tazjin/emacs): Gracefully handle irregular Quassel titles r/1786
Some Quassel dialogues (e.g. popups, or clients that aren't connected
yet) don't match the expression and cause errors. This falls back to
the raw title for the window if no match is found.

Change-Id: I67b9cd7f6e2cb8e3e118d7fb7eeb615380be09d6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1976
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/tazjin')
-rw-r--r--users/tazjin/emacs/config/desktop.el15
1 files changed, 8 insertions, 7 deletions
diff --git a/users/tazjin/emacs/config/desktop.el b/users/tazjin/emacs/config/desktop.el
index 8e7a94f96249..b099b573aeb3 100644
--- a/users/tazjin/emacs/config/desktop.el
+++ b/users/tazjin/emacs/config/desktop.el
@@ -94,13 +94,14 @@
     ;; "Quassel IRC - ##tvl (Freenode) — Quassel IRC"
     (`("quassel" ,title)
      (progn
-       (string-match
-        (rx "Quassel IRC - "
-            (group (one-or-more (any alnum "&" "-" "#"))) ;; <-- channel name
-            " (" (group (one-or-more (any ascii space))) ")" ;; <-- network name
-            " — Quassel IRC")
-        title)
-       (format "Quassel<%s>" (match-string 2 title))))
+       (if (string-match
+            (rx "Quassel IRC - "
+                (group (one-or-more (any alnum "[" "]" "&" "-" "#"))) ;; <-- channel name
+                " (" (group (one-or-more (any ascii space))) ")" ;; <-- network name
+                " — Quassel IRC")
+            title)
+           (format "Quassel<%s>" (match-string 2 title))
+         title)))
 
     ;; For any other application, a name is constructed from the
     ;; window's class and name.