emacs-devel
[Top][All Lists]
Advanced

[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: Thierry Volpiatto
Subject: Re: [nongnu] elpa/helm 07dacfe2e2 08/11: Prefer string-match-p over string-suffix-p
Date: Thu, 14 Sep 2023 18:49:28 +0000

Philip Kaludercic <philipk@posteo.net> writes:

> ELPA Syncer <elpasync@gnu.org> writes:
>
>> branch: elpa/helm
>> commit 07dacfe2e2db980a9e42afef2fc8539c155fdd0d
>> Author: Thierry Volpiatto <thievol@posteo.net>
>> Commit: Thierry Volpiatto <thievol@posteo.net>
>>
>>     Prefer string-match-p over string-suffix-p
>> ---
>>  helm-lib.el | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/helm-lib.el b/helm-lib.el
>> index 2a93271f57..70df22089c 100644
>> --- 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?

Just a preference, I tried string-suffix-p but I prefer string-match-p
which is more readable, for me at least.

> Also, I assume you want to quote the period in ".gz\\'"?

Yes, my mistake.

> If so, I can recommend using `rx' or `wildcard-to-regexp' to avoid
> mistakes like these.

No thanks, I hate rx and unneeded complications more generally, I am used
to plain regexps.

>
>>                                   "gzip -c -q -d" "cat")
>>                               (shell-quote-argument file)
>>                               regexp)


-- 
Thierry

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]