Subject: Re: [bug#76420] [PATCH] gnu: Add canvasblocker/icecat.

From: Ludovic Courtès <[email-masked]>
Date: Mon, 10 Mar 2025 14:41:56 +0100

Nicolas Graves <[email-masked]> skribis:

> * gnu/packages/browser-extensions.scm (canvasblocker/icecat): New variable.

[...]

> +       (snippet
> +        #~(for-each
> +           (match-lambda
> +             ((? file-is-directory? dir)
> +              (delete-file-recursively dir))
> +             (file
> +              (delete-file file)))
> +           (remove (cut member <> '("." ".tools" ".."))
> +                   (append
> +                    ;; Hidden files and directories
> +                    (filter (cut string-prefix? "." <>) (scandir "."))
> +                    '("canvasblocker.xpi" "package-lock.json")))))))

filter + remove + match: sounds like we could make it less verbose.

Maybe with:

  (for-each (match-lambda
              ((or "." ".." ".tools") #t)
              ( …)
            (scandir "."))

?

Apart from that it LGTM!

Ludo’.