>From 19af88158eeb10d01a230c2f5bc49d4e933d35b7 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sun, 15 Apr 2018 22:46:26 -0400 Subject: [PATCH 02/30] emacs-utils: Use invoke instead of system*. * guix/build/emacs-utils.scm (guix): Use (guix build utils) for `invoke'. (emacs-batch-eval): Replace `system*' usage with `invoke'. (emacs-batch-edit-file): Likewise. * guix/build/emacs-build-system.scm: (make-autoloads): No need to return #t explicitly since the function now uses `invoke'. --- guix/build/emacs-build-system.scm | 3 +-- guix/build/emacs-utils.scm | 14 +++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/guix/build/emacs-build-system.scm b/guix/build/emacs-build-system.scm index 3ab3f91f7..dc404f04f 100644 --- a/guix/build/emacs-build-system.scm +++ b/guix/build/emacs-build-system.scm @@ -205,8 +205,7 @@ store in '.el' files." (elpa-name (package-name->name+version elpa-name-ver)) (el-dir (string-append out %install-suffix "/" elpa-name-ver))) (parameterize ((%emacs emacs)) - (emacs-generate-autoloads elpa-name el-dir)) - #t)) + (emacs-generate-autoloads elpa-name el-dir)))) (define (emacs-package? name) "Check if NAME correspond to the name of an Emacs package." diff --git a/guix/build/emacs-utils.scm b/guix/build/emacs-utils.scm index 8389ca582..2bd4e3985 100644 --- a/guix/build/emacs-utils.scm +++ b/guix/build/emacs-utils.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2014 Mark H Weaver ;;; Copyright © 2014 Alex Kost +;;; Copyright © 2018 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -18,6 +19,7 @@ ;;; along with GNU Guix. If not, see . (define-module (guix build emacs-utils) + #:use-module (guix build utils) #:export (%emacs emacs-batch-eval emacs-batch-edit-file @@ -39,16 +41,14 @@ (define (emacs-batch-eval expr) "Run Emacs in batch mode, and execute the elisp code EXPR." - (unless (zero? (system* (%emacs) "--quick" "--batch" - (format #f "--eval=~S" expr))) - (error "emacs-batch-eval failed!" expr))) + (invoke (%emacs) "--quick" "--batch" + (format #f "--eval=~S" expr))) (define (emacs-batch-edit-file file expr) "Load FILE in Emacs using batch mode, and execute the elisp code EXPR." - (unless (zero? (system* (%emacs) "--quick" "--batch" - (string-append "--visit=" file) - (format #f "--eval=~S" expr))) - (error "emacs-batch-edit-file failed!" file expr))) + (invoke (%emacs) "--quick" "--batch" + (string-append "--visit=" file) + (format #f "--eval=~S" expr))) (define (emacs-generate-autoloads name directory) "Generate autoloads for Emacs package NAME placed in DIRECTORY." -- 2.16.1