[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 13:52:16 +0200 |
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.