all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thierry Volpiatto <thievol@posteo.net>
To: Philip Kaludercic <philipk@posteo.net>
Cc: emacs-devel@gnu.org
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	[thread overview]
Message-ID: <87cyyk60yo.fsf@posteo.net> (raw)
In-Reply-To: <875y4dosa4.fsf@posteo.net>

[-- Attachment #1: Type: text/plain, Size: 1501 bytes --]


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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]

      parent reply	other threads:[~2023-09-14 18:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <169468919249.10884.8856179202519044902@vcs2.savannah.gnu.org>
     [not found] ` <20230914105954.20BD1C051D0@vcs2.savannah.gnu.org>
2023-09-14 12:25   ` [nongnu] elpa/helm 07dacfe2e2 08/11: Prefer string-match-p over string-suffix-p Philip Kaludercic
2023-09-14 12:59     ` Eli Zaretskii
2023-09-14 13:06       ` Philip Kaludercic
2023-09-14 13:13         ` Eli Zaretskii
2023-09-14 16:21           ` Philip Kaludercic
2023-09-14 18:49     ` Thierry Volpiatto [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87cyyk60yo.fsf@posteo.net \
    --to=thievol@posteo.net \
    --cc=emacs-devel@gnu.org \
    --cc=philipk@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.