[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#50005: 28.0.50; silence a couple byte-compiler warnings in ERC
From: |
Mattias Engdegård |
Subject: |
bug#50005: 28.0.50; silence a couple byte-compiler warnings in ERC |
Date: |
Thu, 12 Aug 2021 10:15:45 +0200 |
> (defcustom erc-lurker-ignore-chars "`_"
> "Characters at the end of a nick to strip for activity tracking purposes.
> -
> +The usual rules regarding ]^\\ and - in \"character alternatives\ apply.
Oops (two typos), but thanks for illustrating the problems with:
> + (string-trim-right nick (concat "[" erc-lurker-ignore-chars "]+"))
Attempting to construct character alternatives by hand is usually a mistake;
it's just too error-prone. Better use rx or regexp-opt instead:
(rx-to-string `(+ (in ,@(string-to-list erc-lurker-ignore-chars))) t)
or
(concat (regexp-opt (mapcar #'char-to-string erc-lurker-ignore-chars)) "+")