From: Maxime Devos <maximedevos@telenet.be>
To: "Vagrant Cascadian" <vagrant@debian.org>,
"Simon Tournier" <zimon.toutoune@gmail.com>,
"Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: guix lint false positives and RFC patch
Date: Sat, 28 Jan 2023 22:24:17 +0100 [thread overview]
Message-ID: <9d462d45-5953-b27f-f511-9ff48ecf8a8b@telenet.be> (raw)
In-Reply-To: <87bkmigyfx.fsf@yucca>
[-- Attachment #1.1.1: Type: text/plain, Size: 917 bytes --]
On 28-01-2023 22:07, Vagrant Cascadian wrote:
> The other thing I remember being caught up on, which was not a
> deal-breaker, per se, was hoping for a way to loop through a bunch of
> @SOMETHING things ... I was not happy with:
>
> + (if (>= (string-length (string-replace-substring
> + (string-replace-substring synopsis "@acronym" "")
> + "@code" ""))
> + 80)
>
> And then adding @command, @file, @acronym, etc. ... using increasingly
> nested levels string-replace-substring would eventually become difficult
> to read and surely there is a better way!
How about some regex:
(define regexp
(delay (make-regexp "@(code|acronym|file)\\b")))
(define example "stuff @acronym @code @file")
(regexp-substitute/global #f (force regexp) example 'pre "" 'post)
$4 = "stuff ".
Greetings,
Maxime.
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]
prev parent reply other threads:[~2023-01-28 21:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-03 3:29 guix lint false positives and RFC patch Vagrant Cascadian
2022-11-03 15:20 ` Ludovic Courtès
2022-11-03 23:46 ` Vagrant Cascadian
2022-11-04 22:24 ` Vagrant Cascadian
2022-11-05 17:52 ` Ludovic Courtès
2022-11-13 1:54 ` Vagrant Cascadian
2022-11-17 15:03 ` Ludovic Courtès
2023-01-27 17:42 ` Simon Tournier
2023-01-28 21:07 ` Vagrant Cascadian
2023-01-28 21:24 ` Maxime Devos [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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9d462d45-5953-b27f-f511-9ff48ecf8a8b@telenet.be \
--to=maximedevos@telenet.be \
--cc=guix-devel@gnu.org \
--cc=ludo@gnu.org \
--cc=vagrant@debian.org \
--cc=zimon.toutoune@gmail.com \
/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 public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).