guix: emacs-utils: Support disabling native-compilation.

* guix/build/emacs-utils.scm (emacs-batch-disable-compilation): Add ‘native?’
argument and honour it.
This commit is contained in:
Liliana Marie Prikler 2022-10-14 20:41:33 +02:00
parent a86979b41a
commit 8b809a31fa
No known key found for this signature in database
GPG Key ID: 442A84B8C70E2F87
1 changed files with 8 additions and 3 deletions

View File

@ -75,10 +75,15 @@ true, evaluate using dynamic scoping."
(string-append "--visit=" file)
(string-append "--eval=" (expr->string expr))))
(define (emacs-batch-disable-compilation file)
(define* (emacs-batch-disable-compilation file #:key native?)
"Disable byte compilation for FILE.
If NATIVE?, only disable native compilation."
(emacs-batch-edit-file file
'(progn
(add-file-local-variable 'no-byte-compile t)
`(progn
(add-file-local-variable ',(if native?
'no-native-compile
'no-byte-compile)
t)
(basic-save-buffer))))
(define-condition-type &emacs-batch-error &error