[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#46271: 28.0.50; [PATCH] Properly quote group names for gnus-search
From: |
Eric Abrahamsen |
Subject: |
bug#46271: 28.0.50; [PATCH] Properly quote group names for gnus-search |
Date: |
Mon, 08 Feb 2021 12:13:38 -0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
On 02/08/21 19:11 PM, Basil L. Contovounesios wrote:
> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> So I think it has to get messier:
>>
>> (let ((groups '("mail+" "gnus.gener+al" "archive.2007.10")))
>> (mapconcat
>> #'identity
>> (mapcar
>> (lambda (group-name)
>> (mapconcat #'regexp-quote
>> (split-string
>> (gnus-group-real-name group-name)
>> "[.\\/]")
>> "[.\\\\/]"))
>> groups)
>> "\\|"))
>
> AKA:
>
> (let ((groups '("mail+" "gnus.gener+al" "archive.2007.10")))
> (mapconcat
> (lambda (group-name)
> (mapconcat #'regexp-quote
> (split-string
> (gnus-group-real-name group-name)
> "[.\\/]")
> "[.\\\\/]"))
> groups
> "\\|"))
Ha! That was a brain malfunction.
>> Also, I'd prefer not to use rx in this case, simply because this:
>>
>> "[.\\/]"
>>
>> turns into this:
>>
>> (rx (or "\\." "\\\\" "/"))
>
> Or (rx (in "./\\")), or (rx (in ?. ?/ ?\\)), or...
That first one's not bad, but I still don't feel like it's a real
improvement over the plain regexp.
Anyway, thanks for the tuneup. I think we can just go with this.
Eric