From: "Mattias Engdegård" <mattiase@acm.org>
To: "J.P." <jp@neverwas.me>
Cc: Amin Bandali <bandali@gnu.org>, 50005@debbugs.gnu.org
Subject: bug#50005: 28.0.50; silence a couple byte-compiler warnings in ERC
Date: Thu, 12 Aug 2021 13:52:16 +0200 [thread overview]
Message-ID: <DED2F755-91E6-441B-9065-B91732D304CE@acm.org> (raw)
In-Reply-To: <87a6lngccy.fsf@neverwas.me>
12 aug. 2021 kl. 12.56 skrev J.P. <jp@neverwas.me>:
> Thanks, I spotted the weird double-quote mismatch thing earlier, but I
> guess I'm still missing something else?
The string made it look like backslash were a special character inside [...]. It isn't; only ^, ] and - are special, each with their own quirky rules. (Other regexp systems have different rules.)
> So, I take this to mean there's no problem with requiring (autoloading)
> rx.el (or regexp-opt.el), right?
Correct. Your original problem was the use of `regexp-opt-charset` which is not autoloaded (and somewhat of an internal function to regexp-opt.el, but that's debatable). Using plain `regexp-opt` is fine.
Most ordinary uses of rx will not even require rx.el to be loaded at runtime since the macros are expanded during compilation, but `rx-to-string` is a plain function, autoloaded.
> And I guess the `string-to-list' is necessary because
>
> (rx-to-string '(+ (in "abc")) t)
> ⇒ "[a-c]+"
>
> is still interpreted as a set of character alternatives, whereas
>
> (rx-to-string '(+ (in ?a ?- ?c)) t)
> ⇒ "[ac-]+"
>
> combines individual character args into just such a set.
If you meant (in "a-c") in your first example then yes, quite right -- the hyphen is special inside strings of the rx `in` construct, but it's not special as a character argument. No other characters are special.
> Do you use ERC, Mattias? If so, are you available to review more
> patches?
I'm afraid I rarely use it and know nothing about its innards so I'm probably not the right person to ask -- only came by to help out with some regexpy things. I have nothing clever to say about your other changes, sorry!
> I'm obviously quite ignorant in the ways of Emacs but am
> pushing hard to improve ERC. Some might say that's a recipe for
> embarrassment/disaster (though I'm pretty sure I already crossed that
> first bridge ages ago).
I'd say it's a good sign! Just dive in.
> So what do you say, can you help?
Wish I could but time probably doesn't permit, sorry. There are much more experienced hands about. Of course I'll be happy to answer specifics about parts that I happen to know something about.
next prev parent reply other threads:[~2021-08-12 11:52 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
2021-08-12 10:56 ` J.P.
2021-08-12 11:52 ` Mattias Engdegård [this message]
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=DED2F755-91E6-441B-9065-B91732D304CE@acm.org \
--to=mattiase@acm.org \
--cc=50005@debbugs.gnu.org \
--cc=bandali@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).