[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [nongnu] elpa/helm 07dacfe2e2 08/11: Prefer string-match-p over stri
From: |
Philip Kaludercic |
Subject: |
Re: [nongnu] elpa/helm 07dacfe2e2 08/11: Prefer string-match-p over string-suffix-p |
Date: |
Thu, 14 Sep 2023 13:06:47 +0000 |
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Philip Kaludercic <philipk@posteo.net>
>> Cc: Thierry Volpiatto <thievol@posteo.net>
>> Date: Thu, 14 Sep 2023 12:25:55 +0000
>>
>> ELPA Syncer <elpasync@gnu.org> writes:
>>
>> > --- a/helm-lib.el
>> > +++ b/helm-lib.el
>> > @@ -1732,7 +1732,7 @@ Directories expansion is not supported."
>> > (with-temp-buffer
>> > (call-process-shell-command
>> > (format cmd
>> > - (if (string-suffix-p ".gz" file)
>> > + (if (string-match-p ".gz\\'" file)
>>
>> Is there a reason for this preference?
>
> I think this change is simply incorrect: the first argument of
> string-suffix-p is not interpreted as a regexp, but as a simple
> literal string (the implementation uses compare-strings internally).
But why is it incorrect? `string-suffix-p' is passed a string, while
`string-match-p' takes a regular expression, that might be too liberal
but should still match everything the previous check did -- or am I
missing something?
>> Also, I assume you want to quote the period in ".gz\\'"?
>
> No need to quote it, see above.