fix(tazjin/emacs): Gracefully handle irregular Quassel titles
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
This commit is contained in:
parent
20e88b0dd6
commit
4a29942b06
1 changed files with 8 additions and 7 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue