unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattiase@acm.org>
To: "J.P." <jp@neverwas.me>
Cc: 50005@debbugs.gnu.org
Subject: bug#50005: 28.0.50; silence a couple byte-compiler warnings in ERC
Date: Thu, 12 Aug 2021 10:15:45 +0200	[thread overview]
Message-ID: <50A0B8E0-2F07-4AAC-8170-27990F9FEAD4@acm.org> (raw)
In-Reply-To: <87v94cjd89.fsf@neverwas.me>

>  (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)) "+")






  reply	other threads:[~2021-08-12  8:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-11 13:57 bug#50005: 28.0.50; silence a couple byte-compiler warnings in ERC J.P.
2021-08-12  8:15 ` Mattias Engdegård [this message]
2021-08-12 10:56   ` J.P.
2021-08-12 11:52     ` Mattias Engdegård
2021-08-12 13:35       ` J.P.
2021-09-12 12:03 ` J.P.
2021-09-16 13:25   ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50A0B8E0-2F07-4AAC-8170-27990F9FEAD4@acm.org \
    --to=mattiase@acm.org \
    --cc=50005@debbugs.gnu.org \
    --cc=jp@neverwas.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).