GNU bug report logs - #55420
[PATCH 0/2] Add a function to parse emacs elisp's package header

Previous Next

Package: guix-patches;

Reported by: Fredrik Salomonsson <plattfot <at> posteo.net>

Date: Sat, 14 May 2022 23:01:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ludovic Courtès <ludo <at> gnu.org>
To: Fredrik Salomonsson <plattfot <at> posteo.net>
Cc: 55420 <at> debbugs.gnu.org
Subject: [bug#55420] [PATCH 0/2] Add a function to parse emacs elisp's package header
Date: Wed, 01 Jun 2022 22:38:38 +0200
Hi Fredrik,

The patches LGTM modulo cosmetic issues:

Fredrik Salomonsson <plattfot <at> posteo.net> skribis:

> * guix/build/emacs-utils.scm (emacs-batch-script): New procedure.

[...]

> +(define (emacs-batch-script expr)
> +  "Execute the Elisp code EXPR in Emacs batch mode and return output."
> +  (call-with-port
> +      (open-pipe*
> +       OPEN_READ
> +       (%emacs) "--quick" "--batch"
> +       (string-append "--eval=" (expr->string expr)))
> +    read-string))

I suggest something like:

  (let* ((pipe (open-pipe* …))
         (output (read-string pipe))
         (status (close-pipe pipe)))
    (unless (zero? status)
      ;; Use SRFI-34 + either a &message condition or (better)
      ;; a dedicate SRFI-35 condition type for the error.
      (raise (condition …)))
    output)

That way, execution failures would be caught and reported.

Ludo’.
     




This bug report was last modified 3 years and 34 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.