summaryrefslogtreecommitdiff
path: root/guix/scripts
diff options
context:
space:
mode:
authorMathieu Lirzin <mthl@gnu.org>2015-11-21 14:37:54 +0100
committerMathieu Lirzin <mthl@gnu.org>2015-12-06 17:23:21 +0100
commitb16dbd1311c9bd1346dcf0d490f25455e12b04cf (patch)
treeafacc29802629bf9a0f61ee8675fd78ba59f9360 /guix/scripts
parent2f52ad7413aabecb7ef7b210d6d958b8aface9d4 (diff)
edit: Allow command line arguments in $VISUAL and $EDITOR.
* guix/scripts/edit.scm (guix-edit): Fix the assumption that %editor is a one word command.
Diffstat (limited to 'guix/scripts')
-rw-r--r--guix/scripts/edit.scm8
1 files changed, 6 insertions, 2 deletions
diff --git a/guix/scripts/edit.scm b/guix/scripts/edit.scm
index 73a5bb78d2..660bd57985 100644
--- a/guix/scripts/edit.scm
+++ b/guix/scripts/edit.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015 Mathieu Lirzin <mthl@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -83,8 +84,11 @@ line."
(catch 'system-error
(lambda ()
- (apply execlp (%editor) (%editor)
- (append-map package->location-specification packages)))
+ (let ((file-names (append-map package->location-specification
+ packages)))
+ ;; Use `system' instead of `exec' in order to sanely handle
+ ;; possible command line arguments in %EDITOR.
+ (exit (system (string-join (cons (%editor) file-names))))))
(lambda args
(let ((errno (system-error-errno args)))
(leave (_ "failed to launch '~a': ~a~%")