diff options
Diffstat (limited to 'guix/build/emacs-utils.scm')
-rw-r--r-- | guix/build/emacs-utils.scm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/guix/build/emacs-utils.scm b/guix/build/emacs-utils.scm index 885fd0a217..ab64e3714c 100644 --- a/guix/build/emacs-utils.scm +++ b/guix/build/emacs-utils.scm @@ -41,16 +41,22 @@ ;; The `emacs' command. (make-parameter "emacs")) +(define (expr->string expr) + "Converts EXPR, an expression, into a string." + (if (string? expr) + expr + (format #f "~s" expr))) + (define (emacs-batch-eval expr) "Run Emacs in batch mode, and execute the elisp code EXPR." (invoke (%emacs) "--quick" "--batch" - (format #f "--eval=~S" expr))) + (string-append "--eval=" (expr->string expr)))) (define (emacs-batch-edit-file file expr) "Load FILE in Emacs using batch mode, and execute the elisp code EXPR." (invoke (%emacs) "--quick" "--batch" (string-append "--visit=" file) - (format #f "--eval=~S" expr))) + (string-append "--eval=" (expr->string expr)))) (define (emacs-batch-disable-compilation file) (emacs-batch-edit-file file |