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: Philip Kaludercic
Subject: Re: [nongnu] elpa/helm 07dacfe2e2 08/11: Prefer string-match-p over string-suffix-p
Date: Thu, 14 Sep 2023 12:25:55 +0000

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?  Also, I assume you want to quote
the period in ".gz\\'"?  If so, I can recommend using `rx' or
`wildcard-to-regexp' to avoid mistakes like these.

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



reply via email to

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