unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Fredrik Salomonsson <plattfot@posteo.net>
Cc: 55420@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	[thread overview]
Message-ID: <87ee08t8z5.fsf_-_@gnu.org> (raw)
In-Reply-To: <20220514230508.27885-1-plattfot@posteo.net> (Fredrik Salomonsson's message of "Sat, 14 May 2022 23:05:07 +0000")

Hi Fredrik,

The patches LGTM modulo cosmetic issues:

Fredrik Salomonsson <plattfot@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’.
     




  parent reply	other threads:[~2022-06-01 20:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-14 23:00 [bug#55420] [PATCH 0/2] Add a function to parse emacs elisp's package header Fredrik Salomonsson
2022-05-14 23:05 ` [bug#55420] [PATCH 1/2] guix: emacs-utils: Add emacs-batch-script Fredrik Salomonsson
2022-05-14 23:05   ` [bug#55420] [PATCH 2/2] guix: emacs-utils: Add emacs-header-parse Fredrik Salomonsson
2022-06-01 20:39     ` [bug#55420] [PATCH 0/2] Add a function to parse emacs elisp's package header Ludovic Courtès
2022-06-01 20:38   ` Ludovic Courtès [this message]
2022-06-02  2:53     ` Fredrik Salomonsson
2022-06-02 13:44       ` Ludovic Courtès
2022-06-05  0:42         ` Fredrik Salomonsson
2022-06-05  0:19 ` [bug#55420] [PATCH v2 1/2] guix: emacs-utils: Add emacs-batch-script Fredrik Salomonsson
2022-06-05  0:19   ` [bug#55420] [PATCH v2 2/2] guix: emacs-utils: Add emacs-header-parse Fredrik Salomonsson
2022-06-05  9:52   ` [bug#55420] [PATCH v2 1/2] guix: emacs-utils: Add emacs-batch-script Maxime Devos
2022-06-05 20:02     ` Fredrik Salomonsson
2022-06-05 19:51 ` [bug#55420] [PATCH v3 " Fredrik Salomonsson
2022-06-05 19:51   ` [bug#55420] [PATCH v3 2/2] guix: emacs-utils: Add emacs-header-parse Fredrik Salomonsson
2022-06-17 20:29   ` bug#55420: [PATCH 0/2] Add a function to parse emacs elisp's package header Ludovic Courtès

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=87ee08t8z5.fsf_-_@gnu.org \
    --to=ludo@gnu.org \
    --cc=55420@debbugs.gnu.org \
    --cc=plattfot@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 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).