diff options
author | Jakub Kądziołka <kuba@kadziolka.net> | 2020-03-29 00:38:13 +0100 |
---|---|---|
committer | Jakub Kądziołka <kuba@kadziolka.net> | 2020-03-29 00:38:13 +0100 |
commit | 44fb8cf84107bf2baa207216fda0ee5476bafb74 (patch) | |
tree | ccfe580739e308a604fea9b05943294e2f2e9e69 /guix/build/emacs-utils.scm | |
parent | 87bc9f022cdd3487e85cf83cf82222315246abf9 (diff) | |
parent | 62b9ad19e3a6638f8e077753454fdf08ba586146 (diff) |
Merge branch 'master' into staging
Diffstat (limited to 'guix/build/emacs-utils.scm')
-rw-r--r-- | guix/build/emacs-utils.scm | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/guix/build/emacs-utils.scm b/guix/build/emacs-utils.scm index ab64e3714c..5f7ba71244 100644 --- a/guix/build/emacs-utils.scm +++ b/guix/build/emacs-utils.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2014, 2018 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2014 Alex Kost <alezost@gmail.com> -;;; Copyright © 2018 Maxim Cournoyer <maxim.cournoyer@gmail.com> +;;; Copyright © 2018, 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2019 Leo Prikler <leo.prikler@student.tugraz.at> ;;; ;;; This file is part of GNU Guix. @@ -21,6 +21,7 @@ (define-module (guix build emacs-utils) #:use-module (guix build utils) + #:use-module (ice-9 format) #:export (%emacs emacs-batch-eval emacs-batch-edit-file @@ -47,10 +48,12 @@ expr (format #f "~s" expr))) -(define (emacs-batch-eval expr) - "Run Emacs in batch mode, and execute the elisp code EXPR." +(define* (emacs-batch-eval expr #:key dynamic?) + "Run Emacs in batch mode, and execute the Elisp code EXPR. If DYNAMIC? is +true, evaluate using dynamic scoping." (invoke (%emacs) "--quick" "--batch" - (string-append "--eval=" (expr->string expr)))) + (format #f "--eval=(eval '~a ~:[t~;nil~])" + (expr->string expr) dynamic?))) (define (emacs-batch-edit-file file expr) "Load FILE in Emacs using batch mode, and execute the elisp code EXPR." @@ -70,7 +73,7 @@ (expr `(let ((backup-inhibited t) (generated-autoload-file ,file)) (update-directory-autoloads ,directory)))) - (emacs-batch-eval expr))) + (emacs-batch-eval expr #:dynamic? #t))) (define* (emacs-byte-compile-directory dir) "Byte compile all files in DIR and its sub-directories." |