From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id cNlDJwg2gGIQ/AAAbAwnHQ (envelope-from ) for ; Sun, 15 May 2022 01:06:48 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id MM4WJwg2gGKffwEAauVa8A (envelope-from ) for ; Sun, 15 May 2022 01:06:48 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 43976E812 for ; Sun, 15 May 2022 01:06:48 +0200 (CEST) Received: from localhost ([::1]:41222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nq0qU-0007Zd-Bd for larch@yhetil.org; Sat, 14 May 2022 19:06:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nq0pn-0007J2-CQ for guix-patches@gnu.org; Sat, 14 May 2022 19:06:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53811) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nq0pm-0001UJ-J3 for guix-patches@gnu.org; Sat, 14 May 2022 19:06:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nq0pm-0002ki-Ev for guix-patches@gnu.org; Sat, 14 May 2022 19:06:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55420] [PATCH 1/2] guix: emacs-utils: Add emacs-batch-script. References: <20220514230017.27372-1-plattfot@posteo.net> In-Reply-To: <20220514230017.27372-1-plattfot@posteo.net> Resent-From: Fredrik Salomonsson Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 14 May 2022 23:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55420 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55420@debbugs.gnu.org Cc: Fredrik Salomonsson Received: via spool by 55420-submit@debbugs.gnu.org id=B55420.165256952210513 (code B ref 55420); Sat, 14 May 2022 23:06:02 +0000 Received: (at 55420) by debbugs.gnu.org; 14 May 2022 23:05:22 +0000 Received: from localhost ([127.0.0.1]:47705 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nq0p8-0002jU-IL for submit@debbugs.gnu.org; Sat, 14 May 2022 19:05:22 -0400 Received: from mout01.posteo.de ([185.67.36.65]:57871) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nq0p7-0002jG-AC for 55420@debbugs.gnu.org; Sat, 14 May 2022 19:05:21 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 81DBB240026 for <55420@debbugs.gnu.org>; Sun, 15 May 2022 01:05:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1652569515; bh=nLx4SCMIiphivWa8LKGj/QosQ91bRVpPl9ClRBXDdgo=; h=From:To:Cc:Subject:Date:From; b=QlanBXaZby38Pny+B9mYRgIDbAEHP/ixHxJ4GqrEqaf9MJLUQGFr1f/G2AwSlXVeZ cdUD5PRssgyD6ronRXwUcitOkkfSanmftJhPyk0Q6pEMZk8+m7kipuBKoLjkxC4Xgx 0bhrsy5tCwSUInxp6ZNQrHpsAKh/fDugxzn/oWiHkBjdXKQ9dFKllRxgMgchksyet5 +Lvr1+8O+FYUBSehIfmGK09t3J0DzjS9qrSROVRf4oPkPqQW+eA5JQ1VSWSKShJL0h L3fmpxsyWQhpi9m4Y1jP+fqAPwRpFG8T/SHkpSifiE/WxBzqXQI/fV3sPDjVVrfw9N 4QuQDCPpzeibg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4L11Ly4LH7z9rxD; Sun, 15 May 2022 01:05:14 +0200 (CEST) From: Fredrik Salomonsson Date: Sat, 14 May 2022 23:05:07 +0000 Message-Id: <20220514230508.27885-1-plattfot@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1652569608; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=qhpbWxFFWI9EJrxnHpn435bmb9kc736qwMKlwrc06os=; b=dZeyq8w91XaA4rZcI8vmPC/B/uCFFYyZ6UR/p9+yG+OLJoiD8VqDwhxKV4jesYi+XNi7VM xf9u6t/6O9TSzstebab++dQotq6RMmQbXUJLC1EovZwURsHH3RCiZTlyaZRBsAGkxhkOXM wuwAl96BYAVNVOvl71Dcu+peT/AyFbS5rwv3VStmAB33TZFub39oQ/ZjRmZhE3CQQ1mHdw Z2F59qQn9CpWsWYvneEniUEEWD6o8heRsquEtrzisTA8qoBAAc3cGqKEViZ/aM8O3R5nfw TD8tix1LH8ALvqQdj8Boq4P+FsSx+gYj+RtObvzQq3nQK+BXtVPGLLtqqTTYiQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652569608; a=rsa-sha256; cv=none; b=oWoJ5J9RyAGmbfMfAz3rOA9+jM92oxZ6+c+MYg/cYKcMvWlHXPsVLUM6R50+Es2BXTlchr eHH6yn/k50sfj99586k19hoq3RUKGq81JEPuXu4b/udwbEW+PYCfii/NHX1FZdt34yR/10 rZk8V7xMPcnAxnFoHnEGmOSeftsdfR+EO2GgmcH3DGkpv+MeJzXZfoEaCCo8SGgI7Xcydt RgvCR8LHHqHbePVvrz79zmY5u/JepwDvMudMEkItxMfAp2C/7z+Wtp2T3XsUR6KodCpNMj EhVM/tYO4oTcyBHw/+nm+EYxNATCrFdwAATTrzZV9dmru5ajERr/cxzx439euQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=QlanBXaZ; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 5.97 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=QlanBXaZ; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 43976E812 X-Spam-Score: 5.97 X-Migadu-Scanner: scn0.migadu.com X-TUID: +J9WaVw4aMrr * guix/build/emacs-utils.scm (emacs-batch-script): New procedure. --- guix/build/emacs-utils.scm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/guix/build/emacs-utils.scm b/guix/build/emacs-utils.scm index 60a754b9e9..8d40b9e139 100644 --- a/guix/build/emacs-utils.scm +++ b/guix/build/emacs-utils.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2014 Alex Kost ;;; Copyright © 2018, 2020, 2022 Maxim Cournoyer ;;; Copyright © 2019 Liliana Marie Prikler +;;; Copyright © 2022 Fredrik Salomonsson ;;; ;;; This file is part of GNU Guix. ;;; @@ -22,10 +23,13 @@ (define-module (guix build emacs-utils) #:use-module (guix build utils) #:use-module (ice-9 format) + #:use-module (ice-9 popen) + #:use-module (ice-9 rdelim) #:export (%emacs emacs-batch-eval emacs-batch-edit-file emacs-batch-disable-compilation + emacs-batch-script emacs-generate-autoloads emacs-byte-compile-directory @@ -69,6 +73,15 @@ (define (emacs-batch-disable-compilation file) (add-file-local-variable 'no-byte-compile t) (basic-save-buffer)))) +(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)) + (define (emacs-generate-autoloads name directory) "Generate autoloads for Emacs package NAME placed in DIRECTORY." (let* ((file (string-append directory "/" name "-autoloads.el")) -- 2.36.0